Esempio n. 1
0
        public void HandleMessage(HeaterMessage heaterMessage, double value)
        {
            switch (heaterMessage.Content)
            {
            case HeaterMsg.设置标准温度值:
                this.HeaterControllable.SetTemp(value, heaterMessage.ChanelNo);
                this.HeaterPrm.Standard[heaterMessage.ChanelNo] = value;
                break;

            case HeaterMsg.设置温度上限值:
                this.HeaterControllable.SetAlarmTemp(value, ToleranceType.High, heaterMessage.ChanelNo);
                this.HeaterPrm.High[heaterMessage.ChanelNo] = value;
                break;

            case HeaterMsg.设置温度下限值:
                this.HeaterControllable.SetAlarmTemp(value, ToleranceType.Low, heaterMessage.ChanelNo);
                this.HeaterPrm.Low[heaterMessage.ChanelNo] = value;
                break;

            case HeaterMsg.设置温度漂移值:
                this.HeaterControllable.SetTempOffset(value, heaterMessage.ChanelNo);
                this.HeaterPrm.Offset[heaterMessage.ChanelNo] = value;
                break;
            }
        }
Esempio n. 2
0
        public void HandleMessage(HeaterMessage heaterMessage)
        {
            switch (heaterMessage.Content)
            {
            case HeaterMsg.获取标准温度值:
                this.HeaterControllable.GetTemp(out currentTemp[heaterMessage.ChanelNo], heaterMessage.ChanelNo);
                heaterMessage.Value = currentTemp[heaterMessage.ChanelNo];
                break;

            case HeaterMsg.获取温度上限值:
                this.HeaterControllable.GetAlarmTemp(out tempHighValue[heaterMessage.ChanelNo], ToleranceType.High, heaterMessage.ChanelNo);
                heaterMessage.Value = tempHighValue[heaterMessage.ChanelNo];
                break;

            case HeaterMsg.获取温度下限值:
                this.HeaterControllable.GetAlarmTemp(out tempLowValue[heaterMessage.ChanelNo], ToleranceType.Low, heaterMessage.ChanelNo);
                heaterMessage.Value = tempLowValue[heaterMessage.ChanelNo];
                break;

            case HeaterMsg.获取温度漂移值:
                this.HeaterControllable.GetTempOffset(out tempOffset[heaterMessage.ChanelNo], heaterMessage.ChanelNo);
                heaterMessage.Value = tempOffset[heaterMessage.ChanelNo];
                break;

            case HeaterMsg.开始加热:
                this.HeaterControllable.StartHeating(heaterMessage.ChanelNo);
                break;

            case HeaterMsg.停止加热:
                this.HeaterControllable.StopHeating(heaterMessage.ChanelNo);
                break;
            }
        }
Esempio n. 3
0
 public void Fire(HeaterMessage heaterMessage)
 {
     lock (this)
     {
         if (heaterMessage.Content == HeaterMsg.获取标准温度值 ||
             heaterMessage.Content == HeaterMsg.获取温度上限值 ||
             heaterMessage.Content == HeaterMsg.获取温度下限值 ||
             heaterMessage.Content == HeaterMsg.获取温度漂移值)
         {
             this.queue.Enqueue(heaterMessage);
         }
         else
         {
             this.priorityQueue.Enqueue(heaterMessage);
         }
     }
 }
Esempio n. 4
0
 public void Fire(HeaterMessage heaterMessage)
 {
     HeaterServer.Instance.Fire(heaterMessage);
 }