Ejemplo n.º 1
0
        //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();
        }
Ejemplo n.º 2
0
 public DriverService(IOptions <UDISettings> config, IOptions <RegisterHeadSettings> registerHead, ILogger <DriverService> logger, ITransloadWS transloadWS)
 {
     _config       = config.Value;
     _registerHead = registerHead.Value;
     log           = logger;
     _transloadWS  = transloadWS;
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 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;
 }