Exemple #1
0
        /// <summary>
        /// 添加回路(自动识别不会手动添加)
        /// </summary>
        public void AddChannel(string deviceId, int portNumber, DeviceTypeAggregate.PortType portType, string portDefaultName = null, DeviceTypeAggregate.OutPutType?outputType = null, bool?outputThreePhase = null, double?outputVoltage = null, bool enabled = true, string description = "", string sort = null)
        {
            var channel = _channels.Where(where => where.PortNumber == portNumber).SingleOrDefault();

            if (channel == null)
            {
                _channels.Add(new Channel(deviceId, portNumber, portType, portDefaultName, outputType, outputThreePhase, outputVoltage, enabled, description, sort));
            }
        }
Exemple #2
0
 public Channel(string deviceId, int portNumber, DeviceTypeAggregate.PortType portType, string portDefaultName = null, DeviceTypeAggregate.OutPutType?outputType = null, bool?outputThreePhase = null, double?outputVoltage = null, bool enabled = true, string description = "", string sort = null)
     : this()
 {
     this.DeviceId = deviceId;
     //this.DeviceTypeChannelId = deviceTypeChannelId;
     this.PortNumber      = portNumber;
     this.PortDefaultName = portDefaultName;
     PortType             = portType;
     //this.ChannelName = channelName;
     this.OutputType       = outputType;
     this.OutputThreePhase = outputThreePhase;
     this.OutputValue      = outputVoltage;
     this.Enabled          = enabled;
     this.Description      = description;
     Sort = sort;
 }