Example #1
0
        /// <summary>
        /// 车厅状态故障汇总
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnDeviceFault_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(this.TxtWareHouse.Text) || string.IsNullOrEmpty(this.TxtEquipID.Text))
                {
                    MessageBox.Show("库区,设备为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                int nWareHouse = CStaticClass.ConvertWareHouse(this.TxtWareHouse.Text);
                int nHallID    = CStaticClass.ConvertHallDescp(nWareHouse, this.TxtEquipID.Text);
                m_formDeviceFault.UpdateDeviceFault(nWareHouse, nHallID);
                m_formDeviceFault.ShowDialog();
            }
            catch (TimeoutException)
            {
                MessageBox.Show("The service operation timed out. ", "超时", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (FaultException exception)
            {
                MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "SOAP错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (CommunicationException exception)
            {
                MessageBox.Show("There was a communication problem. " + CStaticClass.GetExceptionInfo(exception), "通信错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception exception)
            {
                MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "应用程序异常", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        /// <summary>
        ///WCF回调子函数
        /// </summary>
        /// <param name="e"></param>
        private void CallBackSubFunction(object e)
        {
            if (e.GetType() == typeof(CarLocationPanelLib.PushService.CCarLocationDto))
            {// 更新当前某一车位状态
                CarLocationPanelLib.PushService.CCarLocationDto carLocation = (CarLocationPanelLib.PushService.CCarLocationDto)e;
                string          strName          = carLocation.warehouse.ToString();
                CWareHousePanel wareHouseTabPage = (CWareHousePanel)m_ltpWareHouse.Find(a => a.Name == strName);
                wareHouseTabPage.UpdateCarLocationStatus(carLocation);
                SetStatusStripValue();
                //CLOGException.Trace("CallBackSubFunction, carLocation.carlocaddr:" + carLocation.carlocaddr);
                //SetStatusStripValue(e);
            }
            else if (e.GetType() == typeof(CarLocationPanelLib.PushService.CDeviceStatusDto))
            {// 更新当前某一设备状态
                CarLocationPanelLib.PushService.CDeviceStatusDto deviceStatus = (CarLocationPanelLib.PushService.CDeviceStatusDto)e;
                CLOGException.Trace(0, "callback_CallbackEvent, e:", string.Format("deviceStatus.warehouse-{0} deviceStatus.devicecode-{1}", deviceStatus.warehouse, deviceStatus.devicecode));
                if ((int)EnmSMGType.ETV == deviceStatus.devicetype)
                {
                    // 客户端界面ETV位置更新
                    string          strName          = deviceStatus.warehouse.ToString();
                    CWareHousePanel wareHouseTabPage = (CWareHousePanel)m_ltpWareHouse.Find(a => a.Name == strName);
                    wareHouseTabPage.UpdateDeviceStatus(deviceStatus);
                    if (m_formETV.Visible && null != m_formETV.EquipDeviceStatus &&
                        m_formETV.EquipDeviceStatus.warehouse == deviceStatus.warehouse &&
                        m_formETV.EquipDeviceStatus.devicecode == deviceStatus.devicecode)
                    {// 更新ETV设备信息界面
                        m_formETV.FillFormEquip(CStaticClass.ConvertDeviceStatus(deviceStatus));
                    }
                }
                else if (m_formHall.Visible && null != m_formHall.EquipDeviceStatus &&
                         m_formHall.EquipDeviceStatus.warehouse == deviceStatus.warehouse &&
                         m_formHall.EquipDeviceStatus.devicecode == deviceStatus.devicecode)
                {// 更新车厅设备信息界面
                    m_formHall.FillFormHall(CStaticClass.ConvertDeviceStatus(deviceStatus));
                }

                List <object> lstETV = CStaticClass.ConfigLstETVOrTVDeviceID(deviceStatus.warehouse);
                if (null != lstETV && 1 > lstETV.Count)
                {
                    // 无ETV时,客户端界面ETV颜色更新
                    string          strName          = deviceStatus.warehouse.ToString();
                    CWareHousePanel wareHouseTabPage = (CWareHousePanel)m_ltpWareHouse.Find(a => a.Name == strName);
                    wareHouseTabPage.UpdateDeviceStatus(deviceStatus);
                }

                if (null != m_formSystemConfig)
                {
                    m_formSystemConfig.UpdateDeviceIsable(deviceStatus);
                }

                if (null == m_formCIMCWorker)
                {
                    m_formCIMCWorker = new CFormCIMCWorker();
                }

                m_formCIMCWorker.UpdateFlowChart(deviceStatus);
            }
            else if (e.GetType() == typeof(CarLocationPanelLib.PushService.CDeviceFaultDto))
            {// 更新当前某一label设备故障
                CarLocationPanelLib.PushService.CDeviceFaultDto deviceFault = (CarLocationPanelLib.PushService.CDeviceFaultDto)e;

                // 客户端界面设备故障状态更新
                string          strName          = deviceFault.warehouse.ToString();
                CWareHousePanel wareHouseTabPage = (CWareHousePanel)m_ltpWareHouse.Find(a => a.Name == strName);
                string          str = wareHouseTabPage.UpdateDeviceFault(deviceFault);

                if (!this.TsslPLC.Text.Contains(str))
                {// 获取当前故障设备
                    this.TsslPLC.Text += str;
                }

                // 客户端设备故障界面更新
                if (null != m_formDeviceFault)
                {
                    m_formDeviceFault.UpdateDeviceFault(deviceFault);
                }
            }
        }