Exemple #1
0
        /// <summary>
        /// Connect 버튼 클릭 이벤트
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnConnect_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            //string test = this.BaseClass.EncryptAES256("Persist Security Info = False; Integrated Security = false; database = LGHealthy; server = localhost; User ID = sa; Password = 123");
            if (string.IsNullOrEmpty(this.txtConveyorNo.Text))
            {
                this.BaseClass.MsgError(string.Format("{0}를 입력해주세요.", this.txtConveyorNo.Name.Substring(3)), BaseEnumClass.CodeMessage.MESSAGE);
                return;
            }

            if (_ref_Conveyor == null)
            {
                _ref_Conveyor = CReferenceManager.GetReference(GetFactovaConnection("LGHealthy"), "LGHealth", 5);
                _ref_Conveyor.OnStateChanged += _ref_Conveyor_OnStateChanged;
                _ref_Conveyor.OnElementEvent += _ref_Conveyor_OnElementEvent;
                _ref_Conveyor.Start();

                this.BaseClass.MsgInfo("연결되었습니다", BaseEnumClass.CodeMessage.MESSAGE);
            }
        }
Exemple #2
0
        /// <summary>
        /// Connect 버튼 클릭 이벤트
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnConnect_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            // ECS 프로그램과 연결
            if (String.IsNullOrEmpty(this.txtSorterNo.Text))
            {
                this.BaseClass.MsgError("ERR_NOT_INPUT", "SORTER_ELEMENT_NO");
                return;
            }

            if (String.IsNullOrEmpty(this.txtIPSNo.Text))
            {
                this.BaseClass.MsgError("ERR_NOT_INPUT", "IPS_ELEMENT_NO");
                return;
            }

            this.BaseClass.MsgQuestion("ASK_CONNECT");
            if (this.BaseClass.BUTTON_CONFIRM_YN == false)
            {
                return;
            }

            _ref_Sorter = CReferenceManager.GetReference(GetFactovaConnection("COUPANG_YS"), "SorterServer", Convert.ToInt32(this.txtSorterNo.Text));
            _ref_Sorter.OnStateChanged += _ref_Sorter_OnStateChanged;
            _ref_Sorter.OnElementEvent += _ref_Sorter_OnElementEvent;
            _ref_Sorter.Start();

            _ref_IPS = CReferenceManager.GetReference(GetFactovaConnection("COUPANG_YS"), "IPSServer", Convert.ToInt32(this.txtIPSNo.Text));
            _ref_IPS.OnStateChanged += _ref_IPS_OnStateChanged;
            _ref_IPS.OnElementEvent += _ref_IPS_OnElementEvent;
            _ref_IPS.Start();

            if (txtAINo.Text != string.Empty)
            {
                _ref_AI = CReferenceManager.GetReference(GetFactovaConnection("COUPANG_YS"), "AIServer", Convert.ToInt32(this.txtAINo.Text));
                _ref_AI.OnStateChanged += _ref_AI_OnStateChanged;
                _ref_AI.OnElementEvent += _ref_AI_OnElementEvent;
                _ref_AI.Start();
            }
        }