private async Task StopHvModule() { IsCommunicating = true; UpdateHv().SafeFireAndForget(onException: ex => Debug.WriteLine(ex)); await Task.Run(() => { try { LaccSerialControl.SetHvMoudle(false); IsHvModuleOn = false; } catch (TimeoutException e) { Trace.WriteLine(e.Message); StopCommunicationCommand.Execute(null); IsSerialOpen = false; } finally { UpdateAllParams(); IsCommunicating = false; IsHvModuleOn = false; } }); }
private async Task StopFpga() { await Task.Run(() => { IsCommunicating = true; try { LaccSerialControl.SetFPGA(false); } catch (TimeoutException e) { Trace.WriteLine(e.Message); StopCommunicationCommand.Execute(null); IsSerialOpen = false; } UpdateAllParams(); IsCommunicating = false; }); }