Ejemplo n.º 1
0
        /// <summary>
        /// Constuct a new DBC Signal.
        /// </summary>
        /// <param name="ecu">The parent ecu object.</param>
        /// <param name="message">The parent message object.</param>
        /// <param name="startbit">The bit index in the start byte at which this signal begins.</param>
        /// <param name="name">The name of this signal.</param>
        /// <param name="length">The number of bits in this signal.</param>
        /// <param name="def"></param>
        /// <param name="sna"></param>
        /// <param name="physMax">The physical maximum value of this signal.</param>
        /// <param name="physMin">The physical minimum value of this signal.</param>
        /// <param name="normMax"></param>
        /// <param name="normMin"></param>
        /// <param name="res"></param>
        /// <param name="units">The particular units of this signal's value.</param>
        /// <param name="descriptor"></param>
        /// <param name="order">The byteOrder of this signal (for multi-byte signals).</param>
        /// <param name="offset">The offset of the physical value.</param>
        /// <param name="line">The line in the dbc file, for debugging reasons.</param>
        public DBCSignal(DBCECU ecu, DBCMessage message, uint startbit, string name, uint length,
                         ulong def, ulong sna, double physMax, double physMin, ulong normMax, ulong normMin, double res, string units,
                         IntDescriptor descriptor, ByteOrder order, double offset, string line)
        {
            Order     = order;
            ECU       = ecu;
            Message   = message;
            this.line = line;
            StartBit  = startbit;

            Name      = name;
            BitLength = length;

            DefaultValue = def;
            SNA          = sna;

            // Range is specified
            PhysMax    = physMax;
            PhysMin    = physMin;
            NormMax    = normMax;
            NormMin    = normMin;
            Factor     = res;
            Value      = DefaultValue;
            Descriptor = descriptor;
            Offset     = offset;
            Units      = units;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Performs a deep copy of another DBCSignal.
        /// </summary>
        /// <param name="other">DBCSignal to copy.</param>
        public DBCSignal(DBCSignal other)
        {
            Order    = other.Order;
            ECU      = other.ECU;
            Message  = other.Message;
            StartBit = other.StartBit;

            Name      = other.Name;
            BitLength = other.BitLength;

            DefaultValue = other.DefaultValue;
            SNA          = other.SNA;

            // Range is specified
            PhysMax    = other.PhysicalMax;
            PhysMin    = other.PhysicalMin;
            NormMax    = other.NormMax;
            NormMin    = other.NormMin;
            Factor     = other.Factor;
            Descriptor = other.Descriptor;
            Offset     = other.Offset;
            Units      = other.Units;

            // Attributes
            foreach (var attr in other.Attributes)
            {
                Attributes.Add(attr.Key, attr.Value);
            }

            // Specific Values
            foreach (var spv in other.SpecifiedValues)
            {
                SpecifiedValues.Add(spv.Key, spv.Value);
            }

            Value = other.Value;
        }