bool FileOpenedEvent(AnalyticsController aC, FileOpenEventArgs e) { dockPanel1.SuspendLayout(true); //if (rmsDockPanel == null) //{ // rmsDockPanel = new DockPanel(); // rmsDockPanel.Dock = DockStyle.Fill; // rmsDockPanel.Show(); // if (rmsDockForm == null) // { // rmsDockForm = new Form(); // this.Controls.Add(rmsDockPanel); // rmsDockForm.Controls.Add(rmsDockPanel); // rmsDockPanel.Dock = DockStyle.Fill; // rmsDockForm.Show(); // } //} graphsToolStripMenuItem.Enabled = true; tsmiAccelGraphs.Enabled = true; tsmiMagGraphs.Enabled = true; tsmiPowerGraphs.Enabled = true; tsmiVelocGraphs.Enabled = true; //e.FreqGraphDock.HideOnClose = true; if (e.RMSDock != null) { e.RMSDock.DockPanel = dockPanel1; if (e.RMSDock.DockPanel.DocumentStyle == DocumentStyle.DockingMdi) { e.RMSDock.MdiParent = this; //e.RMSDock.Show(dockPanel1, new Rectangle(98,133,200,383)); } else { //e.RMSDock.Show(dockPanel1, new Rectangle(98,133,200,383)); } e.RMSDock.DockState = DockState.DockRight; e.RMSDock.Dock = DockStyle.None; //e.RMSDock.DockTo(rmsFP.Pane, DockStyle.Fill, 1); if (docks < 4) { rmsDocs[docks] = e.RMSDock; switch (docks) { case 0: e.RMSDock.DockTo(rmsDocs[docks].Pane, DockStyle.Fill, 1); break; case 1: e.RMSDock.DockTo(rmsDocs[0].Pane, DockStyle.Right, 1); break; case 2: e.RMSDock.DockTo(rmsDocs[0].Pane, DockStyle.Bottom, 1); break; case 3: e.RMSDock.DockTo(rmsDocs[1].Pane, DockStyle.Bottom, 1); break; } } else { e.RMSDock.DockTo(rmsDocs[docks % 4].Pane, DockStyle.Fill, 1); } docks++; } if (e.RMSCDock != null && !e.RMSCDock.Visible) { e.RMSCDock.DockPanel = dockPanel1; if (e.RMSCDock.DockPanel.DocumentStyle == DocumentStyle.DockingMdi) { e.RMSCDock.MdiParent = this; e.RMSCDock.DockState = DockState.DockRight; e.RMSCDock.Dock = DockStyle.None; } } e.FreqGraphDock.DockPanel = dockPanel1; if (e.FreqGraphDock.DockPanel.DocumentStyle == DocumentStyle.SystemMdi) { e.FreqGraphDock.MdiParent = this; e.FreqGraphDock.Show(); } else { e.FreqGraphDock.Show(dockPanel1); } //e.FreqGraphDock.Show(this.dockPanel1, DockState.Document); e.FreqGraphDock.DockStateChanged += new EventHandler(FreqGraphDock_DockStateChanged); DockList.Add(e.FreqGraphDock); //e.TimeGraphDock.HideOnClose = true; e.TimeGraphDock.DockPanel = dockPanel1; if (e.TimeGraphDock.DockPanel.DocumentStyle == DocumentStyle.SystemMdi) { e.TimeGraphDock.MdiParent = this; e.TimeGraphDock.Show(); } else { e.TimeGraphDock.Show(); } //e.TimeGraphDock.Show(this.dockPanel1, DockState.Document); e.TimeGraphDock.DockStateChanged += new EventHandler(TimeGraphDock_DockStateChanged); DockList.Add(e.TimeGraphDock); DockList.Add(e.ThreeDFreqDock); DockList.Add(e.ThreeDTimeDock); //e.ThreeDTimeDock.Show(this.dockPanel1, DockState.Document); //e.ThreeDTimeDock.DockStateChanged += new EventHandler(ThreeDTimeDock_DockStateChanged); //e.ThreeDFreqDock.Show(this.dockPanel1, DockState.Document); //e.ThreeDFreqDock.DockStateChanged += new EventHandler(ThreeDFreqDock_DockStateChanged); dockPanel1.ResumeLayout(true,true); return false; }
bool Controller_FileOpenedEvent(AnalyticsController aC, FileOpenEventArgs e) { return false; //throw new NotImplementedException(); }
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); }
bool FileOpenedEvent(AnalyticsController aC, FileOpenEventArgs e) { //GraphListComboBox.Items.Add(Controller.OpenedFile.FileName); AddFile(Controller.OpenedFile); return false; }
protected virtual void OnFileOpenEvent(FileOpenEventArgs e) { if (FileOpenedEvent != null) { FileOpenedEvent(this, e); } }