示例#1
0
        /// <summary>
        /// Create a new list to store the self test variable values associated with a self test.
        /// </summary>
        /// <param name="identifier">The self test identifier associated with the test.</param>
        /// <returns>A new list of self test variables specific to a test with the specified self test identifier.</returns>
        public virtual List <SelfTestVariable> CreateSelfTestVariableList(short identifier)
        {
            Debug.Assert(identifier >= 0, "SelfTestTable.CreateSelfTestVariableList");
            List <SelfTestIdentifier_t> selfTestIdentifierList;
            List <SelfTestVariable>     selfTestVariableList = new List <SelfTestVariable>();

            try
            {
                // -----------------------------------------------------------------------------
                // Get the self test variables that are associated with the specified self test.
                // -----------------------------------------------------------------------------
                SelfTestVariable selfTestVariable;
                selfTestIdentifierList = m_SelfTestIdentifierLists[identifier];
                for (int index = 0; index < selfTestIdentifierList.Count; index++)
                {
                    selfTestVariable = new SelfTestVariable();
                    Lookup.SelfTestVariableTable.Items[selfTestIdentifierList[index].SelfTestVariableIdentifier].CopyTo(ref selfTestVariable);
                    selfTestVariableList.Add(selfTestVariable);
                }
            }
            catch (Exception)
            {
                // Ensure that an exception isn't thrown.
            }

            return(selfTestVariableList);
        }
        /// <summary>
        /// Create a new list to store the self test variable values associated with a self test.
        /// </summary>
        /// <param name="testNumber">The test number associated with the test.</param>
        /// <returns>A new list of self test variables specific to a test with the specified self test number.</returns>
        public override List<SelfTestVariable> CreateSelfTestVariableList(short testNumber)
        {
            Debug.Assert(testNumber >= 0, "SelfTestTableBySelfTestNumber.CreateSelfTestVariableList");
            List<SelfTestIdentifier_t> selfTestIdentifierList;
            List<SelfTestVariable> selfTestVariableList = new List<SelfTestVariable>();

            try
            {
                // -----------------------------------------------------------------------------
                // Get the self test variables that are associated with the specified self test.
                // -----------------------------------------------------------------------------
                SelfTestVariable selfTestVariable;
                selfTestIdentifierList = m_SelfTestIdentifierLists[testNumber];
                for (int index = 0; index < selfTestIdentifierList.Count; index++)
                {
                    selfTestVariable = new SelfTestVariable();
                    Lookup.SelfTestVariableTable.Items[selfTestIdentifierList[index].SelfTestVariableIdentifier].CopyTo(ref selfTestVariable);
                    selfTestVariableList.Add(selfTestVariable);
                }
            }
            catch (Exception)
            {
                // Ensure that an exception isn't thrown.
            }

            return selfTestVariableList;
        }
        /// <summary>
        /// Copy all property values to the specified self test variable.
        /// </summary>
        /// <param name="selfTestVariable">The self test variable that the property values are to be copied to.</param>
        public void CopyTo(ref SelfTestVariable selfTestVariable)
        {
            // Self Test Variable
            selfTestVariable.EmbeddedName = EmbeddedName;

            // Variable
            selfTestVariable.Name               = Name;
            selfTestVariable.DataType           = DataType;
            selfTestVariable.VariableType       = VariableType;
            selfTestVariable.ScaleFactor        = ScaleFactor;
            selfTestVariable.EnumBitIdentifier  = EnumBitIdentifier;
            selfTestVariable.IsBitMask          = IsBitMask;
            selfTestVariable.Units              = Units;
            selfTestVariable.FormatString       = FormatString;
            selfTestVariable.ValueFromTarget    = ValueFromTarget;
            selfTestVariable.DataTypeFromTarget = DataTypeFromTarget;

            // Record
            selfTestVariable.Identifier = Identifier;
            selfTestVariable.HelpIndex  = HelpIndex;
        }
示例#4
0
        /// <summary>
        /// Copy all property values to the specified self test variable.
        /// </summary>
        /// <param name="selfTestVariable">The self test variable that the property values are to be copied to.</param>
        public void CopyTo(ref SelfTestVariable selfTestVariable)
        {
            // Self Test Variable
            selfTestVariable.EmbeddedName = EmbeddedName;

            // Variable
            selfTestVariable.Name = Name;
            selfTestVariable.DataType = DataType;
            selfTestVariable.VariableType = VariableType;
            selfTestVariable.ScaleFactor = ScaleFactor;
            selfTestVariable.EnumBitIdentifier = EnumBitIdentifier;
            selfTestVariable.IsBitMask = IsBitMask;
            selfTestVariable.Units = Units;
            selfTestVariable.FormatString = FormatString;
            selfTestVariable.ValueFromTarget = ValueFromTarget;
            selfTestVariable.DataTypeFromTarget = DataTypeFromTarget;

            // Record
            selfTestVariable.Identifier = Identifier;
            selfTestVariable.HelpIndex = HelpIndex;
        }