Пример #1
0
        public GenericComm(DeviceConfig config)
            : base(config)
        {
            PropertiesConfig = CommFactory.GetControlPropertiesConfig(config);

            CommPort = CommFactory.CreateCommForDevice(config);
        }
Пример #2
0
        public override EssentialsDevice BuildDevice(DeviceConfig dc)
        {
            Debug.Console(1, "Factory Attempting to create new Comm Mock Device");
            var comm  = CommFactory.CreateCommForDevice(dc);
            var props = Newtonsoft.Json.JsonConvert.DeserializeObject <ConsoleCommMockDevicePropertiesConfig>(
                dc.Properties.ToString());

            return(new ConsoleCommMockDevice(dc.Key, dc.Name, props, comm));
        }
Пример #3
0
        public GenericComm(DeviceConfig config)
            : base(config)
        {
            PropertiesConfig = CommFactory.GetControlPropertiesConfig(config);

            var commPort = CommFactory.CreateCommForDevice(config);

            //Fixing decision to require '-comPorts' in delcaration for DGE in order to get a device with comports included
            if (commPort == null)
            {
                config.Key = config.Key + "-comPorts";
                commPort   = CommFactory.CreateCommForDevice(config);
            }

            CommPort = commPort;
        }