Ejemplo n.º 1
0
        /// <summary>
        /// Disconnect 버튼 클릭 이벤트
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnDisconnect_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            this.BaseClass.MsgQuestion("ASK_DISCONNECT");
            if (this.BaseClass.BUTTON_CONFIRM_YN == false)
            {
                return;
            }

            if (_ref_Sorter.ReferenceState == enumReferenceState.Active)
            {
                _ref_Sorter.Stop();
                _ref_Sorter = null;
            }

            if (_ref_IPS.ReferenceState == enumReferenceState.Active)
            {
                _ref_IPS.Stop();
                _ref_IPS = null;
            }

            if (_ref_AI.ReferenceState == enumReferenceState.Active)
            {
                _ref_AI.Stop();
                _ref_AI = null;
            }
        }
Ejemplo n.º 2
0
 private void ConnectElement2()
 {
     ucConn2.ElementNo       = 126;
     _reference2             = CReferenceManager.GetReference("IPS", 126);
     ucConn2.OnPanelUIEvent += uCCommunication2_OnPanelUIEvent;
     ucConn2.LinkedReference = _reference2;
     ucConn2.LinkedReference.Start();
 }
Ejemplo n.º 3
0
        private void ConnectElement()
        {
            try
            {
                ucConn1.ElementNo       = ElementNo;
                _reference              = CReferenceManager.GetReference("SorterServer", "SetConfiguration", "172.27.239.11", "9888", "Tcp", LGCNS.ezControl.Common.enumSessionType.Element, null);
                ucConn1.OnPanelUIEvent += uCCommunication_OnPanelUIEvent;
                ucConn1.LinkedReference = _reference;

                if (_reference != null)
                {
                    ucConn1.LinkedReference.Start();
                }
            }
            catch { throw; }
        }
Ejemplo n.º 4
0
        private void ConnectElement()
        {
            try
            {
                ucConn1.ElementNo       = 5;
                _reference              = CReferenceManager.GetReference("Simulator", 5);
                ucConn1.OnPanelUIEvent += uCCommunication_OnPanelUIEvent;
                ucConn1.LinkedReference = _reference;

                if (_reference != null)
                {
                    ucConn1.LinkedReference.Start();
                }
            }
            catch { throw; }
        }
Ejemplo n.º 5
0
 private void _ref_Conveyor_OnStateChanged(CReference sender, enumReferenceState state)
 {
     if (state == LGCNS.ezControl.Common.enumReferenceState.Active && state == LGCNS.ezControl.Common.enumReferenceState.Active)
     {
         this.lblConnConveyor.Content   = "Conveyor Connected";
         this.bdConnConveyor.Background = new SolidColorBrush(Colors.Green);
         this.BtnConnect.IsEnabled      = false;
         this.BtnDisconnect.IsEnabled   = true;
     }
     else if (state == LGCNS.ezControl.Common.enumReferenceState.Fault)
     {
         this.lblConnConveyor.Content   = "Conveyor Disconnected";
         this.bdConnConveyor.Background = new SolidColorBrush(Colors.Red);
         this.BtnConnect.IsEnabled      = true;
         this.BtnDisconnect.IsEnabled   = false;
     }
     state_conveyor = state;
 }
Ejemplo n.º 6
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);
            }
        }
Ejemplo n.º 7
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();
            }
        }
Ejemplo n.º 8
0
        private void _ref_Sorter_OnStateChanged(CReference sender, enumReferenceState state)
        {
            if (state == LGCNS.ezControl.Common.enumReferenceState.Active && state == LGCNS.ezControl.Common.enumReferenceState.Active)
            {
                this.lblConnSorter.Content   = "Sorter Connected";
                this.bdConnSorter.Background = new SolidColorBrush(Colors.Green);
                this.BtnConnect.IsEnabled    = false;
                this.BtnDisconnect.IsEnabled = true;

                this.BaseClass.MsgInfo("CMPT_CONNECT");
            }
            else if (state == LGCNS.ezControl.Common.enumReferenceState.Fault && state == LGCNS.ezControl.Common.enumReferenceState.Fault)
            {
                this.lblConnSorter.Content   = "Sorter Disconnected";
                this.bdConnSorter.Background = new SolidColorBrush(Colors.Red);
                this.BtnConnect.IsEnabled    = true;
                this.BtnDisconnect.IsEnabled = false;

                this.BaseClass.MsgInfo("CMPT_DISCONNECT");
            }
            state_sorter = state;
        }
Ejemplo n.º 9
0
 private void _ref_Conveyor_OnElementEvent(CReference reference, int iElementNo, string strElementPath, string strSubjectName, int iEventID, params object[] args)
 {
 }
Ejemplo n.º 10
0
 private void _ref_AI_OnElementEvent(CReference reference, int iElementNo, string strElementPath, string strSubjectName, int iEventID, params object[] args)
 {
     Get_Result_ITEM(BCDResultList.Where(p => p.IsSelected == true).ToList());
 }