Example #1
0
        private void _ql_OnQL_DataChanged(QL sender, byte[] data)
        {
            try
            {
                Color col;
                int   tag = 0;

                for (int i = 2; i < 8; i++)
                {
                    if (data[i] != 0)
                    {
                        col = colCColor[i - 2];
                        tag = data[i];
                    }
                    else
                    {
                        col = Color.Transparent;
                        tag = 0;
                    }

                    Function.form.control.Invoke_Control_Color(lblCStatus[i - 2], null, col);
                    //Function.form.control.Invoke_Control_Tag(lblCStatus[i - 2], tag);

                    tags[i - 2] = tag;

                    //알람은 텍스트 변경
                    if (i == 7)
                    {
                        Function.form.control.Invoke_Control_Text(lblCStatus[i - 2], tag == 0 ? "A" : tag.ToString());
                    }
                }
            }
            catch
            { }
        }
Example #2
0
        public QLight_Test(QL ql, bool readOnly)
        {
            InitializeComponent();
            _ql = ql;

            setting_pgm = Application.StartupPath + "\\" + setting_pgm;

            if (readOnly)
            {
                inpIpAddress.InputType = Function.form.usrInputBox.enInputType.LABEL;
                inpPort.InputType      = Function.form.usrInputBox.enInputType.LABEL;
            }
        }
Example #3
0
        /// <summary>
        /// 경광등 상태 변경
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="status"></param>
        private void _ql_OnQL_StatusChanged(QL sender, enQL_Status status)
        {
            if (picStatus.InvokeRequired)
            {
                picStatus.Invoke(new delQL_StatusChanged(_ql_OnQL_StatusChanged), sender, status);
                return;
            }

            if (status == enQL_Status.Connected)
            {
                picStatus.Image = Function.resIcon16.button_green;
            }
            else
            {
                picStatus.Image = Function.resIcon16.button_red;
            }


            lblStatus.Text = status.ToString();
        }
Example #4
0
        private void QLight_Test_Load(object sender, EventArgs e)
        {
            //알람 환결 설정 프로그래
            if (System.IO.File.Exists(setting_pgm))
            {
                //있음
                btnSettingPgm.Enabled = true;
                btnSettingPgm.Image   = Function.resIcon16.status_on;
            }
            else
            {
                //없음
                btnSettingPgm.Enabled = false;
                btnSettingPgm.Image   = Function.resIcon16.status_off;
            }

            lblCStatus = new Label[] { label5, label6, label7, label8, label9, label10 };

            thBlink = new System.Threading.Timer(new TimerCallback(lblBlink), null, 1000, 800);

            inpAlarm.ComboBoxItems.AddRange(Fnc.EnumItems2Strings(new enSoundKind()));
            inpAlarm.ComboBoxSelectIndex = 0;

            if (_ql == null)
            {
                _ql = new QL("210.100.103.85", 20000);
            }

            inpIpAddress.Value = _ql.IpAddress;
            inpPort.Value      = _ql.Port.ToString();

            _ql.OnQL_StatusChanged += _ql_OnQL_StatusChanged;
            _ql_OnQL_StatusChanged(_ql, _ql.QL_Status);

            _ql.OnQL_DataChanged += _ql_OnQL_DataChanged;
            _ql_OnQL_DataChanged(_ql, _ql.Data_lastStatus);
        }