Пример #1
0
 /// <summary>
 /// 报警状态位置位函数
 /// </summary>
 /// <param name="model"></param>
 /// <param name="index"></param>
 private void AlarmFlagSet(OPCChangeModel model, int index)
 {
     try
     {
         int match = GlobalVars.alarmMessages.FindIndex(a => a.Index == index);
         GlobalVars.alarmMessages[match].AlarmFlag = Convert.ToBoolean(model.Value);
         GlobalVars.alarmMessages[match].TimeStamp = model.TimeStamp;
         UpdateAlarmList();
     }
     catch
     {
     }
 }
Пример #2
0
        /// <summary>
        /// 机器状态数据更新函数
        /// </summary>
        /// <param name="flag"></param>
        /// <param name="model"></param>
        /// <param name="index"></param>
        private void MachineFlagSet(machineFlag flag, OPCChangeModel model, int index)
        {
            switch (index % 100)
            {
            //MachineFlagSet(machinesFlags.SR01Flag, model);
            case 1:    //机器开机状态位
                flag.MachineStartusQuality = model.Quality;
                flag.IsMachineStart        = Convert.ToBoolean(model.Value);
                break;

            case 2:    //机器炉子状态位
                flag.FurnaceStartusQuality = model.Quality;
                flag.IsFurnaceStart        = Convert.ToBoolean(model.Value);
                break;

            case 3:    //机器升料机状态位
                flag.LiterStartusQuality = model.Quality;
                flag.IsLiterStart        = Convert.ToBoolean(model.Value);
                break;

            case 4:    //机器报警状态位
                flag.AlarmStatusQuality = model.Quality;
                flag.IsAlarm            = Convert.ToBoolean(model.Value);
                break;

            case 5:    //烤模时间设定
                flag.FlareMoldTimeSetting = Convert.ToInt32(model.Value);
                break;

            case 6:    //浸料时间设定
                flag.DipingMaterialTimeSetting = Convert.ToInt32(model.Value);
                break;

            case 7:    //烤料时间设定
                flag.FlareMaterialTimeSetting = Convert.ToInt32(model.Value);
                break;

            case 8:    //冷却时间设定
                flag.CoolingTimeSetting = Convert.ToInt32(model.Value);
                break;
            }
            BannerMessageSet(flag, index / 100);
        }