Exemplo n.º 1
0
        /// <summary>
        ///     Builds an instance of <see cref="AomDeviceContextEntity" />
        ///     Строит AOM контекст сущность (см. AOM паттерн)
        /// </summary>
        /// <returns>
        ///     Built instance of <see cref="AomDeviceContextEntity" />
        /// </returns>
        public AomDeviceContextEntity Build()
        {
            var result = new AomDeviceContextEntity
            {
                DeviceName        = this._deviceName,
                DeviceType        = this._deviceType,
                DeviceDescription = this._deviceDescription,
                AnalogMeterType   = _analogMeterType,
                RelatedDriverId   = _driverId,
                TransformKoefA    = _transformKoefA,
                TransformKoefB    = _transformKoefB,
                TransformKoefC    = _transformKoefC,
            };

            result.CustomDeviceSchemeTable = new CustomDeviceSchemeTable();
            if (_customFiders.Count > 0)
            {
                _customFiders.ForEach((fider => result.CustomDeviceSchemeTable.FidersTable.AddObject(fider)));
            }
            if (_customIndicators.Count > 0)
            {
                _customIndicators.ForEach((ind => result.CustomDeviceSchemeTable.IndicatorsTable.AddObject(ind)));
            }
            if (_customSignals.Count > 0)
            {
                _customSignals.ForEach((signal => result.CustomDeviceSchemeTable.SignalsTable.AddObject(signal)));
            }
            if (_cascadeIndicators.Count > 0)
            {
                _cascadeIndicators.ForEach((cascade => result.CustomDeviceSchemeTable.CascadeIndicatorsTable.AddObject(cascade)));
            }


            return(result);
        }
Exemplo n.º 2
0
 /// <summary>
 ///     Creates an instance of <see cref="AomDeviceContextEntity" />
 /// </summary>
 public AomDeviceContextEntity()
     : base(AomDeviceContextEntity.CreateTypeMetadata())
 {
 }