Esempio n. 1
0
 public void TestCreateOPCSampleGrpConfigStartController01()
 {
     using (OPCSampleGrpConfigStartController oPCSampleGrpConfigStartController = CreateOPCSampleGrpConfigStartController01())
     {
         Assert.IsNotNull(oPCSampleGrpConfigStartController);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Method through which Form commuicates with its controller.
        /// </summary>
        /// <param name="ctl">Form controller</param>
        public override void  AttachListener(IController ctl)
        {
            string Function_Name = "AttachListener";

            LogHelper.Trace(CLASS_NAME, Function_Name, "Function_Entered");
            OPCSampleGrpConfigStartController controller = (OPCSampleGrpConfigStartController)ctl;
            //check the Database Connection
            bool bConnectionOpened = controller.GetDatabaseConnection();

            if (!bConnectionOpened)
            {
                LogHelper.Error("No Connection to Database. Closing the Form.");
                MessageBoxDialog.Show(StringHelper.GetInstance().getStringValue(FormCaptionHelper.OPCSAMPLECONFIG_NODATABASECONN_MSG, EnglishString.OPC_MSG_NODB));
                this.Close();
            }

            //set Current location
            LocationKeyHelper.GetInstance().init();
            this.LocationKeyTextBox.Text = LocationKeyHelper.GetInstance().LocationKey.ToString();
            this.saveMsgCmd.Click       += controller.SaveCommand;
            this.intervalConfigDataGridView.CellDoubleClick += controller.IntervalConfigDataGridView_CellDoubleClick;
            this.RefreshGridData   += controller.RetriveAllOPCGrp;
            this.RefreshPageNumber += controller.RetriveTotalCount;
            this.Paint             += controller.AddLoggerInterval_Paint_1;
            LogHelper.Trace(CLASS_NAME, Function_Name, "Function_Exited");
        }
        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);
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            LogHelper.setLogFile("../logs/Log_OPCSampleGrpConfig.txt");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            try
            {
                OPCSampleGrpConfig.Common.FormCaptionHelper.GetInstance().AddCaptionsToStringHelper();
                ConfigureFileHelper.GetInstance().init();
                //Connect to central database
                DBConnectionStrings.GetInstance().AddConnectionString(ConfigureFileHelper.GetInstance().ConnectionStringConfig);

                //set the language  and encoding change
                LanguageType type = LanguageTypeHelper.GetInstance().GetLanTypeByLanStr(ConfigureFileHelper.GetInstance().LanguageStr);
                LanguageTypeHelper.GetInstance().SetLanaguageType(type);
                DAOHelper.SetEncodingChange(ConfigureFileHelper.GetInstance().EncodingChange);
                ViewManager.GetInstance().RegisterViewFactory(new OPCSampleGrpConfigViewFactory());
                IView view = ViewManager.GetInstance().GetView(OPCSampleGrpConfigStart.OPCSAMPLEGRPCONFIGSTARTFRM);
                Form  frm  = (Form)view;
                if (args.Length > 0)
                {
                    OPCSampleGrpConfigStartController sampleGrpController = (OPCSampleGrpConfigStartController)view.getController();
                    sampleGrpController.SetSampleGrpConfigLocation(ref frm, args[0]);
                }
                Application.Run(frm);
            }
            catch (Exception localExecption)
            {
                Console.WriteLine(localExecption.ToString());
            }
            DBConnectionStrings.GetInstance().TerminateMonitorThread();
        }
Esempio n. 5
0
        public void FixtureSetUp()
        {
            oPCSampleGrpConfigStartController = new OPCSampleGrpConfigStartController();
            IModel model = new OPCSampleGrpConfig.Model.OPCSampleGrpConfigStartModel();

            OPCSampleGrpConfig.View.OPCSampleGrpConfigStart viewob = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01();
            oPCSampleGrpConfigStartController.Attach(model, viewob);
        }
Esempio n. 6
0
        public static OPCSampleGrpConfigStartController CreateOPCSampleGrpConfigStartController01()
        {
            OPCSampleGrpConfigStartController oPCSampleGrpConfigStartController = new OPCSampleGrpConfigStartController();

            return(oPCSampleGrpConfigStartController);
        }
Esempio n. 7
0
 public void FixtureTearUp()
 {
     oPCSampleGrpConfigStartController = null;
 }
Esempio n. 8
0
 public void TestOPCSampleGrpConfigStartControllerConstructor01()
 {
     OPCSampleGrpConfigStartController oPCSampleGrpConfigStartController = new OPCSampleGrpConfigStartController();
 }