Example #1
0
        public MainForm()
        {
            InitializeComponent();
            InitTexts();

            try
            {
                List <string> args = Environment.GetCommandLineArgs().ToList();
                setupFlowLayoutPanel.Visible = (args[1] == "SETUPMODE");
            }
            catch
            {
                setupFlowLayoutPanel.Visible = false;
            }


            Text = TextsParams.ParameterName(0);
            serialPort.LoadSettingsFromFile("Comset.xml");
            CreateChildForms();
            systemConfiguration.LoadFromFile("SysType.xml");
            InitSystemConfig();
            EnableAllButtons(false);
            serialPort.PortClosed           += new EventHandler(serialPort_PortClosed);
            serialPort.SerialPortError      += new EventHandler(serialPort_SerialPortError);
            serialPort.FatalSerialPortError += new EventHandler(serialPort_FatalSerialPortError);
        }
Example #2
0
 //************************УСТАНОВКА ТЕКУЩЕГО ВРЕМЕНИ *********************************************//
 //************************************************************************************************//
 private void setClockBtn_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show(TextsParams.ParameterName(18), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
     {
         DateTime dt = DateTime.Now;
         TimeConfig.SendSetTimeRequest(serialPort, systemConfiguration.TimeConfig,
                                       dt.Hour, dt.Minute, dt.Second, dt.Day, dt.Month, dt.Year - 2000);
     }
 }
Example #3
0
        //************************УСТАНОВКА-РАЗРЫВ СОЕДИНЕНИЯ *********************************************//
        //************************************************************************************************//
        private void connectBtn_Click(object sender, EventArgs e)
        {
            try
            {
                serialPort.Open();
            }
            catch
            {
                ErrorMessage(TextsParams.ParameterName(15));
                return;
            }


            if (serialPort.IsOpen)
            {
                EnableAllButtons(true);
            }
            else
            {
                ErrorMessage(TextsParams.ParameterName(15));
            }
        }
Example #4
0
        //************************СОЗДАНИЕ ФОРМЫ**********************************************************//
        //*****************************************8******************************************************//
        void InitTexts()
        {
            try
            {
                toolTip1.SetToolTip(connectBtn, TextsParams.ParameterName(2));
                toolTip1.SetToolTip(disconnectBtn, TextsParams.ParameterName(3));
                toolTip1.SetToolTip(setClockBtn, TextsParams.ParameterName(19));
                toolTip1.SetToolTip(loadSysTypeBtn, TextsParams.ParameterName(20));

                directBtn.Title      = TextsParams.ParameterName(45);
                directFloatBtn.Title = TextsParams.ParameterName(4);
                toolTip1.SetToolTip(directFloatBtn, TextsParams.ParameterName(4));
                loadSYMBtn.Title              = TextsParams.ParameterName(17);
                scopeLabelButton.Title        = TextsParams.ParameterName(70);
                eventLabelButton.Title        = TextsParams.ParameterName(99);
                jogLabelButton.Title          = TextsParams.ParameterName(111);
                angleLabelButton.Title        = TextsParams.ParameterName(119);
                digitTitle.Text               = TextsParams.ParameterName(108);
                verificationlabelButton.Title = TextsParams.ParameterName(111);
            }
            catch (Exception e)
            {
            }
        }