/// <summary> /// Creates a new <see cref="ConfigurationFrame"/> from specified parameters. /// </summary> /// <param name="idCode">The ID code of this <see cref="ConfigurationFrame"/>.</param> /// <param name="timestamp">The exact timestamp, in <see cref="Ticks"/>, of the data represented by this <see cref="ConfigurationFrame"/>.</param> /// <param name="frameRate">The defined frame rate of this <see cref="ConfigurationFrame"/>.</param> /// <param name="nominalFrequency">The nominal <see cref="LineFrequency"/> of this <see cref="ConfigurationFrame"/>.</param> /// <param name="timeOffset">The time offset of F-NET device in <see cref="Ticks"/>.</param> /// <param name="stationName">The station name of the F-NET device.</param> /// <remarks> /// This constructor is used by a consumer to generate an F-NET configuration frame. /// </remarks> public ConfigurationFrame(ushort idCode, Ticks timestamp, ushort frameRate, LineFrequency nominalFrequency, Ticks timeOffset, string stationName) : base(idCode, new ConfigurationCellCollection(), timestamp, frameRate) { ConfigurationCell configCell = new ConfigurationCell(this, nominalFrequency, timeOffset); // FNet protocol sends data for one device Cells.Add(configCell); // Assign station name if (string.IsNullOrEmpty(stationName)) configCell.StationName = "F-NET Unit-" + idCode; else configCell.StationName = stationName; // Add a single frequency definition configCell.FrequencyDefinition = new FrequencyDefinition(configCell, "Line frequency"); // Add a single phasor definition configCell.PhasorDefinitions.Add(new PhasorDefinition(configCell, "120V Phasor", PhasorType.Voltage, null)); }
/// <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) { }
/// <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, 1, 1, 0.0D) { }