Пример #1
0
        public void Display(EtyDataPoint dp)
        {
            string Function_Name = "Display";

            colorPanel.BackColor = Color.Black;

            try
            {
                seriesTypeBox.Items.Add(StringHelper.GetInstance().getStringValue(LanguageHelper.TrendViewer_LintTypeLine, LanguageHelper.TrendViewer_LintTypeLine_EN));
                seriesTypeBox.Items.Add(StringHelper.GetInstance().getStringValue(LanguageHelper.TrendViewer_LintTypeSpline, LanguageHelper.TrendViewer_LintTypeSpline_EN));
                seriesTypeBox.Text    = StringHelper.GetInstance().getStringValue(LanguageHelper.TrendViewer_LintTypeLine, LanguageHelper.TrendViewer_LintTypeLine_EN);
                opcServerHostBox.Text = ConfigureFileHelper.GetInstance().HostIPAddress; //dp.DPHost.ToString();
                opcServerNameBox.Text = ConfigureFileHelper.GetInstance().OPCServerName; //dp.DPServer.ToString();

                if (m_formType == FormType.Edit)
                {
                    opcServerHostBox.Text = dp.DPHost.ToString();
                    opcServerNameBox.Text = dp.DPServer.ToString();
                    dataPointBox.Text     = dp.DPName.ToString();
                    seriesTypeBox.Text    = TrendViewerHelper.convertLineTypeToDispLan(dp.DPType);
                    dataLegendBox.Text    = dp.DPLblName;
                    if (TrendViewerHelper.isNumeric(dp.DPColor, System.Globalization.NumberStyles.Number))
                    {
                        colorPanel.BackColor = Color.FromArgb(Convert.ToInt32(dp.DPColor));
                    }
                    dataPointEnabledCb.Checked = dp.DPEnabled;
                    labelEnabledCb.Checked     = dp.DPLblEnabled;
                    dataPointVisibleCb.Checked = dp.DPVisible;
                }
            }
            catch (Exception localException)
            {
                LogHelper.Error(CLASS_NAME, Function_Name, localException.ToString());
            }
        }
Пример #2
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();
        }
Пример #3
0
        public void TestConfigureFileHelperConstructor01()
        {
            ConfigureFileHelper configureFileHelper = new ConfigureFileHelper();

            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record((string)configureFileHelper.AboutMessage);
            recorder.Record((string)configureFileHelper.ConnectionStringConfig);
            recorder.Record((string)configureFileHelper.ConnectionStringViewer);
            recorder.Record((string)configureFileHelper.DefaultFolder);
            recorder.Record((int)configureFileHelper.DefaultLineThickness);
            recorder.Record((bool)configureFileHelper.EnableSmartLabel);
            recorder.Record((bool)configureFileHelper.EncodingChange);
            recorder.Record((string)configureFileHelper.HostIPAddress);
            recorder.Record((string)configureFileHelper.LanguageStr);
            recorder.Record((string)configureFileHelper.OPCDTSever1Host);
            recorder.Record((string)configureFileHelper.OPCDTSever1Name);
            recorder.Record((string)configureFileHelper.OPCDTSever2Host);
            recorder.Record((string)configureFileHelper.OPCDTSever2Name);
            recorder.Record((string)configureFileHelper.OPCServerName);
            recorder.Record((string)configureFileHelper.OPCServerRootName);
            recorder.Record((int)configureFileHelper.ScreenWidth);
            recorder.FinishRecording();
            #endregion
        }
Пример #4
0
 public void TestInitializeTrendViewer01()
 {
     ConfigureFileHelper.GetInstance().OPCServerName = "TransActiveDataSource";
     //todo  opcSrv1Name.Trim() != ""
     //!OPCServerProxy.GetInstance().IsOPCServerConnected()
     //false == DBConnection.getInstance().OpenConnection(localConnectionString);
     trendView.InitializeTrendViewer();
 }
Пример #5
0
 public OPCDataSelectorController()
 {
     m_opcServeNames  = new List <string>();
     m_opcServerHost  = new List <string>();
     m_serverRootName = ConfigureFileHelper.GetInstance().OPCServerRootName;
     m_opcServerHost.Add(ConfigureFileHelper.GetInstance().OPCDTSever1Host);
     m_opcServerHost.Add(ConfigureFileHelper.GetInstance().OPCDTSever2Host);
     m_opcServeNames.Add(ConfigureFileHelper.GetInstance().OPCDTSever1Name);
     m_opcServeNames.Add(ConfigureFileHelper.GetInstance().OPCDTSever2Name);
 }
Пример #6
0
        public void FixtureSetUp()
        {
            OPCSampleGrpConfig.Common.FormCaptionHelper.GetInstance().AddCaptionsToStringHelper();
            ConfigureFileHelper.GetInstance().init();
            LanguageTypeHelper.GetInstance().SetLanaguageType(LanguageType.English);
            OPCSampleGrpConfigStartModel oPCSampleGrpConfigStartModel = OPCSampleGrpConfigStartModelFactory.CreateOPCSampleGrpConfigStartModel01();

            DBConnectionStrings.GetInstance().AddConnectionString(ConfigureFileHelper.GetInstance().ConnectionStringConfig);
            //oPCSampleGrpConfigStartModel.OpenConnection(ConfigureFileHelper.GetInstance().ConnectionString);
        }
Пример #7
0
        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);
        }
Пример #8
0
        public void TestOpenConnection01()
        {
            OPCSampleGrpConfigStartModel oPCSampleGrpConfigStartModel = OPCSampleGrpConfigStartModelFactory.CreateOPCSampleGrpConfigStartModel01();
            string connectionString = string.Empty;

            DBConnectionStrings.ReleaseInstance();
            DBConnectionStrings.GetInstance().AddConnectionString(connectionString);
            bool b = false;

            try
            {
                b = oPCSampleGrpConfigStartModel.OpenConnection();
            }
            catch (System.Exception ex)
            {
            }

            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record(b);
            recorder.FinishRecording();
            #endregion
            // ExpectedException custom attribute was generated instead of
            // assertions since the test threw System.ArgumentOutOfRangeException
            #region PostConditionCheck
            //Assert.IsFalse(b);
            #endregion

            //Test invalid connection string
            connectionString = "DataSource: ; UserName =;Password=;";
            DBConnectionStrings.ReleaseInstance();
            DBConnectionStrings.GetInstance().AddConnectionString(connectionString);
            try
            {
                b = oPCSampleGrpConfigStartModel.OpenConnection();
            }
            catch (System.Exception ex)
            {
            }

            #region PostConditionCheck
            Assert.IsFalse(b);
            #endregion


            //Test valid connection string
            DBConnectionStrings.ReleaseInstance();
            DBConnectionStrings.GetInstance().AddConnectionString(ConfigureFileHelper.GetInstance().ConnectionStringConfig);
            b = oPCSampleGrpConfigStartModel.OpenConnection();
            #region PostConditionCheck
            Assert.IsTrue(b);
            #endregion
        }
Пример #9
0
        public override Form CreateMainForm()
        {
            string FUNCTION_NAME = ".CreateMainForm";

            LogHelperCli.GetInstance().Log_Generic(CLASS_NAME + "." + FUNCTION_NAME, LogHelperCli.GetInstance().GetLineNumber(), EDebugLevelManaged.DebugInfo, "CreateMainForm");
            ConfigureFileHelper.GetInstance().init();

            ViewManager.GetInstance().RegisterViewFactory(new TimeTableViewFactory());
            IView view = ViewManager.GetInstance().GetView(TrainTimeTableConst.TrainTimeTableView);  //viewID is ""
            Form  frm  = (Form)view;


            return(frm);
        }
        public void CaptureScreenShoot(object sender, EventArgs e)
        {
            string Function_Name = "CaptureScreenShoot";

            try
            {
                // Create a new save file dialog
                SaveFileDialog saveFileDialog1 = new SaveFileDialog();

                // Sets the current file name filter string, which determines
                // the choices that appear in the "Save as file type" or
                // "Files of type" box in the dialog box.
                //saveFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                saveFileDialog1.InitialDirectory = ConfigureFileHelper.GetInstance().DefaultFolder;

                //hide "emf" format
                //saveFileDialog1.Filter = "Bitmap (*.bmp)|*.bmp|JPEG (*.jpg)|*.jpg|EMF (*.emf)|*.emf|PNG (*.png)|*.png|GIF (*.gif)|*.gif|TIFF (*.tif)|*.tif";
                saveFileDialog1.Filter = "Bitmap (*.bmp)|*.bmp|JPEG (*.jpg)|*.jpg|PNG (*.png)|*.png|GIF (*.gif)|*.gif|TIFF (*.tif)|*.tif";

                saveFileDialog1.FilterIndex      = 2;
                saveFileDialog1.RestoreDirectory = true;

                // Set image file format
                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    /*if( saveFileDialog1.FileName.Equals("")) //this if will never come in.
                     * {
                     *  LogHelper.Debug(CLASS_NAME, Function_Name,"***************");
                     *  MessageBoxDialog.Show("Please specify filename to save.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                     *  return;
                     * }*/


                    m_View.GetTrendingChartCtl().SaveAsImage(saveFileDialog1.FileName);
                    MessageBoxDialog.Show(StringHelper.GetInstance().getStringValue((LanguageHelper.TrendViewer_Msg_ScreenShotOK),
                                                                                    LanguageHelper.TrendViewer_Msg_ScreenShotOK_EN));
                }
            }
            catch (Exception localException)
            {
                MessageBoxDialog.Show
                    (StringHelper.GetInstance().getStringValue(LanguageHelper.TrendViewer_Msg_ScreenShotNOK_1, LanguageHelper.TrendViewer_Msg_ScreenShotNOK_1_EN)
                    + localException.Message.ToString(),
                    StringHelper.GetInstance().getStringValue(LanguageHelper.TrendViewer_Msg_ErrTitle, LanguageHelper.TrendViewer_Msg_ErrTitle_EN),
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
                LogHelper.Error(CLASS_NAME, Function_Name, localException.ToString());
            }
        }
Пример #11
0
        public void TestGetINIDataString01()
        {
            string entryCategory = string.Empty;
            string entryKey      = string.Empty;
            string entryDefault  = string.Empty;
            int    entrySize     = int.MinValue;

            ConfigureFileHelper.GetInstance().init();
            string str = ConfigureFileHelper.GetINIDataString("OPC_CLIENT", "SERVER1_NAME", "", 255, "C:/bin/win32_nd/config.ini");

            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record(str);
            recorder.FinishRecording();
            #endregion
        }
        /// <summary>
        /// Initialize TimeTableViewer.
        /// </summary>
        /// <param name="ctl">.</param>

        public void InitializeTimeTableViewer()
        {
            string FUNCTION_NAME = "InitializeTimeTableViewer";

            LogHelperCli.GetInstance().Log_Generic(CLASS_NAME + "." + FUNCTION_NAME, LogHelperCli.GetInstance().GetLineNumber(), EDebugLevelManaged.DebugInfo, "Function Entered.");

            DateTime Today = System.DateTime.Today.Date;

            this.datePicker.MaxDate = Today;
            this.datePicker.Value   = Today;

            //minimum date set to 32 days earlier from current date.
            this.datePicker.MinDate      = System.DateTime.Today.Date.AddDays(-TrainTimeTableConst.NUM_EARLIER_DAYS);
            this.startTimePicker.MinDate = Today;
            this.startTimePicker.Value   = Today;
            this.startTimePicker.MaxDate = Today.AddHours(23).AddMinutes(58).AddSeconds(59);
            this.endTimePicker.Value     = Today.AddHours(23).AddMinutes(59).AddSeconds(59);
            this.endTimePicker.MinDate   = System.DateTime.Today.Date.AddMinutes(1);
            this.endTimePicker.MaxDate   = Today.AddHours(23).AddMinutes(59).AddSeconds(59);

            bool bConnected = false;

            try
            {
                DBConnectionStrings.GetInstance().AddConnectionString(ConfigureFileHelper.GetInstance().DBConnectionString);

                LogHelperCli.GetInstance().Log_Generic(CLASS_NAME + "." + FUNCTION_NAME, LogHelperCli.GetInstance().GetLineNumber(),
                                                       EDebugLevelManaged.DebugInfo, "Connection String is: " + ConfigureFileHelper.GetInstance().DBConnectionString);

                bConnected = SimpleDatabase.GetInstance().OpenConnection();
            }
            catch (Exception localException)
            {
                LogHelperCli.GetInstance().Log_Generic(CLASS_NAME + "." + FUNCTION_NAME, LogHelperCli.GetInstance().GetLineNumber(), EDebugLevelManaged.DebugInfo, localException.ToString());
            }

            if (!bConnected)
            {
                MessageBox.Show("Error", "No connection", MessageBoxButtons.OK, MessageBoxIcon.Error);
                LogHelperCli.GetInstance().Log_Generic(CLASS_NAME + "." + FUNCTION_NAME, LogHelperCli.GetInstance().GetLineNumber(), EDebugLevelManaged.DebugInfo, "No Connection to Database.");
            }

            LogHelperCli.GetInstance().Log_Generic(CLASS_NAME + "." + FUNCTION_NAME, LogHelperCli.GetInstance().GetLineNumber(), EDebugLevelManaged.DebugInfo, "Exited");
        }
Пример #13
0
        static void Main(string[] args)
        {
            string Function_Name = "Main";

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Add the event handler for handling UI thread exceptions to the event.
            Application.ThreadException += new ThreadExceptionEventHandler(Program.UIThreadExceptionHandler);

            try
            {
                ConfigureFileHelper.GetInstance().init();

                //LanguageTypeHelper.GetInstance().SetLanaguageType(LanguageType.English);
                LanguageType type = LanguageTypeHelper.GetInstance().GetLanTypeByLanStr(ConfigureFileHelper.GetInstance().LanguageStr);
                LanguageTypeHelper.GetInstance().SetLanaguageType(type);

                DAOHelper.SetEncodingChange(ConfigureFileHelper.GetInstance().EncodingChange);

                LanguageHelper.InitAllStrings();

                string eventName = CreateWin32EventAndSetLogFile();

                ViewManager.GetInstance().RegisterViewFactory(new TrendingViewFactory());
                IView view = ViewManager.GetInstance().GetView(TrendViewConst.TrendView);  //viewID is ""
                Form  frm  = (Form)view;
                if (args.Length > 0)
                {
                    TrendViewController trendController = (TrendViewController)view.getController();
                    trendController.DrawTrendView(ref frm, args[0]);
                }

                Application.Run(frm);

                //event will be closed automatically.
                LogHelper.Info(CLASS_NAME, Function_Name, "Closed Event:" + eventName);
            }
            catch (Exception localExecption)
            {
                LogHelper.Error("TrendViewer.Program", Function_Name, localExecption.ToString());
            }
        }
Пример #14
0
        public void TestConfigureFileHelperConstructor01()
        {
            ConfigureFileHelper configureFileHelper = new ConfigureFileHelper();

            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record((string)configureFileHelper.AboutMessage);
            recorder.Record((string)configureFileHelper.ConnectionString);
            recorder.Record((string)configureFileHelper.DefaultFolder);
            recorder.Record((int)configureFileHelper.DefaultLineThickness);
            recorder.Record((string)configureFileHelper.DTTimeInteval);
            recorder.Record((string)configureFileHelper.OPCDTSever1Host);
            recorder.Record((string)configureFileHelper.OPCDTSever1Name);
            recorder.Record((string)configureFileHelper.OPCDTSever2Host);
            recorder.Record((string)configureFileHelper.OPCDTSever2Name);
            recorder.Record((string)configureFileHelper.OPCServerName);
            recorder.Record((string)configureFileHelper.OPCServerRootName);
            recorder.Record((string)configureFileHelper.TimeIntevalMS);
            recorder.FinishRecording();
            #endregion
        }
Пример #15
0
        public void TestGetInstance01()
        {
            ConfigureFileHelper configureFileHelper = ConfigureFileHelper.GetInstance();

            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record <string>(delegate { return((string)configureFileHelper.AboutMessage); });
            recorder.Record <string>(delegate { return((string)configureFileHelper.ConnectionString); });
            recorder.Record <string>(delegate { return((string)configureFileHelper.DefaultFolder); });
            recorder.Record <int>(delegate { return((int)configureFileHelper.DefaultLineThickness); });
            recorder.Record <string>(delegate { return((string)configureFileHelper.DTTimeInteval); });
            recorder.Record <string>(delegate { return((string)configureFileHelper.OPCDTSever1Host); });
            recorder.Record <string>(delegate { return((string)configureFileHelper.OPCDTSever1Name); });
            recorder.Record <string>(delegate { return((string)configureFileHelper.OPCDTSever2Host); });
            recorder.Record <string>(delegate { return((string)configureFileHelper.OPCDTSever2Name); });
            recorder.Record <string>(delegate { return((string)configureFileHelper.OPCServerName); });
            recorder.Record <string>(delegate { return((string)configureFileHelper.OPCServerRootName); });
            recorder.Record <string>(delegate { return((string)configureFileHelper.TimeIntevalMS); });
            recorder.FinishRecording();
            #endregion
        }
Пример #16
0
        public void TestSetFunctions()
        {
            ConfigureFileHelper configHelper = ConfigureFileHelper.GetInstance();

            configHelper.LanguageStr            = configHelper.LanguageStr;
            configHelper.OPCDTSever1Host        = configHelper.OPCDTSever1Host;
            configHelper.OPCDTSever1Name        = configHelper.OPCDTSever1Name;
            configHelper.OPCDTSever2Host        = configHelper.OPCDTSever2Host;
            configHelper.OPCDTSever2Name        = configHelper.OPCDTSever2Name;
            configHelper.OPCServerName          = configHelper.OPCServerName;
            configHelper.OPCServerRootName      = configHelper.OPCServerRootName;
            configHelper.ScreenWidth            = configHelper.ScreenWidth;
            configHelper.HostIPAddress          = configHelper.HostIPAddress;
            configHelper.EncodingChange         = configHelper.EncodingChange;
            configHelper.EnableSmartLabel       = configHelper.EnableSmartLabel;
            configHelper.DefaultLineThickness   = configHelper.DefaultLineThickness;
            configHelper.DefaultFolder          = configHelper.DefaultFolder;
            configHelper.ConnectionStringViewer = configHelper.ConnectionStringViewer;
            configHelper.ConnectionStringConfig = configHelper.ConnectionStringConfig;
            configHelper.AboutMessage           = configHelper.AboutMessage;
        }
        public void ExportHistoryDataToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string Function_Name = "ExportHistoryDataToolStripMenuItem_Click";

            if (m_trendCache.m_histDataPointList == null ||
                m_trendCache.m_histDataPointList.Count == 0
                )
            {
                MessageBoxDialog.Show(
                    StringHelper.GetInstance().getStringValue(LanguageHelper.TrendViewer_Msg_ExportNoData, LanguageHelper.TrendViewer_Msg_ExportNoData_EN),
                    StringHelper.GetInstance().getStringValue(LanguageHelper.TrendViewer_Msg_WarningTitle, LanguageHelper.TrendViewer_Msg_WarningTitle_EN),
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Warning);
                LogHelper.Error(CLASS_NAME, Function_Name, "No Data for current Datapoint History.");
                return;
            }
            try
            {
                SaveFileDialog saveFileDialog1 = new SaveFileDialog();
                //saveFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                saveFileDialog1.InitialDirectory = ConfigureFileHelper.GetInstance().DefaultFolder;//defaultFolder;
                saveFileDialog1.Filter           = "csv files (*.csv)|*.csv";
                saveFileDialog1.OverwritePrompt  = true;
                saveFileDialog1.FileName         = "OPCTrendViewerHistoryData";
                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    /*if (saveFileDialog1.FileName.Trim().Equals(""))  //this if will never come in.
                     * {
                     *  MessageBoxDialog.Show("Please specify filename to save.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                     *  return;
                     * }*/

                    ExportHistoryData(saveFileDialog1.FileName);
                }
            }
            catch (Exception localException)
            {
                LogHelper.Error(CLASS_NAME, Function_Name, localException.ToString());
            }
        }
Пример #18
0
        public void CaptureScreenShoot(object sender, EventArgs e)
        {
            string FUNCTION_NAME = "CaptureScreenShoot";

            LogHelperCli.GetInstance().Log_Generic(CLASS_NAME + "." + FUNCTION_NAME, LogHelperCli.GetInstance().GetLineNumber(),
                                                   EDebugLevelManaged.DebugInfo, "Function Entered");
            try
            {
                // Create a new save file dialog
                SaveFileDialog saveFileDialog1 = new SaveFileDialog();

                // Sets the current file name filter string, which determines
                // the choices that appear in the "Save as file type" or
                // "Files of type" box in the dialog box.

                saveFileDialog1.InitialDirectory = ConfigureFileHelper.GetInstance().DefaultFolder;

                saveFileDialog1.Filter           = "Bitmap (*.bmp)|*.bmp|JPEG (*.jpg)|*.jpg|PNG (*.png)|*.png|GIF (*.gif)|*.gif|TIFF (*.tif)|*.tif";
                saveFileDialog1.FilterIndex      = 2;
                saveFileDialog1.RestoreDirectory = true;

                // Set image file format
                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    m_View.GetTimeTableChartCtl().SaveAsImage(saveFileDialog1.FileName);
                    MessageBox.Show("图象保存成功", "列车时刻表", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    LogHelperCli.GetInstance().Log_Generic(CLASS_NAME + "." + FUNCTION_NAME, LogHelperCli.GetInstance().GetLineNumber(),
                                                           EDebugLevelManaged.DebugInfo, "Image Saved Successfully");
                }
            }
            catch (Exception localException)
            {
                MessageBox.Show("图象保存失败", "列车时刻表", MessageBoxButtons.OK, MessageBoxIcon.Error);
                LogHelperCli.GetInstance().Log_Generic(CLASS_NAME + "." + FUNCTION_NAME, LogHelperCli.GetInstance().GetLineNumber(),
                                                       EDebugLevelManaged.DebugInfo, localException.ToString());
            }

            LogHelperCli.GetInstance().Log_Generic(CLASS_NAME + "." + FUNCTION_NAME, LogHelperCli.GetInstance().GetLineNumber(),
                                                   EDebugLevelManaged.DebugInfo, "Function Exited");
        }
Пример #19
0
        public void TestDTTimeIntevalSetter01()
        {
            ConfigureFileHelper configureFileHelper = ConfigureFileHelperFactory.CreateConfigureFileHelper02();
            string dTTimeInteval = string.Empty;

            configureFileHelper.DTTimeInteval = dTTimeInteval;
            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record((string)configureFileHelper.AboutMessage);
            recorder.Record((string)configureFileHelper.ConnectionString);
            recorder.Record((string)configureFileHelper.DefaultFolder);
            recorder.Record((int)configureFileHelper.DefaultLineThickness);
            recorder.Record((string)configureFileHelper.DTTimeInteval);
            recorder.Record((string)configureFileHelper.OPCDTSever1Host);
            recorder.Record((string)configureFileHelper.OPCDTSever1Name);
            recorder.Record((string)configureFileHelper.OPCDTSever2Host);
            recorder.Record((string)configureFileHelper.OPCDTSever2Name);
            recorder.Record((string)configureFileHelper.OPCServerName);
            recorder.Record((string)configureFileHelper.OPCServerRootName);
            recorder.Record((string)configureFileHelper.TimeIntevalMS);
            recorder.FinishRecording();
            #endregion
        }
        public void SetSampleGrpConfigLocation(ref Form frm, string paramList)
        {
            string[]  arg         = paramList.Split(new char[] { ',' }, StringSplitOptions.None);
            int       screenWidth = ConfigureFileHelper.GetInstance().ScreenWidth;
            const int OFFSET      = 200;

            if (arg != null && arg.Length > 0)
            {
                if (arg[0].Trim().ToLower() == "view-edit-0")
                {
                    this.leftLocation = OFFSET;
                }
                else if (arg[0].Trim().ToLower() == "view-edit-1")
                {
                    this.leftLocation = screenWidth + OFFSET;
                }
                else if (arg[0].Trim().ToLower() == "view-edit-2")
                {
                    this.leftLocation = screenWidth * 2 + OFFSET;
                }
                frm.StartPosition = FormStartPosition.Manual;
                frm.Location      = new Point(leftLocation, 0x9b);
            }
        }
Пример #21
0
        internal static ConfigureFileHelper CreateConfigureFileHelper01()
        {
            ConfigureFileHelper configureFileHelper = ConfigureFileHelper.GetInstance();

            return(configureFileHelper);
        }
Пример #22
0
 public About(string aboutMsg)
 {
     InitializeComponent();
     aboutMsgLabel.Text = ConfigureFileHelper.GetInstance().AboutMessage;
 }
Пример #23
0
 public void TestSetup()
 {
     ConfigureFileHelper.GetInstance().init();
     bExitApplicationCalled = false;
 }
Пример #24
0
 public OPCDataSelector()
 {
     InitializeComponent();
     opcServerHostBox.Text = ConfigureFileHelper.GetInstance().HostIPAddress;
     dataSource.Text       = ConfigureFileHelper.GetInstance().OPCServerName;
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="paramList"> arg[0]: "view-0/view-edit-0/..", arg[1] datapoint, arg[2] marker,arg[3] history, arg[4] formula
        /// </param>
        public void DrawTrendView(ref Form frm, string paramList)
        {
            //get trending data by model
            //call to view for drawing
            string[]  arg         = paramList.Split(new char[] { ',' }, StringSplitOptions.None);
            int       screenWidth = ConfigureFileHelper.GetInstance().ScreenWidth;
            const int OFFSET      = 200;

            if (arg.Length > 0)
            {
                if (arg[0].Trim().ToLower() == "view-edit-0")
                {
                    this.accessRight  = "Y";
                    this.leftLocation = 0 + OFFSET;
                }
                else if (arg[0].Trim().ToLower() == "view-edit-1")
                {
                    this.accessRight  = "Y";
                    this.leftLocation = screenWidth + OFFSET;
                }
                else if (arg[0].Trim().ToLower() == "view-edit-2")
                {
                    this.accessRight  = "Y";
                    this.leftLocation = screenWidth * 2 + OFFSET;
                }
                else if (arg[0].Trim().ToLower() == "view-0")
                {
                    this.accessRight  = "N";
                    this.leftLocation = 0;
                }
                else if (arg[0].Trim().ToLower() == "view-1")
                {
                    this.accessRight  = "N";
                    this.leftLocation = screenWidth + OFFSET;
                }
                else
                {
                    this.accessRight  = "N";
                    this.leftLocation = screenWidth * 2 + OFFSET;
                }
                frm.StartPosition = FormStartPosition.Manual;
                frm.Location      = new Point(leftLocation, 0x9b);
            }
            if (arg.Length > 1)
            {
                if (arg[1].ToString().Trim() != "")
                {
                    DataPointListModel model = new DataPointListModel();
                    m_trendCache.m_dataPointList    = model.GetDPListByGrp(arg[1].Trim());
                    m_trendCache.m_datapointGrpName = arg[1].Trim();
                }
            }
            if (arg.Length > 2)
            {
                if (arg[2].ToString().Trim() != "")
                {
                    MarkerListModel model = new MarkerListModel();
                    m_trendCache.m_markerList    = model.GetMarkerListByGrp(arg[2].Trim());
                    m_trendCache.m_markerGrpName = arg[2].Trim();
                }
            }
            if (arg.Length > 3)
            {
                if (arg[3].ToString().Trim() != "")
                {
                    HistDataPointListModel model = new HistDataPointListModel();
                    m_trendCache.m_histDataPointList    = model.GetHistDListByGrp(arg[3].Trim());
                    m_trendCache.m_histDatapointGrpName = arg[3].Trim();
                }
            }
            if (arg.Length > 4)
            {
                if (arg[4].ToString().Trim() != "")
                {
                    FormulaListModel model = new FormulaListModel();
                    m_trendCache.m_formulaList    = model.GetFormulaListByGrp(arg[4].Trim());
                    m_trendCache.m_formulaGrpName = arg[4].Trim();
                }
            }
            object    sender = null;
            EventArgs e      = null;

            if (arg.Length > 1)
            {
                RealTimeExecuteCmd_Click(sender, e);
            }
        }
Пример #26
0
 public void TestInit02()
 {
     //if (encodingChange_str.ToLower() == "true")
     ConfigureFileHelper.GetInstance().init();
 }
Пример #27
0
        internal static ConfigureFileHelper CreateConfigureFileHelper02()
        {
            ConfigureFileHelper configureFileHelper = new ConfigureFileHelper();

            return(configureFileHelper);
        }