Пример #1
0
        private void TcpServer_EventScreenInfo(object sender, PivasEventArgs <MsgScreenInfo> e)
        {
            try
            {
                ClearAll(false);

                this.SafeAction(() =>
                {
                    //更换结果颜色
                    Color color = e.Value.ChargeResult == StaticDictionary.CHARGE_RESULT_SUCCESS ? Color.Green : Color.Red;
                    UpdateLabelResult(e.Value.ChargeMessage, color);

                    this.lblWardName.Text    = e.Value.WardName;
                    this.lblPatientName.Text = e.Value.PatientName;
                    this.lblLabelNo.Text     = e.Value.LabelNo;

                    this.lblDoctor.Text      = e.Value.EmployeeName;
                    this.lblConfigCount.Text = e.Value.MixCount;
                    this.lblTime.Text        = e.Value.ShowTime;

                    UpdateListviewDrug(e.Value.Drugs);
                    UpdateListMethod(e.Value.Methods);
                });
            }
            catch (Exception ex)
            {
                InternalLogger.Log.Error("接收到数据处理出错:" + ex.Message);
            }
        }
Пример #2
0
 private void ScreenTcpClient_Disconnected(object sender, PivasEventArgs <TCPMessage> e)
 {
     if (Disconnected != null)
     {
         Disconnected(sender, e);
     }
 }
Пример #3
0
 private void ScreenTcpClient_Connected(object sender, PivasEventArgs <TCPMessage> e)
 {
     moxaOpenAutoResetEvent.Set();
     if (Connected != null)
     {
         Connected(sender, e);
     }
 }
Пример #4
0
 private void TcpServer_EventLogin(object sender, PivasEventArgs <MsgLoginResult> e)
 {
     //0未登录状态,1登录状态
     if (e.Value.Status == StaticDictionary.DOCTOR_STATUS_FALSE)//未登录
     {
         HideShow(true);
         UpdateLabelResult("请扫描登录", Color.Red);
     }
     else
     {
         HideShow(false);
         ClearAll(true);
     }
 }
Пример #5
0
 /// <summary>
 /// 接收到瓶签数据
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ScreenTcpClient_DataReceived(object sender, PivasEventArgs <TCPMessage> e)
 {
     try
     {
         lock (receiveQueue)
         {
             receiveQueue.Enqueue(e.Value);
         }
     }
     catch (Exception ex)
     {
         InternalLogger.Log.Error("将瓶签号入队出错:" + ex.Message);
     }
 }
Пример #6
0
 /// <summary>
 /// 将待发送到屏的信息,放入队列
 /// </summary>
 /// <param name="e"></param>
 public void sendDataEnqueue(PivasEventArgs <TCPMessage> e)
 {
     try
     {
         //多个连接都会入队
         lock (sendQueue)
         {
             sendQueue.Enqueue(e.Value);
         }
     }
     catch (Exception ex)
     {
         InternalLogger.Log.Error("发送到屏的数据入队出错:" + ex.Message);
     }
 }
Пример #7
0
 /// <summary>
 /// 将待发送到屏的信息,放入队列
 /// 数据长度采用固定长度60,方便屏解析;不足部分用0x20(ASCII码的空格)填充
 /// </summary>
 /// <param name="e"></param>
 public void DisplayDataEnqueue(PivasEventArgs <TCPMessageEx> e)
 {
     try
     {
         //多个连接都会入队
         lock (displayQueue)
         {
             displayQueue.Enqueue(e.Value);
         }
     }
     catch (Exception ex)
     {
         InternalLogger.Log.Error("Display数据入队出错:" + ex.Message);
     }
 }
Пример #8
0
 private void MoxaTcpClient_DataReceived(object sender, PivasEventArgs <TCPMessage> e)
 {
     try
     {
         //多个连接都会入队
         lock (moxaQueue)
         {
             moxaQueue.Enqueue(e.Value);
         }
     }
     catch (Exception ex)
     {
         InternalLogger.Log.Error("MOXA数据入队出错:" + ex.Message);
     }
 }
Пример #9
0
 private void Communicate_eventDataReceive1(object sender, PivasEventArgs <byte[]> e)
 {
     //已保证是6个字节
     try
     {
         byte   plcNo    = e.Value[0];
         byte[] out_1_16 = new byte[2];
         out_1_16[0] = e.Value[2];
         out_1_16[1] = e.Value[3];
         InternalLogger.Log.Error(string.Format("PLCNo={0},send1={1},send2={2}", plcNo, e.Value[2], e.Value[3]));
         GetLights(plcNo, out_1_16);
     }
     catch (Exception ex)
     {
         InternalLogger.Log.Error("处理接收到控制指令出错:" + ex.Message);
     }
 }
Пример #10
0
 private void TcpServer_ErrorOccurred(object sender, PivasEventArgs <string> e)
 {
     UpdateLabelResult(e.Value, Color.Red);
 }
Пример #11
0
 private void MoxaTcpClient_Connected(object sender, PivasEventArgs <TCPMessage> e)
 {
     moxaOpenAutoResetEvent.Set();
 }
Пример #12
0
 private void MoxaTcpClient_Disconnected(object sender, PivasEventArgs <TCPMessage> e)
 {
 }