Beispiel #1
0
 public GraphDock CreateGraphDock()
 {
     GraphDock gd = new GraphDock();
     gd.GraphName = FileName +" "+ Type.ToString();
     gd.AddCurve(this, FileName);
     return gd;
 }
Beispiel #2
0
 public void Register(GraphDock gd)
 {
     GraphDock = gd;
     this.Invalidate();
 }
Beispiel #3
0
 public void Register(GraphDock gD)
 {
     GraphDock = gD;
 }
        private void Open(File oFile)
        {
            OpenedFile = oFile;
            OpenFiles.Add(oFile);
            GraphDock gd = new GraphDock();
            gd.GraphName = OpenedFile.FileName;
            gd.Text = "Time-" + oFile.FileName;
            gd.AddCurve(OpenedFile.AccelerationData, oFile.FileName);
            gd.AddCurve(OpenedFile.VelocityData, oFile.FileName);
            DockList.Add(gd);
            // TODO: Add from xmlFile the RMS optimum vaue and the maximum value.
            GraphEventInstance.CreatedGraph = gd;
            OnGraphCreated(GraphEventInstance);

            /*if (RMSChartingDock == null)
            {
                RMSChartingDock = new RMSChartDoc();
            }

            RMSChartingDock.AddRMSValues(System.IO.Path.GetFileName(OpenedFile.FileName), OpenedFile.VelocityData.RMS, true, (uint)(new Random().Next(3)));
            if (string.IsNullOrEmpty(RMSChartingDock.Text))
            {
                RMSChartingDock.Text = "RMS Values";
                DockList.Add(RMSChartingDock);
            }*/
            GraphDock gd2 = new GraphDock();
            gd2.GraphName = OpenedFile.FileName;
            gd2.Text = "FFT-" + oFile.FileName;
            gd2.AddCurve(OpenedFile.MagnitudeData,oFile.FileName);
            gd2.AddCurve(OpenedFile.PowerData,  oFile.FileName);
            // TODO: Add any bands that appear in the file to the graph
            DockList.Add(gd2);

            GraphEventInstance.CreatedGraph = gd2;
            OnGraphCreated(GraphEventInstance);

            //foreach (_xmlFile._dsSentry_data._band band in oFile.XMLFile.dsSentry_data.bandList)
            //{
            //    ZedGraph.BandObjList.Add(new BandObj(band.center_Freq - band.bandwidth / 2, band.bandwidth, OpenedFile.MagnitudeData.Curve, gd2.ZedGraphControl, band.TimeStampCreated, DateTime.Now, band.quant_Level), gd2.ZedGraphControl);
            //}
            //SpectroGraphDock sp = new SpectroGraphDock();
            //sp.GraphName = OpenedFile.FileName;
            //sp.AddCurve(OpenedFile.AccelerationData.Curve, CurveType.Acceleration, oFile.FileName);
            //sp.AddCurve(OpenedFile.VelocityData.Curve, CurveType.Velocity, oFile.FileName);
            //DockList.Add(sp);
            //SpectroGraphDock sp2 = new SpectroGraphDock();
            //sp2.GraphName = OpenedFile.FileName;
            //sp2.AddCurve(OpenedFile.MagnitudeData.Curve, CurveType.Magnitude, oFile.FileName);
            //sp2.AddCurve(OpenedFile.PowerData.Curve, CurveType.Power, oFile.FileName);
            //DockList.Add(sp2);
            //RMSGaugeDoc rmsGD = new RMSGaugeDoc(OpenedFile.VelocityData.RMSPref, OpenedFile.VelocityData.RMS, OpenedFile.VelocityData.RMSMax);
            //rmsGD.Text = System.IO.Path.GetFileName(OpenedFile.FileName);

            FileOpenEventArgs foea = new FileOpenEventArgs(gd, gd2, null, null);//sp, sp2);
            OnFileOpenEvent(foea);
        }
        public void Create2DDocument(CurveType type)
        {
            GraphDock gd = new GraphDock();

            foreach (File f in OpenFiles)
            {
                var curveList = from curve in f.InfoList where curve.Type == type select curve;
                foreach (CurveInfo c in curveList)
                {
                    //gd.AddCurve(c.Curve, c.Type, f.FileName);
                }
            }
            gd.Name = "Graph " + System.DateTime.Now.TimeOfDay;
            gd.Text = gd.Name;
            gd.GraphName = gd.Name;

            GraphDockList.Add(gd);
            GraphEventInstance.CreatedGraph = gd;
            OnGraphCreated(GraphEventInstance);
        }
        public void Create2DDocument(List<TypeIndexPair> tipsList)
        {
            GraphEventInstance.GraphType = GraphType.TwoD;
            GraphDock gd = new GraphDock();
            int index = 0;
            if (tipsList.Count == 1)
            {
                switch (tipsList[0].GraphType)
                {
                    case CurveType.Acceleration:
                        GraphEventInstance.CreatedGraph = OpenFiles[tipsList[0].Index].AccelerationData.CreateGraphDock();
                        break;
                    case CurveType.Magnitude:
                        GraphEventInstance.CreatedGraph = OpenFiles[tipsList[0].Index].MagnitudeData.CreateGraphDock();
                        break;
                    case CurveType.Power:
                        GraphEventInstance.CreatedGraph = OpenFiles[tipsList[0].Index].PowerData.CreateGraphDock();
                        break;
                    case CurveType.Velocity:
                        GraphEventInstance.CreatedGraph = OpenFiles[tipsList[0].Index].VelocityData.CreateGraphDock();
                        break;
                }
                GraphEventInstance.UserGraphRemoved();
                String fN = OpenFiles[tipsList[0].Index].FileName;
                gd.Text = tipsList[0].GraphType.ToString() + " " + System.IO.Path.GetFileName(fN);
            }
            else
            {
                foreach (TypeIndexPair tip in tipsList)
                {
                    String curveName = tip.GraphType.ToString() + " " + tip.FileName;
                    Console.WriteLine(tip.GraphType.ToString() + " at index: " + tip.Index);
                    index = tip.Index;
                    switch (tip.GraphType)
                    {
                        case CurveType.Acceleration:
                            gd.AddCurve(OpenFiles[index].AccelerationData,curveName);
                            //gd.AddCurve(OpenFiles[index].AccelerationData.Curve,CurveType.Acceleration,curveName);
                            break;
                        case CurveType.Velocity:
                            gd.AddCurve(OpenFiles[index].VelocityData,curveName);
                           // gd.AddCurve(OpenFiles[index].VelocityData.Curve,CurveType.Velocity,curveName);
                            break;
                        case CurveType.Magnitude:
                            gd.AddCurve(OpenFiles[index].MagnitudeData,curveName);
                           // gd.AddCurve(OpenFiles[index].MagnitudeData.Curve,CurveType.Magnitude,curveName);
                            break;
                        case CurveType.Power:
                            gd.AddCurve(OpenFiles[index].PowerData,curveName);
                            //gd.AddCurve(OpenFiles[index].PowerData.Curve,CurveType.Power,curveName);
                            break;
                        default:
                            break;
                    }
                }

            }

            //GraphDock gdd = new GraphDock();
            //LineItem curve = new GraphPane().AddCurve("Black", new PointPairList(new double[] { 0, 1, 2, 3, 4, 5 }, new double[] { 0, 1, 2, 3, 4, 5 }), Color.Blue);
            //gdd.AddCurve(curve, CurveType.Acceleration, "Black");
            //GraphDockList.Add(gdd);

            //GraphEventInstance.CreatedGraph = gdd;
            //OnGraphCreated(GraphEventInstance);

            gd.Name = "Graph " + System.DateTime.Now.TimeOfDay;
            gd.Text = gd.Name;
            gd.GraphName = gd.Name;

            GraphDockList.Add(gd);
            GraphEventInstance.CreatedGraph = gd;
            OnGraphCreated(GraphEventInstance);
        }
        public void ActiveDocumentChanged(GraphDock activeGraphDock)
        {
            //UpdateGraphMainView.Close();
            UpdateGraphMainView.Register(activeGraphDock);
            UpdateGraphMainView.UpdateView();

            MainDockingForm.Update(UpdateGraphMainView, DockState.DockBottom);
            Console.WriteLine("Active Document Changed");
        }