Example #1
0
        private double GetBT1FromCRL_G(Xd100e xd100eDevice)
        {
            double r = 0d;
            /*
            foreach (IDevice device in xd100eDevice.Station.Devices)
            {
                if (device is IBT1Provider)
                {
                    IBT1Provider bt1Pro = device as IBT1Provider;
                    if (bt1Pro.BT1DataDT != DateTime.MinValue)
                    {
                        r = bt1Pro.BT1;
                    }
                }
            }
            */
            // 1. get heat kind device collection
            // 2. get device collection with place != unknown
            // 3. if device count > 1, select first device
            // 4. get device.bt1
            DeviceCollection heatDevices = xd100eDevice.Station.Devices.GetDevices(KIND);
            RemoveUnknownPlaceDevice(heatDevices);

            bool hasData = heatDevices.HasData(HasDataOption.All);
            if (hasData)
            {
                r = Calc(heatDevices, "BT", CalcType.Avg);
            }
            return r;
        }
Example #2
0
        /// <summary>
        /// get crl-g gt1 property
        /// </summary>
        /// <param name="xd100eDevice"></param>
        /// <returns></returns>
        private double GetGT1FromCRL_G(Xd100e xd100eDevice)
        {
            double r = 0d;
            DeviceCollection heatDevices = xd100eDevice.Station.Devices.GetDevices(KIND);
            RemoveUnknownPlaceDevice(heatDevices);

            bool hasData = heatDevices.HasData(HasDataOption.All);
            if (hasData)
            {
                r = Calc(heatDevices, "GT", CalcType.Avg);
            }
            return r;
        }
Example #3
0
File: Class1.cs Project: hkiaipc/C3
        /// <summary>
        /// 
        /// </summary>
        /// <param name="deviceSource"></param>
        /// <returns></returns>
        public override IDevice OnCreate(IDeviceSource deviceSource)
        {
            SimpleDeviceSource s = (SimpleDeviceSource)deviceSource;
            Xd100e d = new Xd100e();
            d.Address = s.Address;
            d.Name = s.DeviceName;
            d.DeviceSource = deviceSource;
            d.DeviceType = this.Dpu.DeviceType;
            d.Dpu = this.Dpu;
            d.Guid = s.Guid;
            d.StationGuid = s.StationGuid;

            return d;
        }