Example #1
0
        public override IDeviceSource[] OnGetDeviceSources()
        {
            List <IDeviceSource> list = new List <IDeviceSource>();

            DataTable tbl = DBI.Instance.ExecuteLYR001DeviceDataTable();

            foreach (DataRow row in tbl.Rows)
            {
                LYR001DeviceSource item = new LYR001DeviceSource(row);
                list.Add(item);
            }
            return(list.ToArray());
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="deviceSource"></param>
        /// <returns></returns>
        public override IDevice OnCreate(IDeviceSource deviceSource)
        {
            LYR001DeviceSource source = (LYR001DeviceSource)deviceSource;
            LYR001Device       d      = new LYR001Device();

            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;
            d.HtmMode      = HeatTransferMode.Parse(source.HtmModeValue);
            d.Pickers      = Dpu.OperaFactory.CreatePickers(this.Dpu.DeviceType.Type.Name);

            //d.DeviceDataManager.Last = new LYR001Data();
            return(d);
        }