Ejemplo n.º 1
0
        public override void AttachListener(STEE.ISCS.MVC.IController controller)
        {
            OPCDataSelectorController ctl = (OPCDataSelectorController)(getController());

            this.treeOpcItems.AfterSelect            += ctl.AfterSelect;
            this.opcItemDataGridView.CellDoubleClick += ctl.opcItemDataGridView_CellDoubleClick;
        }
Ejemplo n.º 2
0
 public void TestCreateOPCDataSelectorController01()
 {
     using (OPCDataSelectorController oPCDataSelectorController = CreateOPCDataSelectorController01())
     {
         Assert.IsNotNull(oPCDataSelectorController);
     }
 }
        public IView CreateView(string type, string id)
        {
            IView       view       = null;
            IController controller = null;
            IModel      model      = null;

            switch (type)
            {
            case OPCSampleGrpConfigStart.OPCSAMPLEGRPCONFIGSTARTFRM:
                view          = new OPCSampleGrpConfigStart();
                view.ViewType = OPCSampleGrpConfigStart.OPCSAMPLEGRPCONFIGSTARTFRM;
                controller    = new OPCSampleGrpConfigStartController();
                model         = new OPCSampleGrpConfigStartModel();
                controller.Attach(model, view);
                break;

            case OPCDataSelector.OPCDATASELECTORFRM:
                view          = new OPCDataSelector();
                view.ViewType = OPCDataSelector.OPCDATASELECTORFRM;
                controller    = new OPCDataSelectorController();
                model         = new OPCDataSelectorModel();
                controller.Attach(model, view);
                view.PutObject(OPCDataSelector.OPCSAMPLEGRPDIC, ((OPCDataSelectorModel)model).GetSampleGrps());
                break;

            default:
                break;
            }
            return(view);
        }
Ejemplo n.º 4
0
        public void FixtureSetUp()
        {
            oPCDataSelectorController = new OPCDataSelectorController();
            IModel model = new OPCSampleGrpConfig.Model.OPCDataSelectorModel();

            OPCSampleGrpConfig.View.OPCDataSelector viewob = OPCDataSelectorFactory.CreateOPCDataSelector01();
            oPCDataSelectorController.Attach(model, viewob);
        }
Ejemplo n.º 5
0
        public void FixtureSetUp()
        {
            //oPCDataSelector = new OPCDataSelector
            ViewManager.GetInstance().RegisterViewFactory(new TrendingViewFactory());
            IView view = ViewManager.GetInstance().GetView(TrendViewConst.OPCDataSelector, "test_id");
            OPCDataSelectorController ctl = (OPCDataSelectorController)(view.getController());

            ctl.InitDataNodeList();
            oPCDataSelector = (OPCDataSelector)(view);
        }
Ejemplo n.º 6
0
        public void FixtureSetUp()
        {
            DBConnectionStrings.GetInstance().AddConnectionString(TestConst.CONNECTION_STR);
            SimpleDatabase.GetInstance().OpenConnection();
            ViewManager.GetInstance().RegisterViewFactory(new TrendingViewFactory());
            IView view = ViewManager.GetInstance().GetView(TrendViewConst.OPCDataSelector, TestConst.TEST_VIEW_ID);

            oPCDataSelectorController = (OPCDataSelectorController)(view.getController());
            //oPCDataSelectorController.InitDataNodeList();
        }
Ejemplo n.º 7
0
        public void TestWriteEventLog01()
        {
            using (OPCDataSelectorController oPCDataSelectorController = OPCDataSelectorControllerFactory.CreateOPCDataSelectorController01())
            {
                string   messageContent = "Message testing";
                string   moduleName     = "Module1";
                Accessor oPCDataSelectorControllerAccessor = ReflectionAccessor.Wrap(oPCDataSelectorController);
                //mkdir logs.
                string pathString = System.IO.Path.Combine((string)oPCDataSelectorControllerAccessor.GetField("CONFIGFOLDER"), "logs");
                System.IO.Directory.CreateDirectory(pathString);
                oPCDataSelectorController.WriteEventLog(messageContent, moduleName);

                //delete created folder
                System.IO.Directory.Delete(pathString, true);
                bool directoryExists = System.IO.Directory.Exists(pathString);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ctl"></param>
        public override void AttachListener(IController ctl)
        {
            OPCDataSelectorController controller = (OPCDataSelectorController)ctl;

            this.opcItemDataGridView.CellDoubleClick += controller.opcItemDataGridView_CellDoubleClick;
            this.contextMenuStrip2.Click             += controller.contextMenuStrip2_Click;
            this.addToolStripMenuItem.Click          += controller.addToolStripMenuItem_Click;
            this.treeOpcItems.AfterSelect            += controller.treeOpcItems_AfterSelect;
            this.treeOpcItems.NodeMouseClick         += controller.treeOpcItems_NodeMouseClick;
            this.opcServerIPBox.SelectedIndexChanged += controller.opcServerIPBox_SelectedIndexChanged;
            this.selectDataPointListBox.DoubleClick  += controller.selectDataPointListBox_DoubleClick;
            this.removeToolStripMenuItem.Click       += controller.removeToolStripMenuItem_Click;
            this.searchBtn.Click += controller.searchBtn_Click;
            this.Paint           += controller.OPCDataSelector_Paint;
            this.okCmd.Click     += controller.okCmd_Click;
            this.cancelCmd.Click += controller.cancelCmd_Click;
        }
        public IView CreateView(string type, string id)
        {
            IView       view       = null;
            IController controller = null;
            IModel      model      = null;

            switch (type)
            {
            case  TrendViewConst.About:
                view          = new About();
                view.ViewType = TrendViewConst.About;
                break;

            case TrendViewConst.TrendView:
                view          = new TrendView();
                view.ViewType = TrendViewConst.TrendView;
                controller    = new TrendViewController();
                model         = new TrendViewModel();
                controller.Attach(model, view);
                break;

            // marker related:
            case TrendViewConst.MarkerList:
                view          = new MarkerList();
                view.ViewType = TrendViewConst.MarkerList;
                controller    = new MarkerListController();
                model         = new MarkerListModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.LoadConfigMarker:
                view       = new MarkerGroup();
                controller = new MarkerGroupController();
                model      = new MarkerGroupModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.SaveConfigMarker:
                view       = new MarkerGroup();
                controller = new MarkerGroupController();
                model      = new MarkerGroupModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.AddMarkerData:
                view       = new MarkerData();
                controller = new MarkerDataController();
                model      = new MarkerDataModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.EditMarkerData:
                view       = new MarkerData();
                controller = new MarkerDataController();
                model      = new MarkerDataModel();
                controller.Attach(model, view);
                break;

            // formula related:
            case TrendViewConst.FormulaList:
                view          = new FormulaList();
                view.ViewType = TrendViewConst.FormulaList;
                controller    = new FormulaListController();
                model         = new FormulaListModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.LoadConfigFormula:
                view       = new FormulaGroup();
                controller = new FormulaGroupController();
                model      = new FormulaGroupModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.SaveConfigFormula:
                view       = new FormulaGroup();
                controller = new FormulaGroupController();
                model      = new FormulaGroupModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.AddFormulaData:
                view       = new FormulaData();
                controller = new FormulaDataController();
                model      = new FormulaDataModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.EditFormulaData:
                view       = new FormulaData();
                controller = new FormulaDataController();
                model      = new FormulaDataModel();
                controller.Attach(model, view);
                break;

            // DP related:
            case TrendViewConst.DataPointList:
                view          = new DataPointList();
                view.ViewType = TrendViewConst.DataPointList;
                controller    = new DataPointListController();
                model         = new DataPointListModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.LoadConfigDataPoint:
                view       = new DataPointGroup();
                controller = new DataPointGroupController();
                model      = new DataPointGroupModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.SaveConfigDataPoint:
                view       = new DataPointGroup();
                controller = new DataPointGroupController();
                model      = new DataPointGroupModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.AddDataPointData:
                view       = new DataPointData();
                controller = new DataPointDataController();
                model      = new DataPointDataModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.EditDataPointData:
                view       = new DataPointData();
                controller = new DataPointDataController();
                model      = new DataPointDataModel();
                controller.Attach(model, view);
                break;

            //Hist DP related:
            case TrendViewConst.HistDataPointList:
                view          = new HistDataPointList();
                view.ViewType = TrendViewConst.HistDataPointList;
                controller    = new HistDataPointListController();
                model         = new HistDataPointListModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.LoadConfigHistDataPoint:
                view       = new HistDataPointGroup();
                controller = new HistDataPointGroupController();
                model      = new HistDataPointGroupModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.SaveConfigHistDataPoint:
                view       = new HistDataPointGroup();
                controller = new HistDataPointGroupController();
                model      = new HistDataPointGroupModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.AddHistDataPointData:
                view       = new HistDataPointData();
                controller = new HistDataPointDataController();
                model      = new HistDataPointDataModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.EditHistDataPointData:
                view       = new HistDataPointData();
                controller = new HistDataPointDataController();
                model      = new HistDataPointDataModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.OPCDataSelector:
                view       = new OPCDataSelector();
                controller = new OPCDataSelectorController();
                model      = new OPCDataSelectorModel();
                controller.Attach(model, view);
                break;

            case TrendViewConst.ChangeTrendTitle:
                view       = new EditChartTitle();
                controller = new ChangeTrendTitleController();
                model      = null;
                controller.Attach(model, view);
                break;

            default:
                break;
            }
            view.ViewID = id;
            return(view);
        }
Ejemplo n.º 10
0
 public void TestOPCDataSelectorControllerConstructor01()
 {
     OPCDataSelectorController oPCDataSelectorController1 = new OPCDataSelectorController();
 }
Ejemplo n.º 11
0
 public void FixtureTearUp()
 {
     OPCDataSelectorController oPCDataSelectorController = null;
 }
Ejemplo n.º 12
0
        public static OPCDataSelectorController CreateOPCDataSelectorController01()
        {
            OPCDataSelectorController oPCDataSelectorController = new OPCDataSelectorController();

            return(oPCDataSelectorController);
        }