1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using Aitex.Core.RT.DataCenter;
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Device.Unit;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.OperationCenter;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.Utilities;
- using Aitex.Sorter.Common;
- using FurnaceRT.Devices;
- using MECF.Framework.Common.Alarms;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.Event;
- using MECF.Framework.Common.Schedulers;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace FurnaceRT.Equipments.FIMSs
- {
- public partial class FIMSModule
- {
-
- #region fields
- private List<AlarmEventItem> _triggeredAlarmList = new List<AlarmEventItem>();
- private List<IoAlarmSignal> _alarmSignals = new List<IoAlarmSignal>();
- private List<IDevice> _allModuleDevice = new List<IDevice>();
- private int _alarmNumber;
- #endregion
- public IoFIMS FIMSDevice { get; set; }
- public IoSensor SensorWaferRobotEX1AxisHomePosition { get; set; }
- public IoSensor SensorWaferRobotEX2AxisHomePosition { get; set; }
- public bool IsMapping { get; set; }
- public bool IsDoorOpen
- {
- get
- {
- if (!SC.GetValue<bool>("System.IsSimulatorMode"))
- {
- if (FIMSDevice != null)
- {
- return FIMSDevice.DoorOpenCloseStatus == DeviceStatus.Open;
- }
- }
- return true;
- }
- }
- public bool IsWaferOnRobot => FIMSDevice == null ? false : FIMSDevice.IsWaferOnRobot;
- public void InitDevice()
- {
- FIMSDevice = DEVICE.GetDevice<IoFIMS>($"PM1.{Module}");
- SensorWaferRobotEX1AxisHomePosition = DEVICE.GetDevice<IoSensor>($"PM1.SensorWaferRobotEX1AxisHomePosition");
- SensorWaferRobotEX2AxisHomePosition = DEVICE.GetDevice<IoSensor>($"PM1.SensorWaferRobotEX2AxisHomePosition");
- this.OnDeviceAlarmStateChanged += OnModuleDeviceAlarmStateChanged;
- }
- public void OnModuleDeviceAlarmStateChanged(string deviceId, AlarmEventItem alarmItem)
- {
- if (alarmItem.IsTriggered)
- {
- EventLevel level = alarmItem.Level;
- _triggeredAlarmList.Add(alarmItem);
- if (level == EventLevel.Alarm)
- {
- try
- {
- EV.PostAlarmLog(Module, alarmItem);
- }
- catch (Exception ex)
- {
- EV.WriteEvent(ex.Message.ToString());
- }
- }
- else
- {
- EV.PostWarningLog(Module, alarmItem);
- }
- }
- else
- {
- }
- }
- public void Stop()
- {
- FIMSDevice.Stop();
- return;
- }
- }
- }
|