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> Index() { var time = await _api.GetSystemTimeString(); if (string.IsNullOrEmpty(time)) { return(StatusCode(StatusCodes.Status503ServiceUnavailable)); } return(Ok(time)); }
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); }