Пример #1
0
 private void button_ping_Click(object sender, EventArgs e)
 {
     label_help.Text = "Connecting...";
     this.Refresh();
     // test LED connection
     // init communication and refresh text of label_help as connection status
     label_help.Text = LEDConnection.InitComm() ? "Connection Success" : "Connection Fail";
 }
Пример #2
0
 private void loadConfig()
 {
     // load config from ini file
     LEDConfig.loadConfig();
     // fill config to textBoxes
     textBox_IP.Text      = LEDConfig.IpAddr;
     textBox_port.Text    = LEDConfig.port.ToString();
     textBox_idcode.Text  = LEDConfig.IDCode;
     textBox_timeout.Text = LEDConfig.timeout.ToString();
     // init CP5200 connection
     LEDConnection.InitComm();
 }
Пример #3
0
        // CP5200 refresher
        private void RefreshLED(string str, Color foreColor)
        {
            //CP5200_SendText(PreviewResult.Text);

            // create temporal image
            TextImage tempImg = new TextImage(str, LEDConfig.defaultFont, foreColor, Color.Black);

            try
            {
                LEDConnection.CP5200_SendImg(tempImg, effect);
            }
            catch (Exception ex)
            {
                //refresh preview area
                LED.settingForm.RefreshPreview(ex.Message);
            }
            finally
            {
                // delete temp image
                tempImg.release();
            }
        }