MainMachine _IOMonitor.cs 1.3 KB
using CodeLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DeviceLibrary
{
    partial class MainMachine
    {
        void ioMonitor()
        {
            if (IOValue(IO_Type.Airpressure_Check).Equals(IO_VALUE.LOW) && !G.simulate) {
                Msg.add(crc.GetString("Res0166","未检测到气压信号."), MsgLevel.warning);
            }
            var errorTray = TrayManager.Traylist.ToList().Where(x => x.Value.IsLoadError).ToList();
            if (errorTray.Count > 0) {
                foreach (var error in errorTray)
                {
                    if (error.Value.HasLoad)
                        Msg.add(crc.GetString("Form1_tabc_tab_tmc_Text","托盘") + ":" + error.Key + " " + crc.GetString("Res0109.28f408e5","有物料托盘, 但未检测到物料"), MsgLevel.alarm);
                    else
                        Msg.add(crc.GetString("Form1_tabc_tab_tmc_Text","托盘") + ":" + error.Key + " " + crc.GetString("Res0110.ca6543cd","空托盘, 但检测到物料"), MsgLevel.alarm);
                }
            }
        }
    }
}