public async Task DoWork() { Console.WriteLine(_infr.TmUserInfo?.Name); Console.WriteLine(await _api.GetSystemTimeString()); var ts = new TmStatus(20, 1, 1); var ti = new TmAnalog(20, 1, 1); await _api.UpdateTagPropertiesAndClassData(ts); await _api.UpdateStatus(ts); await _api.UpdateTagPropertiesAndClassData(ti); await _api.UpdateAnalog(ti); Console.WriteLine(ts); Console.WriteLine(ti); Console.WriteLine("Активные уставки:"); var alarms = await _api.GetPresentAlarms(); alarms?.ForEach(alarm => Console.WriteLine($"{alarm.FullName}, {alarm.StateName}")); Console.WriteLine("Активные АПС:"); var aps = await _api.GetPresentAps(); aps?.ForEach(Console.WriteLine); Console.WriteLine("Монитор тревог:"); var alerts = await _api.GetAlertsWithAnalogMicroSeries(); alerts?.ForEach(alert => Console.WriteLine($"{alert.Name}, {alert.ImportanceAlias}, {alert.CurrentValueString}")); }
public async Task <IActionResult> ShowTs(string id) { if (!TmAddr.TryParse(id, out var tmAddr, TmType.Status)) { return(NotFound()); } var tmStatus = new TmStatus(tmAddr); await Task.WhenAll(_api.UpdateTagPropertiesAndClassData(tmStatus), _api.UpdateStatus(tmStatus)); return(Ok(_mapper.Map <TmStatusDto>(tmStatus))); }
public async Task DoWork() { Tms.PrintDebug(_infr.TmUserInfo?.Name); Tms.PrintDebug(await _api.GetSystemTimeString()); var ts = new TmStatus(20, 1, 1); var ti = new TmAnalog(20, 1, 1); await _api.UpdateTagPropertiesAndClassData(ts); await _api.UpdateStatus(ts); await _api.UpdateTagPropertiesAndClassData(ti); await _api.UpdateAnalog(ti); Tms.PrintDebug(ts); Tms.PrintDebug(ti); }
public async Task DoWork() { Console.WriteLine(_infr.TmUserInfo?.Name); Console.WriteLine(await _api.GetSystemTimeString()); var ts = new TmStatus(20, 1, 1); var ti = new TmAnalog(20, 1, 1); await _api.UpdateTagPropertiesAndClassData(ts); await _api.UpdateStatus(ts); await _api.UpdateTagPropertiesAndClassData(ti); await _api.UpdateAnalog(ti); Console.WriteLine(ts); Console.WriteLine(ti); }