Exemple #1
0
        public static void TestArgosAwsGen3File()
        {
            const string path = @"..\..\SampleFiles\53478_20130129_Gen3.aws";

            Console.WriteLine("File {0}", path);
            ArgosFile a         = new ArgosAwsFile(path);
            var       processor = new Gen3Processor(TimeSpan.FromMinutes(24 * 60));

            SummarizeFile(a);
            Console.WriteLine("Messages in File");
            foreach (var s in processor.ProcessTransmissions(a.GetTransmissions(), a))
            {
                Console.WriteLine(s);
            }
        }
Exemple #2
0
        public static void TestArgosFolder()
        {
            const string id    = "60793";
            const int    hours = 25;

            const string inPath  = @"C:\tmp\Argos_Emails";
            const string outPath = @"C:\tmp\reports\" + id + "_2012a.txt";

            if (!Directory.Exists(inPath))
            {
                Console.Write("Invalid Directory {0}", inPath);
            }
            Console.Write("Processing Directory {0}", inPath);
            using (var f = new StreamWriter(outPath))
            {
                foreach (var file in Directory.EnumerateFiles(inPath))
                {
                    var path = Path.Combine(inPath, file);
                    Console.WriteLine("  File {0}", file);
                    ArgosFile a         = new ArgosEmailFile(path);
                    var       processor = new Gen3Processor(TimeSpan.FromMinutes(hours * 60));
                    //CollarFinder = (i, d) => i
                    var lines = new string[0];
                    try
                    {
                        var transmissions = a.GetTransmissions().Where(t => t.PlatformId == id);
                        lines = processor.ProcessTransmissions(transmissions, a).ToArray();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("ERROR: InTelonicsToData(): {0}", ex.Message);
                    }
                    foreach (var l in lines)
                    {
                        f.WriteLine(l);
                    }
                }
            }
        }