/// <summary> /// Ctor /// </summary> /// <param name="fuelPumpManager"></param> /// <param name="saleManager"></param> /// <param name="fuelPrepayManager"></param> /// <param name="propaneManager"></param> /// <param name="unCompletePrepayManager"></param> /// <param name="tierLevelManager"></param> public FuelPumpController(IFuelPumpManager fuelPumpManager, ISaleManager saleManager, IFuelPrepayManager fuelPrepayManager, IPropaneManager propaneManager, IUnCompletePrepayManager unCompletePrepayManager, ITierLevelManager tierLevelManager) { _fuelPumpManager = fuelPumpManager; _saleManager = saleManager; _fuelPrepayManager = fuelPrepayManager; _propaneManager = propaneManager; _unCompletePrepayManager = unCompletePrepayManager; _tierLevelManager = tierLevelManager; }
private void ReadDataFromUdpPort() { _fuelPumpManager = GetFuelPumpManagerObject(); try { try { UDPAgent.Instance.OpenPort(); } catch (Exception ex) { } try { string strPacket = UDPAgent.Instance.ReceiveData(); _pumplog.Debug(strPacket); var msg = _fuelPumpManager.ReadUdp(strPacket); if (msg != null) { var hubContext = GlobalHost.ConnectionManager.GetHubContext <PumpStatusHub>(); var camelCaseFormatter = new JsonSerializerSettings(); camelCaseFormatter.ContractResolver = new CamelCasePropertyNamesContractResolver(); var json = JsonConvert.SerializeObject(msg, camelCaseFormatter); _pumplog.Debug(json); hubContext.Clients.All.readUdpData(json); _pumplog.Debug("Data populated"); // WriteUDPData("ReadDataFromUdpPort " + msg.Pumps[2].BasketButtonCaption); //_customlog.Info("UDPREADDATA" + json); // WriteLog11("abc1", json); } } catch (Exception ex) { } } catch (Exception ex) { WriteToLogFile("SignalR Exception Message: " + ex.Message); WriteToLogFile("SignalR Exception StackTrace: " + ex.StackTrace); } }
/// <summary> /// Ctor /// </summary> /// <param name="fuelPumpManager"></param> public FuelPriceController(IFuelPumpManager fuelPumpManager) { _fuelPumpManager = fuelPumpManager; }