Esempio n. 1
0
 public AxisManager()
 {
     foreach (var mem in ConfigManager.Instance.HardWareConfigrationMuster.PhysicalAxisConfigs)
     {
         if (!mem.Enable)
         {
             continue;
         }
         AxisDevice.Motor motor;
         if (m_AxisDevices.ContainsKey(mem.DeviceName))
         {
             //show error info in this place
             continue;
         }
         foreach (var motioncard in MotionCardManager.Instance.MotionCards)
         {
             HardwareBase hardwareBase = (HardwareBase)motioncard.Value;
             if (hardwareBase.Guid == mem.BindDeviceGuid)
             {
                 motor = new AxisDevice.StepMotor(motioncard.Value, (uint)mem.AxisIndex, mem.DeviceName, mem.Guid);
                 m_AxisDevices.Add(mem.DeviceName, motor);
             }
         }
     }
 }
Esempio n. 2
0
 public IoDeviceManager()
 {
     foreach (var mem in ConfigManager.Instance.HardWareConfigrationMuster.SingleIoDeviceConfigs)
     {
         if (!mem.Enable)
         {
             continue;
         }
         IOBaseDevice.SingleIoDevice singleIoDevice;
         if (m_IoDevices.ContainsKey(mem.DeviceName))
         {
             //show error info in this place
             continue;
         }
         foreach (var iocard in IoCardManager.Instance.IoCards)
         {
             HardwareBase hardwareBase = (HardwareBase)iocard.Value;
             if (hardwareBase.Guid == mem.BindDeviceGuid)
             {
                 singleIoDevice = new IOBaseDevice.SingleIoDevice(iocard.Value, mem.IsInput, mem.IoIndex, mem.DeviceName, mem.Guid);
                 m_IoDevices.Add(mem.DeviceName, singleIoDevice);
             }
         }
     }
 }