Example #1
0
        public void Test_TSPointEditorPresenter_Common()
        {
            var view   = Substitute.For <ITSPointEditorView>();
            var model  = new ALModel(null);
            var record = new TSPoint();

            var presenter = new TSPointEditorPresenter(view);

            presenter.SetContext(model, record);
            Assert.IsTrue(presenter.ApplyChanges());
        }
Example #2
0
        protected override void AddHandler(object sender, EventArgs e)
        {
            var record = new TSPoint();

            using (var dlg = new TSPointEditDlg()) {
                dlg.SetContext(fModel, record);

                if (dlg.ShowModal())
                {
                    fModel.TSDB.AddPoint(record);
                    UpdateContent();
                }
            }
        }
Example #3
0
        public override void TickTimer()
        {
            int num = ListView.Items.Count;

            for (int i = 0; i < num; i++)
            {
                ListViewItem item  = ListView.Items[i];
                TSPoint      point = item.Tag as TSPoint;
                if (point != null)
                {
                    double curValue = fModel.GetCurrentValue(point.Id);
                    string strVal   = ALCore.GetDecimalStr(curValue);
                    item.SubItems[6].Text = strVal;
                }
            }
        }
Example #4
0
 public void SetContext(IModel model, TSPoint record)
 {
     fPresenter.SetContext(model, record);
 }