示例#1
0
文件: Class1.cs 项目: wpmyj/c3
        public override IDeviceSource[] OnGetDeviceSources()
        {
            List <IDeviceSource> list = new List <IDeviceSource>();

            DataTable tbl = DBI.Instance.ExecuteHDDeviceDataTable();

            foreach (DataRow row in tbl.Rows)
            {
                HDDeviceSource item = new HDDeviceSource(row);
                list.Add(item);
            }
            return(list.ToArray());
        }
示例#2
0
文件: Class1.cs 项目: wpmyj/c3
        public override IDevice OnCreate(IDeviceSource deviceSource)
        {
            HDDeviceSource source = (HDDeviceSource)deviceSource;

            HDDevice d = new HDDevice();

            d.Address      = source.Address;
            d.Name         = source.DeviceName;
            d.DeviceSource = source;
            d.DeviceType   = this.Dpu.DeviceType;
            d.Dpu          = this.Dpu;
            d.Guid         = source.Guid;
            d.StationGuid  = source.StationGuid;

            return(d);
        }