/// <summary> /// Generic state change request that represents the P-ROC's PRDriverUpdateState function /// </summary> /// <param name="newState"></param> public void UpdateState(DriverState newState) { // Copy the newState object to the current local state this._state.DriverNum = newState.DriverNum; this._state.OutputDriveTime = newState.OutputDriveTime; this._state.PatterEnable = newState.PatterEnable; this._state.PatterOffTime = newState.PatterOffTime; this._state.PatterOnTime = newState.PatterOnTime; this._state.Polarity = newState.Polarity; this._state.State = newState.State; this._state.Timeslots = newState.Timeslots; this._state.WaitForFirstTimeSlot = newState.WaitForFirstTimeSlot; if (!newState.State) { this.Disable(); } else if (newState.Timeslots == 0) { this.Pulse(newState.OutputDriveTime); } else { this.Schedule(newState.Timeslots, newState.OutputDriveTime, newState.WaitForFirstTimeSlot); } }
public void reconfigure(bool polarity) { DriverState state = this.State; state.Polarity = polarity; this.proc.driver_update_state(ref state); }
public void driver_update_state(ref DriverState driver) { lock (procSyncObject) { PinProc.PRDriverUpdateState(ProcHandle, ref driver); } }
public DriverState DriverStateFuturePulse(DriverState state, byte milliseconds, UInt16 futureTime) { lock (procSyncObject) { PinProc.PRDriverStateFuturePulse(ref state, milliseconds, futureTime); } return(state); }
public DriverState DriverStatePulse(DriverState state, byte milliseconds) { lock (procSyncObject) { PinProc.PRDriverStatePulse(ref state, milliseconds); } return(state); }
public DriverState DriverStateDisable(DriverState state) { lock (procSyncObject) { PinProc.PRDriverStateDisable(ref state); } return(state); }
public DriverState driver_state_schedule(DriverState state, uint schedule, byte seconds, bool now) { lock (procSyncObject) { PinProc.PRDriverStateSchedule(ref state, schedule, seconds, now); } return(state); }
public DriverState DriverStatePatter(DriverState state, ushort milliseconds_on, ushort milliseconds_off, ushort original_on_time) { lock (procSyncObject) { PinProc.PRDriverStatePatter(ref state, milliseconds_on, milliseconds_off, original_on_time); } return(state); }
public DriverState DriverStatePulsedPatter(DriverState state, ushort milliseconds_on, ushort milliseconds_off, ushort milliseconds_overall_patter_time) { lock (procSyncObject) { PinProc.PRDriverStatePulsedPatter(ref state, milliseconds_on, milliseconds_off, milliseconds_overall_patter_time); } return(state); }
public DriverState DriverGetState(ushort number) { DriverState ds = new DriverState(); lock (procSyncObject) { PinProc.PRDriverGetState(ProcHandle, (byte)number, ref ds); } return(ds); }
public void DriverPulsedPatter(ushort number, ushort milliseconds_on, ushort milliseconds_off, ushort milliseconds_overall_patter_time) { DriverState state = this.DriverGetState(number); lock (procSyncObject) { PinProc.PRDriverStatePulsedPatter(ref state, milliseconds_on, milliseconds_off, milliseconds_overall_patter_time); PinProc.PRDriverUpdateState(ProcHandle, ref state); PinProc.PRFlushWriteData(ProcHandle); } }
public void DriverDisable(ushort number) { DriverState state = this.DriverGetState(number); lock (procSyncObject) { PinProc.PRDriverStateDisable(ref state); PinProc.PRDriverUpdateState(ProcHandle, ref state); PinProc.PRFlushWriteData(ProcHandle); } }
public void DriverSchedule(ushort number, uint schedule, ushort cycle_seconds, bool now) { DriverState state = this.DriverGetState(number); lock (procSyncObject) { PinProc.PRDriverStateSchedule(ref state, schedule, (byte)cycle_seconds, now); PinProc.PRDriverUpdateState(ProcHandle, ref state); PinProc.PRFlushWriteData(ProcHandle); } }
public VirtualDriver(IProcDevice proc, string name, ushort number, bool polarity) : base(proc, name, number) { this._state = new DriverState(); this._state.Polarity = polarity; this._state.Timeslots = 0x0; this._state.PatterEnable = false; this._state.DriverNum = number; this._state.PatterOnTime = 0; this._state.PatterOffTime = 0; this._state.State = false; this._state.OutputDriveTime = 0; this._state.WaitForFirstTimeSlot = false; this._currentValue = !(_currentState ^ this._state.Polarity); }
public Result DriverPulse(ushort number, byte milliseconds) { DriverState state = this.DriverGetState(number); Result res; lock (procSyncObject) { PinProc.PRDriverStatePulse(ref state, milliseconds); res = PinProc.PRDriverUpdateState(ProcHandle, ref state); } if (res == Result.Success) { lock (procSyncObject) { res = PinProc.PRDriverWatchdogTickle(ProcHandle); res = PinProc.PRFlushWriteData(ProcHandle); } } return(res); }
public static extern void PRDriverStateDisable(ref DriverState state);
public static extern void PRDriverStatePulse(ref DriverState state, byte milliseconds);
public static extern void PRDriverStatePulsedPatter(ref DriverState state, UInt16 millisecondsOn, UInt16 millisecondsOff, UInt16 patterTime);
public static extern void PRDriverStateSchedule(ref DriverState state, UInt32 schedule, byte cycleSeconds, bool now);
public static extern Result PRDriverUpdateState(IntPtr handle, ref DriverState driverState);
public DriverState DriverStateFuturePulse(DriverState state, byte milliseconds, ushort futureTime) { return(state); }
public DriverState DriverStatePatter(DriverState state, ushort milliseconds_on, ushort milliseconds_off, ushort original_on_time) { return(state); }
public DriverState DriverStatePulse(DriverState state, byte milliseconds) { return(state); }
public DriverState DriverStatePulsedPatter(DriverState state, ushort milliseconds_on, ushort milliseconds_off, ushort milliseconds_overall_patter_time) { return(state); }
public DriverState driver_state_schedule(DriverState state, uint schedule, byte seconds, bool now) { return(state); }
public void driver_update_state(ref DriverState driver) { this.drivers[driver.DriverNum].State = driver; }
public static extern void PRDriverStatePatter(ref DriverState state, UInt16 millisecondsOn, UInt16 millisecondsOff, UInt16 originalOnTime);
public DriverState DriverStateDisable(DriverState state) { return(state); }
public static extern Result PRDriverGetState(IntPtr handle, byte driverNum, ref DriverState driverState);
public static extern void PRDriverStateFuturePulse(ref DriverState state, UInt16 milliseconds, UInt16 futureTime);