private void Vacuum_Click(object sender, RoutedEventArgs e) { mTrendModel.PlotType = TrendPlotType.Vacuum; TrendView.LoadView(); mController.ConvertTrendPageModel(); TrendView.UpdatePlot(); }
public void StartUpdatePlotServer() { Thread mUpdateUIRunThread = new Thread(() => { ProcessStatus status = ProcessStatus.UNKNOWN; while (mUpdatePlot) { if (mTrendModel.TubeIndex != 0) { if (!mHoldUpdatePlot) { this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate() { mController.ConvertTrendPageModel(); TrendView.UpdatePlot(); }); } } Thread.Sleep(1000); } }); mUpdatePlot = true; mUpdateUIRunThread.IsBackground = true; mUpdateUIRunThread.Start(); }
public void ShowTrendViewer(List <TrendData> trendOrderedByDate) { var details = new TrendView(); details.DataContext = new TrendViewModel(trendOrderedByDate); details.Owner = _mainWindow; details.WindowStartupLocation = WindowStartupLocation.CenterOwner; details.ShowDialog(); }
public void FixtureSetUp() { DBConnectionStrings.GetInstance().AddConnectionString(TestConst.CONNECTION_STR); SimpleDatabase.GetInstance().OpenConnection(); ViewManager.GetInstance().RegisterViewFactory(new TrendingViewFactory()); IView view = ViewManager.GetInstance().GetView(TrendViewConst.TrendView, TestConst.TEST_VIEW_ID); //viewID is "" trendView = (TrendView)view; ConfigureFileHelper.GetInstance().init(); viewAccessor = ReflectionAccessor.Wrap(trendView); }
public void LoadPage(byte selectedTube) { log.Info("TubeTrendPage"); mTrendModel.TubeIndex = selectedTube; mTrendModel.PlotType = TrendPlotType.Temperature; Visibility = Visibility.Visible; TrendView.LoadView(); mController.ConvertTrendPageModel(); TrendView.UpdatePlot(); ContinueUpdatePlot(); }
public void TestRealTimeExecuteCmd_Click01() { //test If user click "start" DataPointListModel model = new DataPointListModel(); Accessor ctlAccessor = ReflectionAccessor.Wrap(trendViewController); TrendCache cache = (TrendCache)(ctlAccessor.GetField("m_trendCache")); cache.m_dataPointList = model.GetDPListByGrp(""); cache.m_datapointGrpName = ""; trendViewController.RealTimeExecuteCmd_Click(null, null); cache.m_dataPointList = model.GetDPListByGrp(TestConst.GROUP_NAME); cache.m_datapointGrpName = TestConst.GROUP_NAME; IView view = ViewManager.GetInstance().GetView(TrendViewConst.TrendView); //viewID is "" TrendView frm = (TrendView)view; Accessor frmAccessor = ReflectionAccessor.Wrap(frm); System.Windows.Forms.CheckBox checkbox = (System.Windows.Forms.CheckBox)frmAccessor.GetField("mixedModeCb"); checkbox.Checked = true; frmAccessor.SetField("mixedModeCb", checkbox); trendViewController.RealTimeExecuteCmd_Click(null, null); }
public void TestCreateTrendView01() { using (TrendView trendView = CreateTrendView01()) { Assert.IsNotNull(trendView); #region Record State ValueRecorder recorder = new ValueRecorder(); recorder.Record((string)trendView.AccessibleDefaultActionDescription); recorder.Record((string)trendView.AccessibleDescription); recorder.Record((string)trendView.AccessibleName); recorder.Record((AccessibleRole)trendView.AccessibleRole); recorder.Record((bool)trendView.AllowDrop); recorder.Record((bool)trendView.AllowTransparency); recorder.Record((AnchorStyles)trendView.Anchor); recorder.Record((AutoScaleMode)trendView.AutoScaleMode); recorder.Record((bool)trendView.AutoScroll); recorder.Record((bool)trendView.AutoSize); recorder.Record((AutoSizeMode)trendView.AutoSizeMode); recorder.Record((AutoValidate)trendView.AutoValidate); recorder.Record((ImageLayout)trendView.BackgroundImageLayout); recorder.Record((int)trendView.Bottom); recorder.Record((bool)trendView.CanFocus); recorder.Record((bool)trendView.CanSelect); recorder.Record((bool)trendView.Capture); recorder.Record((bool)trendView.CausesValidation); recorder.Record((string)trendView.CompanyName); recorder.Record((bool)trendView.ContainsFocus); recorder.Record((bool)trendView.ControlBox); recorder.Record((bool)trendView.Created); recorder.Record((DialogResult)trendView.DialogResult); recorder.Record((bool)trendView.Disposing); recorder.Record((DockStyle)trendView.Dock); recorder.Record((bool)trendView.Enabled); recorder.Record((bool)trendView.Focused); recorder.Record((FormBorderStyle)trendView.FormBorderStyle); recorder.Record((bool)trendView.HasChildren); recorder.Record((int)trendView.Height); recorder.Record((bool)trendView.HelpButton); recorder.Record((ImeMode)trendView.ImeMode); recorder.Record((bool)trendView.InvokeRequired); recorder.Record((bool)trendView.IsAccessible); recorder.Record((bool)trendView.IsDisposed); recorder.Record((bool)trendView.IsHandleCreated); recorder.Record((bool)trendView.IsMdiChild); recorder.Record((bool)trendView.IsMdiContainer); recorder.Record((bool)trendView.IsMirrored); recorder.Record((bool)trendView.IsRestrictedWindow); recorder.Record((bool)trendView.KeyPreview); recorder.Record((int)trendView.Left); recorder.Record((bool)trendView.MaximizeBox); recorder.Record((bool)trendView.MinimizeBox); recorder.Record((bool)trendView.Modal); recorder.Record((string)trendView.Name); recorder.Record((double)trendView.Opacity); recorder.Record((string)trendView.ProductName); recorder.Record((string)trendView.ProductVersion); recorder.Record((bool)trendView.RecreatingHandle); recorder.Record((int)trendView.Right); recorder.Record((RightToLeft)trendView.RightToLeft); recorder.Record((bool)trendView.RightToLeftLayout); recorder.Record((bool)trendView.ShowIcon); recorder.Record((bool)trendView.ShowInTaskbar); recorder.Record((SizeGripStyle)trendView.SizeGripStyle); recorder.Record((FormStartPosition)trendView.StartPosition); recorder.Record((bool)ReflectionAccessor.Wrap(trendView).GetProperty("System.Windows.Forms.Layout.IArrangedElement.ParticipatesInLayout")); recorder.Record((int)trendView.TabIndex); recorder.Record((bool)trendView.TabStop); recorder.Record((string)trendView.Text); recorder.Record((int)trendView.Top); recorder.Record((bool)trendView.TopLevel); recorder.Record((bool)trendView.TopMost); recorder.Record((bool)trendView.UseWaitCursor); recorder.Record((string)trendView.ViewID); recorder.Record((string)trendView.ViewType); recorder.Record((bool)trendView.Visible); recorder.Record((int)trendView.Width); recorder.Record((FormWindowState)trendView.WindowState); recorder.FinishRecording(); #endregion #region Assertions Assert.IsNull((string)trendView.AccessibleDefaultActionDescription); Assert.IsFalse((bool)trendView.AllowDrop); Assert.AreEqual(global::System.Windows.Forms.AutoScaleMode.Font, (AutoScaleMode)trendView.AutoScaleMode); Assert.AreEqual(global::System.Windows.Forms.AutoValidate.EnablePreventFocusChange, (AutoValidate)trendView.AutoValidate); Assert.IsFalse((bool)trendView.CanFocus); Assert.AreEqual("ST Electronics Ltd", (string)trendView.CompanyName); Assert.IsFalse((bool)trendView.Created); Assert.IsTrue((bool)trendView.Enabled); Assert.IsTrue((bool)trendView.HasChildren); Assert.IsFalse((bool)trendView.InvokeRequired); Assert.IsFalse((bool)trendView.IsHandleCreated); Assert.IsFalse((bool)trendView.IsRestrictedWindow); Assert.IsFalse((bool)trendView.MaximizeBox); Assert.AreEqual(1.0, (double)trendView.Opacity, 1E-7); Assert.IsFalse((bool)trendView.RecreatingHandle); Assert.IsTrue((bool)trendView.ShowIcon); Assert.AreEqual(global::System.Windows.Forms.FormStartPosition.WindowsDefaultLocation, (FormStartPosition)trendView.StartPosition); Assert.AreEqual("OPC TrendViewer", (string)trendView.Text); Assert.IsFalse((bool)trendView.TopMost); Assert.IsFalse((bool)trendView.Visible); #endregion } }
public static TrendView CreateTrendView01() { TrendView trendView = new TrendView(); return(trendView); }