コード例 #1
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     // Perform any additional setup after loading the view, typically from a nib.
     if (RISCanvasView != null)
     {
         string[]          cycleNames = { "TEG Unit #10", "TEG Unit #9", "TEG Unit #8", "TEG Unit #7", "Pole Rectifier",
                                          "TEG Unit #6",           "TEG Unit #5", "TEG Unit #4", "TEG Unit #3", "TEG Unit #2",   "TEG Unit #1","MP 156.13", "MP 153.5", "MP 148.5" };
         InterruptionCycle cycle = new MultiSetInterruptionCycle("Testing Set 1", 17, 5, 2, cycleNames);
         string[]          files = NSBundle.GetPathsForResources(".csv", NSBundle.MainBundle.BundlePath);
         //string[] files = Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "*.csv", SearchOption.AllDirectories);
         //string[] files = Directory.GetFiles(@"C:\Users\kcron\Desktop\RIS\Phase 1\SET 2\", "*.csv");
         if (files.Length > 0)
         {
             foreach (string file in files)
             {
                 var set   = new RISDataSet(file, cycle);
                 var graph = new RISGraph(set);
                 RISCanvasView.AddGraph(graph);
             }
             //_Graph = graph;
         }
         //RISCanvasView.SetNeedsDisplay();
     }
 }
コード例 #2
0
        public void UpdateGraphs()
        {
            if (!Directory.Exists(Folder) && (Files == null || Files.Length == 0))
            {
                return;
            }
            if (Cycle == null)
            {
                return;
            }
            string[] files;
            if (Directory.Exists(Folder))
            {
                files = Directory.GetFiles(Folder, "*.csv", Subfolders ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
            }
            else
            {
                files = Files;
            }
            mSets = new List <RISDataSet>();
            RISDataSet set;
            double     min = double.MaxValue;
            double     max = double.MinValue;
            Read       read;
            DateTime   start;

            mCurrentSet = 0;
            string output = "";

            foreach (string file in files)
            {
                set   = new RISDataSet(file, Cycle);
                read  = set.DataReads[0];
                start = Cycle.GetNextCycleStart(read.UTCTime);
                if (set.MinValueData < min)
                {
                    min = set.MinValueData;
                }
                if (set.MaxValueData > max)
                {
                    max = set.MaxValueData;
                }
                set.GetPaths();
                output += set.FileName + "," + set.Output + "\n";
                mSets.Add(set);
            }
            txtCycle.Text = mSets[mCurrentSet].FileName;
            mGraph.Graph  = new RISGraph(mSets[mCurrentSet]);
            mGraph.Invalidate();
        }