Exemplo n.º 1
0
        private void Help()
        {
            try
            {
                converter.waitForLoadingAllPlugins();

                bool bHelp = true;

                if ((_OutType != null) &&
                    !_BadArgs)
                {
                    ECGConfig
                        cfg1 = null,
                        cfg2 = null;

                    IECGFormat format = converter.getFormat(_OutType);

                    if (format != null)
                    {
                        bHelp = false;

                        cfg1 = format.Config;
                    }
                    else
                    {
                        IECGManagementSystem manSys = converter.getECGManagementSystem(_OutType);

                        if (manSys != null)
                        {
                            bHelp = false;

                            cfg1 = manSys.Config;
                            cfg2 = converter.getFormat(manSys.FormatName).Config;
                        }
                    }

                    if (bHelp)
                    {
                        _Error = "Unknown type!";
                        Error();
                    }
                    else
                    {
                        int nrItems = cfg1 != null ? cfg1.NrConfigItems : 0;

                        if (cfg2 != null)
                        {
                            nrItems += cfg1.NrConfigItems;
                        }

                        if (nrItems == 0)
                        {
                            Console.WriteLine("Exporting type {0} has got zero configuration items!", _OutType);
                            Console.WriteLine();
                        }
                        else
                        {
                            Console.WriteLine("Exporting type {0} has got the following configuration items:", _OutType);

                            nrItems = cfg1 != null ? cfg1.NrConfigItems : 0;

                            for (int i = 0; i < nrItems; i++)
                            {
                                string
                                    name = cfg1[i],
                                    def  = cfg1[name];

                                Console.Write("  {0}", name);
                                if (def != null)
                                {
                                    Console.Write(" (default value: \"");
                                    Console.Write(def);
                                    Console.Write("\")");
                                }
                                Console.WriteLine();
                            }

                            nrItems = cfg2 != null ? cfg2.NrConfigItems : 0;

                            for (int i = 0; i < nrItems; i++)
                            {
                                string
                                    name = cfg2[i],
                                    def  = cfg2[name];

                                Console.Write("  {0}", name);
                                if (def != null)
                                {
                                    Console.Write(" (default value: \"");
                                    Console.Write(def);
                                    Console.Write("\")");
                                }
                                Console.WriteLine();
                            }
                        }
                    }
                }

                if (bHelp)
                {
                    string outputTypes, outputECGMS;

                    StringBuilder sb = new StringBuilder();

                    foreach (string str in converter.getSupportedFormatsList())
                    {
                        if (sb.Length != 0)
                        {
                            sb.Append(", ");
                        }

                        sb.Append(str);
                    }

                    outputTypes = sb.ToString();

                    sb = new StringBuilder();

                    foreach (string str in converter.getSupportedManagementSystemsList())
                    {
                        if (converter.hasECGManagementSystemSaveSupport(str))
                        {
                            if (sb.Length != 0)
                            {
                                sb.Append(", ");
                            }

                            sb.Append(str);
                        }
                    }

                    outputECGMS = sb.Length == 0 ? "(none)" : sb.ToString();

                    Console.WriteLine("Usage: ECGTool [-A] [-P patid] [-I intype] [-bsl nrsec] [-bol nrsec] [-C \"var=val\" [...]] filein [offset] outtype fileout");
                    Console.WriteLine("       ECGTool [-A] [-P patid] [-I intype] [-bsl nrsec] [-bol nrsec] [-C \"var=val\" [...]] filein [offset] outecgms");
                    Console.WriteLine("       ECGTool -h [outtype | outecgms | intype]");
                    Console.WriteLine();
                    Console.WriteLine("  filein     path to input file");
                    Console.WriteLine("  offset     offset in input file");
                    Console.WriteLine("  outtype    type of ouput file: {0}", outputTypes);
                    Console.WriteLine("  fileout    path for output file");
                    Console.WriteLine("  outecgms   type of output ECG Management System: {0}", outputECGMS);
                    Console.WriteLine("  -A         anonymize output");
                    Console.WriteLine("  -P patid   specifiy a Patient ID for ECG");
                    Console.WriteLine("  -I intype  specify an input type");
                    Console.WriteLine("  -bsl nrsec buffered seconds to load (add to value: s, m, h, d or w) or use: all");
                    Console.WriteLine("  -bol nrsec buffered seconds offset to load (add to value: s, m, h, d or w)");
                    Console.WriteLine("  -C var=val providing a configuration item");
                }
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine("Error: {0}", ex.ToString());
            }
        }
Exemplo n.º 2
0
        private void Help()
        {
            try
            {
                string outputTypes, outputECGMS;

                converter.waitForLoadingAllPlugins();
                ECGConfig cfg = converter.getConfig("PDF");

                StringBuilder sb = new StringBuilder();

                foreach (string str in converter.getSupportedFormatsList())
                {
                    if (sb.Length != 0)
                    {
                        sb.Append(", ");
                    }

                    sb.Append(str);
                }

                outputTypes = sb.ToString();

                sb = new StringBuilder();

                foreach (string str in converter.getSupportedManagementSystemsList())
                {
                    if (converter.hasECGManagementSystemSaveSupport(str))
                    {
                        if (sb.Length != 0)
                        {
                            sb.Append(", ");
                        }

                        sb.Append(str);
                    }
                }

                outputECGMS = sb.Length == 0 ? "(none)" : sb.ToString();

                Console.WriteLine("Usage: ECGPrint [-A] [-S] [-P patid] {0} filein [offset]", ((cfg == null) ? "" : "[-C \"var=val\" [...]]"));
                Console.WriteLine("       ECGPrint -h");
                Console.WriteLine();
                Console.WriteLine("  filein     path to input file");
                Console.WriteLine("  offset     offset in input file (optional)");
                Console.WriteLine("  -A         anonymize output");
                Console.WriteLine("  -S         silently print");
                Console.WriteLine("  -h         provides this help message");
                Console.WriteLine("  -P patid   specifiy a Patient ID for ECG");

                if (cfg != null)
                {
                    Console.WriteLine("  -C var=val providing a configuration item");
                    Console.WriteLine();
                    Console.WriteLine("Exporting type PDF has got the following configuration items:");

                    int nrItems = cfg.NrConfigItems;

                    for (int i = 0; i < nrItems; i++)
                    {
                        string
                            name = cfg[i],
                            def  = cfg[name];

                        Console.Write("  {0}", name);
                        if (def != null)
                        {
                            Console.Write(" (default value: \"");
                            Console.Write(def);
                            Console.Write("\")");
                        }
                        Console.WriteLine();
                    }
                }
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine("Error: {0}", ex.ToString());
            }
        }