Esempio n. 1
0
        /// <summary>
        /// Creates a new <see cref="FrequencyDefinition"/> from the specified parameters.
        /// </summary>
        /// <param name="parent">The <see cref="ConfigurationCell"/> parent of this <see cref="FrequencyDefinition"/>.</param>
        /// <param name="entryValue">The entry value from the INI based configuration file.</param>
        public FrequencyDefinition(ConfigurationCell parent, string entryValue)
            : base(parent)
        {
            string[] entry = entryValue.Split(',');
            FrequencyDefinition defaultFrequency;

            if (parent != null)
                defaultFrequency = parent.Parent.DefaultFrequency;
            else
                defaultFrequency = new FrequencyDefinition(null as ConfigurationCell);

            // First entry is an F - we just ignore this
            if (entry.Length > 1)
                ScalingValue = uint.Parse(entry[1].Trim());
            else
                ScalingValue = defaultFrequency.ScalingValue;

            if (entry.Length > 2)
                Offset = double.Parse(entry[2].Trim());
            else
                Offset = defaultFrequency.Offset;

            if (entry.Length > 3)
                DfDtScalingValue = uint.Parse(entry[3].Trim());
            else
                DfDtScalingValue = defaultFrequency.DfDtScalingValue;

            if (entry.Length > 4)
                DfDtOffset = double.Parse(entry[4].Trim());
            else
                DfDtOffset = defaultFrequency.DfDtOffset;

            if (entry.Length > 5)
                m_dummy = int.Parse(entry[5].Trim());
            else
                m_dummy = defaultFrequency.m_dummy;

            if (entry.Length > 6)
                Label = entry[6].Trim();
            else
                Label = defaultFrequency.Label;
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a new <see cref="FrequencyValue"/> from specified parameters.
 /// </summary>
 /// <param name="parent">The <see cref="DataCell"/> parent of this <see cref="FrequencyValue"/>.</param>
 /// <param name="frequencyDefinition">The <see cref="FrequencyDefinition"/> associated with this <see cref="FrequencyValue"/>.</param>
 /// <param name="frequency">The floating point value that represents this <see cref="FrequencyValue"/>.</param>
 /// <param name="dfdt">The floating point value that represents the change in this <see cref="FrequencyValue"/> over time.</param>
 public FrequencyValue(DataCell parent, FrequencyDefinition frequencyDefinition, double frequency, double dfdt)
     : base(parent, frequencyDefinition, frequency, dfdt)
 {
 }
Esempio n. 3
0
        // Delegate handler to create a new BPA PDCstream frequency definition
        internal static IFrequencyDefinition CreateNewDefinition(IConfigurationCell parent, byte[] binaryImage, int startIndex, out int parsedLength)
        {
            IFrequencyDefinition frequencyDefinition = new FrequencyDefinition(parent);

            parsedLength = frequencyDefinition.Initialize(binaryImage, startIndex, 0);

            return frequencyDefinition;
        }