//should ask for only one refresh from the Isaac device. public override void UpdateCurrentPositionFromDevice() { if (!String.IsNullOrEmpty(ASCII_Command_GetStatus)) { DeviceComm.Send(ASCII_Command_GetStatus); } }
public override bool Enable() { State.SystemEnabled = true; if (!X_Axis.CurrentSetup.SystemEnabled.GetValueOrDefault()) { string result = DeviceComm.Send(ASCII_Command_ToggleEnable).Result; } return(true); }
private void Send_Set_AccelIncrementDelay(int?accellDelay) { string result = ""; if (accellDelay.HasValue && !String.IsNullOrEmpty(ASCII_CommandPrefix_AccelIncrementDelay)) { result = DeviceComm.Send(ASCII_CommandPrefix_AccelIncrementDelay + accellDelay).Result; } }
private void Send_Set_HomeOffset(int?homeOffset) { string result = ""; if (homeOffset.HasValue && !String.IsNullOrEmpty(ASCII_CommandPrefix_HomeOffset)) { result = DeviceComm.Send(ASCII_CommandPrefix_HomeOffset + homeOffset).Result; } }
private void Send_Set_MaxSpeed(double?maxSpeed) { string result = ""; if (maxSpeed.HasValue && !String.IsNullOrEmpty(ASCII_CommandPrefix_MaxSpeed)) { result = DeviceComm.Send(ASCII_CommandPrefix_MaxSpeed + maxSpeed).Result; } }
private void Send_Set_Invert(bool?invert) { string result = ""; if (invert.HasValue && !String.IsNullOrEmpty(ASCII_CommandPrefix_Invert)) { int val = (invert.Value)? 1 : 0; result = DeviceComm.Send(ASCII_CommandPrefix_Invert + val).Result; } }
protected async Task <bool> DoCommandIfAble(string command) { bool bOK = false; if (State.SystemEnabled.GetValueOrDefault()) { bOK = true; await DeviceComm.Send(command); } return(bOK); }
private bool Send_Command_Position(double position, bool suspendRefreshFromDevice = false) { // if ((!CurrentSetup.SystemEnabled.HasValue || CurrentSetup.SystemEnabled.Value == true) && !this.IsControlDisabled) { DeviceComm.Send(ASCII_CommandPrefix_Position + position.ToString()); //Not doing this until we can do the command queueing or blocking on the serial comm //if(!suspendRefreshFromDevice) // UpdateCurrentPositionFromDevice(); return(true); } else { return(false); } }
/// <summary> /// Auto home the axis /// </summary> public override async void Recalibrate() { string result = await DeviceComm.Send(ASCII_Command_AutoHome); UpdateCurrentPositionFromDevice(); }
public override async void UpdateCurrentPositionFromDevice() { string result2 = await DeviceComm.Send(ASCII_Command_GetStatus); }
private void UpdateCurrentSetupFromDevice() { string report = DeviceComm.Send(ASCII_Command_GetStatus).Result; UpdateCurrentSetupFromDevice(report); }