Exemplo n.º 1
0
Arquivo: Class1.cs Projeto: wpmyj/c3
        public DeviceType GetDeviceType()
        {
            DeviceType r = DeviceTypeManager.GetDeviceType("TDevice");

            if (r == null)
            {
                //r = new DeviceType();
                //r.Name = "TDevice";
                //r.Type = typeof(TDevice);
                DeviceType t = DeviceTypeManager.AddDeviceType("TDevice", typeof(TDevice));
                //DeviceTypeManager.Add(t);
                r = t;
            }
            return(r);
        }
Exemplo n.º 2
0
Arquivo: Class1.cs Projeto: wpmyj/c3
        public XGDpu()
        {
            this.Name                 = "XDDpu";
            this.DeviceFactory        = new XGDeviceFactory(this);
            this.DevicePersister      = new XGDevicePersister();
            this.DeviceSourceProvider = new XGDeviceSourceProvider();
            this.DeviceType           = DeviceTypeManager.AddDeviceType(
                "XGDevice",
                typeof(XGDevice));
            this.DeviceUI  = new DeviceUI(this);
            this.Processor = new XGDeviceProcessor();

            string path = PathUtils.GetAssemblyDirectory(typeof(XGDevice).Assembly);

            this.TaskFactory  = new XmlTaskFactory(this, path);
            this.OperaFactory = new XmlOperaFactory(path);
        }
Exemplo n.º 3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded    = context => false;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });


            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            var configurationLoader = new MightyConfigurationLoader(Configuration, LoggerFactory);

            services.AddSingleton(configurationLoader.Load());
            services.AddSingleton(DeviceTypeManager.Load());
        }
Exemplo n.º 4
0
Arquivo: Class1.cs Projeto: wpmyj/c3
        public Scl9Dpu()
        {
            this.Name                 = "Scl9Dpu";
            this.DeviceFactory        = new Scl9Factory(this);
            this.DevicePersister      = new Scl9Persister(DBI.Instance);
            this.DeviceSourceProvider = new SimpleDeviceSourceProvider(DBI.Instance, typeof(Scl9));
            this.DeviceType           = DeviceTypeManager.AddDeviceType(
                "Scl9",
                typeof(Scl9));
            this.DeviceUI  = new DeviceUI(this);
            this.Processor = new Scl9Processor();

            string path = PathUtils.GetAssemblyDirectory(typeof(Scl9).Assembly);

            this.TaskFactory  = new XmlTaskFactory(this, path);
            this.OperaFactory = new XmlOperaFactory(path);
        }
Exemplo n.º 5
0
        public VGate100Dpu()
        {
            this.Name                 = "VGate100Dpu";
            this.DeviceFactory        = new VGate100Factory(this);
            this.DevicePersister      = new VGate100Persister(DBI.Instance);
            this.DeviceSourceProvider = //new VGate100SourceProvider();
                                        new SimpleDeviceSourceProvider(DBI.Instance, typeof(VGate100));
            this.DeviceType = DeviceTypeManager.AddDeviceType(
                "VGate100",
                typeof(VGate100));
            this.DeviceUI  = new DeviceUI(this);
            this.Processor = new VGate100Processor();

            string path = PathUtils.GetAssemblyDirectory(typeof(VGate100).Assembly);

            this.TaskFactory  = new XmlTaskFactory(this, path);
            this.OperaFactory = new XmlOperaFactory(path);
        }
Exemplo n.º 6
0
        public Data7203Dpu()
        {
            this.Name                 = "Data7203Dpu";
            this.DeviceFactory        = new Data7203Factory(this);
            this.DevicePersister      = new Data7203Persister(DBI.Instance);
            this.DeviceSourceProvider = //new Data7203SourceProvider();
                                        new SimpleDeviceSourceProvider(DBI.Instance, typeof(Data7203));
            this.DeviceType = DeviceTypeManager.AddDeviceType(
                "Data7203",
                typeof(Data7203));
            this.DeviceUI  = new DeviceUI(this);
            this.Processor = new Data7203Processor();

            string path = PathUtils.GetAssemblyDirectory(typeof(Data7203).Assembly);

            this.TaskFactory  = new XmlTaskFactory(this, path);
            this.OperaFactory = new XmlOperaFactory(path);
        }
Exemplo n.º 7
0
        public XD1100Dpu()
        {
            this.Name = "XD1100Dpu";
            this.DeviceFactory = new XD1100DeviceFactory (this);
            this.DevicePersister = new XD1100DevicePersister ();
            this.DeviceSourceProvider = new XD1100DeviceSourceProvider ();
            this.DeviceType = DeviceTypeManager.AddDeviceType(
                    "XD1100Device",
                    typeof(XD1100Device));
            this.DeviceUI = new DeviceUI(this);
            this.Processor = new XD1100DeviceProcessor();

            string path = PathUtils.GetAssemblyDirectory(typeof(XD1100Device).Assembly);
            this.TaskFactory = new XmlTaskFactory(this, path);
            this.OperaFactory = new XmlOperaFactory(path);
            this.UIEntry = new UIEntry();

            // TODO: init outside temperature provider manager
            //
            SoftManager.GetSoft().HardwareCreated += new EventHandler(XD1100Dpu_HardwareCreated);
        }
Exemplo n.º 8
0
 public DeviceAppService(
     DeviceManager deviceManager,
     DeviceTypeManager deviceTypeManager,
     NodeManager nodeManager,
     TenantManager tenantManager,
     IRepository <Device> deviceRepository,
     IRepository <Tenant> tenantRepository,
     IRepository <DeviceType> deviceTypeRepository,
     IRepository <DealRecord> dealRecordRepository,
     IRepository <Area> areaRepository, DeviceStockManager deviceStockManager)
 {
     _deviceRepository     = deviceRepository;
     _deviceManager        = deviceManager;
     _deviceTypeManager    = deviceTypeManager;
     _nodeManager          = nodeManager;
     _tenantManager        = tenantManager;
     _tenantRepository     = tenantRepository;
     _deviceTypeRepository = deviceTypeRepository;
     _dealRecordRepository = dealRecordRepository;
     _areaRepository       = areaRepository;
     _deviceStockManager   = deviceStockManager;
 }
Exemplo n.º 9
0
 public DevicesController(Configuration configuration, DeviceTypeManager deviceTypeManager, ILoggerFactory loggerFactory)
 {
     Devices           = configuration.Devices.ToDictionary(device => device.Id);
     DeviceTypeManager = deviceTypeManager;
     Logger            = loggerFactory.CreateLogger <DevicesController>();
 }
Exemplo n.º 10
0
Arquivo: Class1.cs Projeto: wpmyj/c3
 public Xd202()
 {
     this.DeviceType = DeviceTypeManager.AddDeviceType("Xd202", typeof(Xd202));
 }
Exemplo n.º 11
0
Arquivo: Class1.cs Projeto: wpmyj/c3
 public HDDevice()
 {
     this.DeviceType = DeviceTypeManager.AddDeviceType("HDDevice", typeof(HDDevice));
 }