예제 #1
0
        private void GenerateBinaryFileList(string aDataDir)
        {
            string[] someDays1 = new string[0];

            // First, find all days
            someDays1 = Directory.GetDirectories(aDataDir);

            //Merge and sort the days from both receiver directories
            ArrayList someDays = new ArrayList();

            foreach (string d in someDays1)
            {
                someDays.Add(Path.GetFileName(d));
            }
            someDays.Sort();

            foreach (string d in someDays)
            {
                Console.WriteLine("DAY: " + d);
            }

            // Now that we have a list of days sorted by date, go into each folder
            // and put together ordered list of binary files.

            foreach (string d in someDays)
            {
                // Loop over possible hours and add to list
                for (int i = 0; i < 24; i++)
                {
                    BFileInfo aBFileInfo = new BFileInfo();
                    // Check for hour dir in rec 1
                    if (Directory.Exists(aDataDir + "\\" + d + "\\" + i))
                    {
                        aBFileInfo.fileRec1 = GetBinaryMITesFile(aDataDir + "\\" + d + "\\" + i);
                    }

                    // Add if one of the receiver directories had a file
                    if (aBFileInfo.fileRec1 != "")
                    {
                        someBinaryFiles.Add(aBFileInfo);
                    }
                }
            }
            Console.WriteLine(someBinaryFiles);
        }
        private void GenerateBinaryFileList(string aDataDir)
        {
            string[] someDays1 = new string[0];

            // First, find all days 
            someDays1 = Directory.GetDirectories(aDataDir); 
            
            //Merge and sort the days from both receiver directories 
            ArrayList someDays = new ArrayList();

            foreach (string d in someDays1)
            {
                someDays.Add(Path.GetFileName(d));
            }
            someDays.Sort();

            foreach (string d in someDays)
            {
                Console.WriteLine("DAY: " + d);
            } 

            // Now that we have a list of days sorted by date, go into each folder
            // and put together ordered list of binary files. 

            foreach (string d in someDays)
            {
                // Loop over possible hours and add to list
                for (int i = 0; i < 24; i++)
                {
                    BFileInfo aBFileInfo = new BFileInfo();
                    // Check for hour dir in rec 1
                    if (Directory.Exists(aDataDir + "\\" + d + "\\" + i))
                        aBFileInfo.fileRec1 = GetBinaryMITesFile(aDataDir + "\\" + d + "\\" + i);

                    // Add if one of the receiver directories had a file
                    if (aBFileInfo.fileRec1 != "")
                        someBinaryFiles.Add(aBFileInfo);
                }
            }
            Console.WriteLine(someBinaryFiles); 
        }
예제 #3
0
        private void GenerateBinaryFileList(string aDataDir)
        {
            // Determine number of receivers

            string rec1Dir = aDataDir + "\\1";
            string rec2Dir = aDataDir + "\\2";

            int numRec = 0;
            if (Directory.Exists(rec1Dir))
                numRec++; 
            if (Directory.Exists(rec2Dir))
                numRec++; 

            if (numRec == 0)
                return;

            string[] someDays1 = new string[0];
            string[] someDays2 = new string[0];

            // First, find all days 
            someDays1 = Directory.GetDirectories(rec1Dir); 
            if (numRec == 2)
                someDays2 = Directory.GetDirectories(rec2Dir); 
            
            //Merge and sort the days from both receiver directories 
            ArrayList someDays = new ArrayList();

            foreach (string d in someDays1)
            {
                someDays.Add(Path.GetFileName(d));
            }
            foreach (string d in someDays2)
            {
                if (!someDays.Contains(Path.GetFileName(d)))
                    someDays.Add(Path.GetFileName(d));
            }
            someDays.Sort();

            foreach (string d in someDays)
            {
                Console.WriteLine("DAY: " + d);
            } 

            // Now that we have a list of days sorted by date, go into each folder
            // for both receivers, and put together ordered list of binary files. 

            foreach (string d in someDays)
            {
                // Loop over possible hours and add to list
                for (int i = 0; i < 24; i++)
                {
                    BFileInfo aBFileInfo = new BFileInfo();
                    // Check for hour dir in rec 1
                    if (Directory.Exists(rec1Dir + "\\" + d + "\\" + i))
                        aBFileInfo.fileRec1 = GetBinaryMITesFile(rec1Dir + "\\" + d + "\\" + i);
                    if (Directory.Exists(rec2Dir + "\\" + d + "\\" + i))
                        aBFileInfo.fileRec2 = GetBinaryMITesFile(rec2Dir + "\\" + d + "\\" + i);

                    // Add if one of the receiver directories had a file
                    if ((aBFileInfo.fileRec1 != "") || (aBFileInfo.fileRec2 != ""))
                        someBinaryFiles.Add(aBFileInfo);
                }
            }
            Console.WriteLine(someBinaryFiles); 
        }
예제 #4
0
        private void GenerateBinaryFileList(string aDataDir)
        {
            // Determine number of receivers

            string rec1Dir = aDataDir + "\\1";
            string rec2Dir = aDataDir + "\\2";

            int numRec = 0;

            if (Directory.Exists(rec1Dir))
            {
                numRec++;
            }
            if (Directory.Exists(rec2Dir))
            {
                numRec++;
            }

            if (numRec == 0)
            {
                return;
            }

            string[] someDays1 = new string[0];
            string[] someDays2 = new string[0];

            // First, find all days
            someDays1 = Directory.GetDirectories(rec1Dir);
            if (numRec == 2)
            {
                someDays2 = Directory.GetDirectories(rec2Dir);
            }

            //Merge and sort the days from both receiver directories
            ArrayList someDays = new ArrayList();

            foreach (string d in someDays1)
            {
                someDays.Add(Path.GetFileName(d));
            }
            foreach (string d in someDays2)
            {
                if (!someDays.Contains(Path.GetFileName(d)))
                {
                    someDays.Add(Path.GetFileName(d));
                }
            }
            someDays.Sort();

            foreach (string d in someDays)
            {
                Console.WriteLine("DAY: " + d);
            }

            // Now that we have a list of days sorted by date, go into each folder
            // for both receivers, and put together ordered list of binary files.

            foreach (string d in someDays)
            {
                // Loop over possible hours and add to list
                for (int i = 0; i < 24; i++)
                {
                    BFileInfo aBFileInfo = new BFileInfo();
                    // Check for hour dir in rec 1
                    if (Directory.Exists(rec1Dir + "\\" + d + "\\" + i))
                    {
                        aBFileInfo.fileRec1 = GetBinaryMITesFile(rec1Dir + "\\" + d + "\\" + i);
                    }
                    if (Directory.Exists(rec2Dir + "\\" + d + "\\" + i))
                    {
                        aBFileInfo.fileRec2 = GetBinaryMITesFile(rec2Dir + "\\" + d + "\\" + i);
                    }

                    // Add if one of the receiver directories had a file
                    if ((aBFileInfo.fileRec1 != "") || (aBFileInfo.fileRec2 != ""))
                    {
                        someBinaryFiles.Add(aBFileInfo);
                    }
                }
            }
            Console.WriteLine(someBinaryFiles);
        }