예제 #1
0
파일: DataCell.cs 프로젝트: avs009/gsf
        /// <summary>
        /// Creates a new <see cref="DataCell"/> from specified parameters.
        /// </summary>
        /// <param name="parent">The reference to parent <see cref="DataFrame"/> of this <see cref="DataCell"/>.</param>
        /// <param name="configurationCell">The <see cref="ConfigurationCell"/> associated with this <see cref="DataCell"/>.</param>
        /// <param name="addEmptyValues">If <c>true</c>, adds empty values for each defined configuration cell definition.</param>
        public DataCell(DataFrame parent, ConfigurationCell configurationCell, bool addEmptyValues)
            : this(parent, configurationCell)
        {
            if (addEmptyValues)
            {
                int x;

                // Define needed phasor values
                for (x = 0; x < configurationCell.PhasorDefinitions.Count; x++)
                {
                    PhasorValues.Add(new PhasorValue(this, configurationCell.PhasorDefinitions[x]));
                }

                // Define a frequency and df/dt
                FrequencyValue = new FrequencyValue(this, configurationCell.FrequencyDefinition);
            }
        }
예제 #2
0
        /// <summary>
        /// Creates a new <see cref="ConfigurationFrame"/>.
        /// </summary>
        /// <param name="onlineDataFormatFlags">Online data format flags to use in this Macrodyne <see cref="ConfigurationFrame"/>.</param>
        /// <param name="unitID">8 character unit ID to use in this Macrodyne <see cref="ConfigurationFrame"/>.</param>
        /// <remarks>
        /// This constructor is used by a consumer to generate a Macrodyne configuration frame.
        /// </remarks>
        public ConfigurationFrame(OnlineDataFormatFlags onlineDataFormatFlags, string unitID)
            : base(0, new ConfigurationCellCollection(), 0, 0)
        {
            m_onlineDataFormatFlags = onlineDataFormatFlags;

            ConfigurationCell configCell = new ConfigurationCell(this);

            // Assign station name
            configCell.StationName = unitID;

            // Add a single frequency definition
            configCell.FrequencyDefinition = new FrequencyDefinition(configCell, "Line frequency");

            // Add phasors based on online format flags
            for (int i = 0; i < PhasorCount; i++)
            {
                configCell.PhasorDefinitions.Add(new PhasorDefinition(configCell, "Phasor " + (i + 1), PhasorType.Voltage, null));
            }

            // Macrodyne protocol sends data for one device
            Cells.Add(configCell);
        }
예제 #3
0
 /// <summary>
 /// Creates a new <see cref="FrequencyDefinition"/> from specified parameters.
 /// </summary>
 /// <param name="parent">The <see cref="ConfigurationCell"/> parent of this <see cref="FrequencyDefinition"/>.</param>
 /// <param name="label">The label of this <see cref="FrequencyDefinition"/>.</param>
 public FrequencyDefinition(ConfigurationCell parent, string label)
     : base(parent, label, 1000, 100, 0.0D)
 {
 }
예제 #4
0
 /// <summary>
 /// Creates a new <see cref="PhasorDefinition"/> from specified parameters.
 /// </summary>
 /// <param name="parent">The <see cref="ConfigurationCell"/> parent of this <see cref="PhasorDefinition"/>.</param>
 /// <param name="label">The label of this <see cref="PhasorDefinition"/>.</param>
 /// <param name="type">The <see cref="PhasorType"/> of this <see cref="PhasorDefinition"/>.</param>
 /// <param name="voltageReference">The associated <see cref="IPhasorDefinition"/> that represents the voltage reference (if any).</param>
 public PhasorDefinition(ConfigurationCell parent, string label, PhasorType type, PhasorDefinition voltageReference)
     : base(parent, label, 1, 0.0D, type, voltageReference)
 {
 }
예제 #5
0
 /// <summary>
 /// Creates a new <see cref="DigitalDefinition"/> from specified parameters.
 /// </summary>
 /// <param name="parent">The <see cref="ConfigurationCell"/> parent of this <see cref="DigitalDefinition"/>.</param>
 /// <param name="label">The label of this <see cref="DigitalDefinition"/>.</param>
 public DigitalDefinition(ConfigurationCell parent, string label)
     : base(parent, label)
 {
 }