//public DriverInterface(string OASServiceNode, string LiveDataCloudNode, int PortNumber, string MachineName, bool StoreAndForward, string UserName, string Password, string DeviceType, RegisterHeadSettings rh) //{ // if (!InstanceFieldsInitialized) // { // InitializeInstanceFields(); // InstanceFieldsInitialized = true; // } // m_MachineName = MachineName; // m_OASDriverInterface = new OASDriverInterface.OASDriverInterface(m_DriverName, OASServiceNode, LiveDataCloudNode, PortNumber, MachineName, StoreAndForward, UserName, Password); // if(DeviceType == "MicroLoad") // { // Console.WriteLine("Loading Microload...."); // m_IpAddress = rh.IPAddress; // m_device = new IntegrationDrivers.MicroLoadUtilities(rh); // } // else if (DeviceType == "AccuLoad") // { // Console.WriteLine("Loading AccuLoad...."); // m_device = new IntegrationDrivers.AccuLoadUtilities(); // } // m_OASDriverInterface.SetDefaults(GetDefaultDriverConfig(), false); // m_OASDriverInterface.SetDefaults(GetDefaultTagConfig(), true); // m_OASDriverInterface.AddDriverInterfaceToService(GetDriverInterfaceToAdd()); // Optional, automatically add / update driver interface. // m_OASDriverInterface.AddTagsToService(GetTagsToAdd()); // Optional, automatically add / update tags. // SubscribeToEvents(); //} public DriverInterface(UDISettings uDI, RegisterHeadSettings rh, ITransloadWS transloadWS) { if (!InstanceFieldsInitialized) { InitializeInstanceFields(rh); InstanceFieldsInitialized = true; } m_MachineName = uDI.MachineName; m_OASDriverInterface = new OASDriverInterface.OASDriverInterface(m_DriverName, uDI.ServiceNode, uDI.LiveDataCloudNode, uDI.PortNumber, uDI.MachineName, uDI.StoreAndForward, uDI.Username, uDI.Password); //m_cartId = rh.CartId; if (rh.DeviceType == "MicroLoad") { Console.WriteLine("Loading Microload...."); m_IpAddress = rh.IPAddress; m_device = new IntegrationDrivers.MicroLoadUtilities(rh, transloadWS); } else if (rh.DeviceType == "AccuLoad") { Console.WriteLine("Loading AccuLoad...."); m_device = new IntegrationDrivers.AccuLoadUtilities(rh); } else if (rh.DeviceType == "TopTech") { Console.WriteLine("Loading TopTech...."); } m_OASDriverInterface.SetDefaults(GetDefaultDriverConfig(), false); m_OASDriverInterface.SetDefaults(GetDefaultTagConfig(), true); m_OASDriverInterface.AddDriverInterfaceToService(GetDriverInterfaceToAdd()); // Optional, automatically add / update driver interface. m_OASDriverInterface.AddTagsToService(GetTagsToAdd()); // Optional, automatically add / update tags. SubscribeToEvents(); }
public DriverService(IOptions <UDISettings> config, IOptions <RegisterHeadSettings> registerHead, ILogger <DriverService> logger, ITransloadWS transloadWS) { _config = config.Value; _registerHead = registerHead.Value; log = logger; _transloadWS = transloadWS; }
public MicroLoadUtilities(RegisterHeadSettings settings, ITransloadWS transloadWS) : base() { _registerHeadSettings = settings; statusTimer = new Timer(StatusTimerRoutine, null, Timeout.Infinite, Timeout.Infinite); dynamicDisplayTimer = new Timer(DynamicDisplayTimer, null, Timeout.Infinite, Timeout.Infinite); _ws = transloadWS; }
public MainHost(ILogger <MainHost> logger, IDriverService driverService, ITransloadWS transloadWS, IOptions <UDISettings> udiSettings, IOptions <RegisterHeadSettings> registerHeadSettings) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); //_appSettings = appSettings?.Value ?? throw new ArgumentNullException(nameof(appSettings)); _driverService = driverService; _transloadWS = transloadWS; _uDISettings = udiSettings.Value; _registerHeadSettings = registerHeadSettings.Value; dom = System.AppDomain.CurrentDomain; }