public static long PingCas(IZarizeni zarizeni) { Ping pingClient = new Ping(); IPAddress iPAddress = new IPAddress(1111); IPAddress.TryParse(zarizeni.IpAdress, out iPAddress); var respond = pingClient.Send(iPAddress); if (respond.Status != IPStatus.Success) { throw new PingNaZarizeniException($"Cannot ping to device {zarizeni.Hostname}", respond.Status); } return(respond.RoundtripTime); }
public InformacniQt(IZarizeni zarizeni, short id, IIDGenerator idGenerator, string logDirectory, IAuthenticationDataLayer authenticationDataLayer, IConfigManager configManager, IOrdersInfoService ordersInfoService, CanteenProvider canteenRepository, ScanCardLayout scanCardLayout, CardScannedLayout cardScannedLayout, TimerFactory timerFactory) : base(zarizeni, id, idGenerator, logDirectory, canteenRepository, timerFactory) { // musim predat Logger pochazeji primo z automatu, abych mel spravne zaznamenany SQL dotazy Log4Net.Core.ILogEx dbLog = this.GetDbLog(); OrdersInfoService = ordersInfoService; ordersInfoService.Initialize(dbLog); AuthenticationDataLayer = authenticationDataLayer; AuthenticationDataLayer.InitLog(dbLog); Typ = 202; CardScannedLayout = cardScannedLayout; ScanCardLayout = scanCardLayout; }