Inheritance: INotifyPropertyChanging, INotifyPropertyChanged
コード例 #1
0
        private static Channel ParseSeries(SeriesDefinition seriesDefinition)
        {
            Channel channel = new Channel();
            Series series = new Series();

            ChannelDefinition channelDefinition = seriesDefinition.ChannelDefinition;
            QuantityMeasured quantityMeasured = channelDefinition.QuantityMeasured;
            Phase phase = channelDefinition.Phase;

            // Populate channel properties
            channel.Name = channelDefinition.ChannelName;
            channel.HarmonicGroup = 0;
            channel.MeasurementType = new MeasurementType();
            channel.MeasurementCharacteristic = new MeasurementCharacteristic();
            channel.Phase = new Database.Phase();

            if (seriesDefinition.HasElement(SeriesDefinition.SeriesNominalQuantityTag))
                channel.PerUnitValue = seriesDefinition.SeriesNominalQuantity;

            // Populate series properties
            series.SeriesType = new SeriesType();
            series.Channel = channel;
            series.SourceIndexes = string.Empty;

            // Populate measurement type properties
            channel.MeasurementType.Name = quantityMeasured.ToString();

            // Populate characteristic properties
            channel.MeasurementCharacteristic.Name = QuantityCharacteristic.ToName(seriesDefinition.QuantityCharacteristicID) ?? seriesDefinition.QuantityCharacteristicID.ToString();
            channel.MeasurementCharacteristic.Description = QuantityCharacteristic.ToString(seriesDefinition.QuantityCharacteristicID);

            // Popuplate phase properties
            channel.Phase.Name = phase.ToString();

            // Populate series type properties
            series.SeriesType.Name = SeriesValueType.ToString(seriesDefinition.ValueTypeID) ?? seriesDefinition.ValueTypeName ?? seriesDefinition.ValueTypeID.ToString();
            series.SeriesType.Description = seriesDefinition.ValueTypeName;

            return channel;
        }
コード例 #2
0
        private Channel ParseSeries(ANLG_CHNL_NEW analogChannel)
        {
            Channel channel = new Channel();
            Series series = new Series();

            channel.Name = analogChannel.title;
            channel.HarmonicGroup = 0;
            channel.MeasurementType = new MeasurementType();
            channel.MeasurementType.Name = "Unknown";
            channel.MeasurementCharacteristic = new MeasurementCharacteristic();
            channel.MeasurementCharacteristic.Name = "Unknown";
            channel.Phase = new Phase();
            channel.Phase.Name = "Unknown";

            series.Channel = channel;
            series.SeriesType = new SeriesType();
            series.SeriesType.Name = "Instantaneous";
            series.SourceIndexes = analogChannel.chanlnum;

            return channel;
        }
コード例 #3
0
        private Channel ParseSeries(DigitalChannel digitalChannel)
        {
            Channel channel = new Channel();
            Series series = new Series();

            channel.Name = digitalChannel.ChannelName;
            channel.HarmonicGroup = 0;
            channel.MeasurementType = new MeasurementType();
            channel.MeasurementType.Name = "Digital";
            channel.MeasurementCharacteristic = new MeasurementCharacteristic();
            channel.MeasurementCharacteristic.Name = "Unknown";
            channel.Phase = new Phase();
            channel.Phase.Name = !string.IsNullOrEmpty(digitalChannel.PhaseID) ? digitalChannel.PhaseID : "Unknown";

            series.Channel = channel;
            series.SeriesType = new SeriesType();
            series.SeriesType.Name = "Values";
            series.SourceIndexes = digitalChannel.Index.ToString();

            return channel;
        }
コード例 #4
0
		private void attach_Channels(Channel entity)
		{
			this.SendPropertyChanging();
			entity.Phase = this;
		}
コード例 #5
0
		private void detach_Channels(Channel entity)
		{
			this.SendPropertyChanging();
			entity.Phase = null;
		}
コード例 #6
0
 partial void DeleteChannel(Channel instance);
コード例 #7
0
		private void detach_Channels(Channel entity)
		{
			this.SendPropertyChanging();
			entity.MeasurementType = null;
		}
コード例 #8
0
 partial void UpdateChannel(Channel instance);
コード例 #9
0
 partial void InsertChannel(Channel instance);
コード例 #10
0
		private void detach_Channels(Channel entity)
		{
			this.SendPropertyChanging();
			entity.MeasurementCharacteristic = null;
		}
コード例 #11
0
        private Channel MakeParsedDigital(CommaSeparatedEventReport report, int channelIndex)
        {
            Channel channel = new Channel();
            Series series = new Series();
            Channel<bool> digitalChannel = report.AnalogSection.DigitalChannels[channelIndex];

            channel.Name = digitalChannel.Name;
            channel.HarmonicGroup = 0;
            channel.MeasurementType = new MeasurementType();
            channel.MeasurementType.Name = "Digital";
            channel.MeasurementCharacteristic = new MeasurementCharacteristic();
            channel.MeasurementCharacteristic.Name = "Instantaneous";
            channel.Phase = new Phase();
            channel.Phase.Name = "None";

            series.Channel = channel;
            series.SeriesType = new SeriesType();
            series.SeriesType.Name = "Values";
            series.SourceIndexes = channelIndex.ToString();

            channel.MeasurementType.Description = channel.MeasurementType.Name;
            channel.MeasurementCharacteristic.Description = channel.MeasurementCharacteristic.Name;
            channel.Phase.Description = "No phase";
            series.SeriesType.Description = series.SeriesType.Name;

            return channel;
        }
コード例 #12
0
        private Channel MakeParsedAnalog(CommaSeparatedEventReport report, int channelIndex)
        {
            Channel channel = new Channel();
            Series series = new Series();
            Channel<double> analogChannel = report.AnalogSection.AnalogChannels[channelIndex];

            channel.Name = analogChannel.Name;
            channel.HarmonicGroup = 0;
            channel.MeasurementType = new MeasurementType();
            channel.MeasurementCharacteristic = new MeasurementCharacteristic();
            channel.MeasurementCharacteristic.Name = "Instantaneous";
            channel.Phase = new Phase();

            series.Channel = channel;
            series.SeriesType = new SeriesType();
            series.SeriesType.Name = "Values";
            series.SourceIndexes = channelIndex.ToString();

            switch (analogChannel.Name)
            {
                case "VA": case "VB": case "VC":
                case "VS": case "VDC": case "Freq":
                    channel.MeasurementType.Name = "Voltage";
                    break;

                case "IA": case "IB": case "IC":
                case "IN": case "IG": case "IR":
                    channel.MeasurementType.Name = "Current";
                    break;

                default:
                    channel.MeasurementType.Name = "Unknown";
                    break;
            }

            switch (analogChannel.Name)
            {
                case "VA": case "IA": case "Freq":
                    channel.Phase.Name = "AN";
                    channel.Phase.Description = "A-phase to neutral";
                    break;

                case "VB": case "IB":
                    channel.Phase.Name = "BN";
                    channel.Phase.Description = "B-phase to neutral";
                    break;

                case "VC": case "IC":
                    channel.Phase.Name = "CN";
                    channel.Phase.Description = "C-phase to neutral";
                    break;

                case "IN":
                    channel.Phase.Name = "NG";
                    channel.Phase.Description = "Neutral to ground";
                    break;

                case "IG":
                    channel.Phase.Name = "Ground";
                    channel.Phase.Description = "Ground";
                    break;

                case "IR":
                    channel.Phase.Name = "RES";
                    channel.Phase.Description = "Residual";
                    break;

                default: case "VS": case "VDC":
                    channel.Phase.Name = "Unknown";
                    channel.Phase.Description = "Unknown";
                    break;
            }

            channel.MeasurementType.Description = channel.MeasurementType.Name;
            channel.MeasurementCharacteristic.Description = channel.MeasurementCharacteristic.Name;
            series.SeriesType.Description = series.SeriesType.Name;

            return channel;
        }