public CylinderController(ConfigurationCylinder Config, IrixiEE0017 ControllerAttached) : base(Config) { this.Controller = ControllerAttached; this.PedalInputPort = Config.PedalInput; this.FiberClampOutputPort = Config.FiberClampOutput; this.LensVacuumOutputPort = Config.LensVacuumOutput; this.PLCVacuumOutputPort = Config.PLCVacuumOutput; this.PODVacuumOutputPort = Config.PODVacuumOutput; if (ControllerAttached != null) { // detect the input gpio of the pedal state this.Controller.OnInputStateChanged += ((s, e) => { if (e.Channel == this.PedalInputPort && e.State == InputState.Triggered) { DoPedalTriggerd(); } }); // the hid report is received, flush the cylinders' state (Output) this.Controller.OnHIDReportReceived += ((s, e) => { this.FiberClampState = e.GetOutputState(this.FiberClampOutputPort); this.LensVacuumState = e.GetOutputState(this.LensVacuumOutputPort); this.PlcVacuumState = e.GetOutputState(this.PLCVacuumOutputPort); this.PodVacuumState = e.GetOutputState(this.PODVacuumOutputPort); }); } }
public CylinderController(ConfigurationCylinder Config, IrixiM12 ControllerAttached) : base(Config) { this.Controller = ControllerAttached; this.PedalInputPort = Config.PedalInput; this.FiberClampOutputPort = Config.FiberClampOutput; this.LensVacuumOutputPort = Config.LensVacuumOutput; this.PLCVacuumOutputPort = Config.PLCVacuumOutput; this.PODVacuumOutputPort = Config.PODVacuumOutput; if (ControllerAttached != null) { ControllerAttached.OnDigitalInputUpdated += (s, e) => { if (e.Status.Integrated[PedalInputPort] == DigitalIOStatus.ON) { DoPedalTriggerd(); } }; } }