|
@@ -1,17 +1,19 @@
|
|
|
using Aitex.Core.RT.Device;
|
|
|
using Aitex.Core.Util;
|
|
|
using MECF.Framework.Common.Equipment;
|
|
|
+using MECF.Framework.Common.ToolLayout;
|
|
|
using PunkHPX8_RT.Devices.AXIS;
|
|
|
using PunkHPX8_RT.Devices.SRD;
|
|
|
+using PunkHPX8_RT.Devices.VpwCell;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
-namespace PunkHPX8_RT.Devices.VpwCell
|
|
|
+namespace PunkHPX8_RT.Devices.VpwMain
|
|
|
{
|
|
|
- public class VpwCellDeviceTimer : BaseDevice, IDevice
|
|
|
+ public class VpDeviceTimer : BaseDevice, IDevice
|
|
|
{
|
|
|
#region 常量
|
|
|
private const string VPW = "Vpw";
|
|
@@ -19,14 +21,14 @@ namespace PunkHPX8_RT.Devices.VpwCell
|
|
|
|
|
|
#region 内部变量
|
|
|
private PeriodicJob _periodicJob;
|
|
|
- private JetAxisBase _vpw1RotationAxis;
|
|
|
- private JetAxisBase _vpw2RotationAxis;
|
|
|
+ private VpwMainDevice _vpwMainDevice;
|
|
|
+ private VpwCellDevice[] _vpwCellDevices;
|
|
|
|
|
|
#endregion
|
|
|
/// <summary>
|
|
|
/// 构造函数
|
|
|
/// </summary>
|
|
|
- public VpwCellDeviceTimer() : base(VPW, VPW, VPW, VPW)
|
|
|
+ public VpDeviceTimer() : base(VPW, VPW, VPW, VPW)
|
|
|
{
|
|
|
_periodicJob = new PeriodicJob(20, OnTimer, $"{VPW}.OnTimer", false);
|
|
|
}
|
|
@@ -36,11 +38,16 @@ namespace PunkHPX8_RT.Devices.VpwCell
|
|
|
/// <returns></returns>
|
|
|
public bool Initialize()
|
|
|
{
|
|
|
-
|
|
|
- _vpw1RotationAxis = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.VPW1}.Rotation");
|
|
|
-
|
|
|
- _vpw2RotationAxis = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.VPW2}.Rotation");
|
|
|
-
|
|
|
+ if (ModuleHelper.IsInstalled(ModuleName.VPWMain1))
|
|
|
+ {
|
|
|
+ _vpwMainDevice=DEVICE.GetDevice<VpwMainDevice>(ModuleName.VPWMain1.ToString());
|
|
|
+ }
|
|
|
+ List<string> installedCells = VpwCellItemManager.Instance.InstalledModules;
|
|
|
+ _vpwCellDevices=new VpwCellDevice[installedCells.Count];
|
|
|
+ for (int i=0;i<_vpwCellDevices.Length;i++)
|
|
|
+ {
|
|
|
+ _vpwCellDevices[i] = DEVICE.GetDevice<VpwCellDevice>(installedCells[i]);
|
|
|
+ }
|
|
|
_periodicJob.Start();
|
|
|
return true;
|
|
|
}
|
|
@@ -62,16 +69,14 @@ namespace PunkHPX8_RT.Devices.VpwCell
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
private bool OnTimer()
|
|
|
- {
|
|
|
-
|
|
|
- if (_vpw1RotationAxis != null)
|
|
|
- {
|
|
|
- _vpw1RotationAxis.OnTimer();
|
|
|
+ {
|
|
|
+ if (_vpwMainDevice != null)
|
|
|
+ {
|
|
|
+ _vpwMainDevice.OnTimer();
|
|
|
}
|
|
|
-
|
|
|
- if (_vpw2RotationAxis != null)
|
|
|
- {
|
|
|
- _vpw2RotationAxis.OnTimer();
|
|
|
+ foreach(var item in _vpwCellDevices)
|
|
|
+ {
|
|
|
+ item.OnTimer();
|
|
|
}
|
|
|
return true;
|
|
|
}
|