Beispiel #1
0
        /// <summary>
        /// This method retrieves the text that should be displayed for the pulse weight
        /// meter value.
        /// </summary>
        /// <param name="Output">The KYZ output to check.</param>
        /// <returns>The text to show for the pulse weight.</returns>
        // Revision History
        // MM/DD/YY who Version Issue# Description
        // -------- --- ------- ------ -------------------------------------------
        // 04/20/09 jrf 2.20.02 n/a	    Created
        // 11/18/14 AF  4.00.89 542760  Show only 2 decimal places in the value
        //
        public string GetPulseWeightText(KYZOutput Output)
        {
            string strPulseWeightText;
            float  fltPulseWeight = 0.0f;

            switch (Output)
            {
            case KYZOutput.KYZ1:
            {
                fltPulseWeight = m_fltKYZ1PulseWt;
                break;
            }

            case KYZOutput.KYZ2:
            {
                fltPulseWeight = m_fltKYZ2PulseWt;
                break;
            }

            default:
            {
                throw new ArgumentException("Invalid KYZ Output: " + Output.ToString(), "Output");
            }
            }

            strPulseWeightText = fltPulseWeight.ToString("0.00", CultureInfo.CurrentCulture) + " Ke";

            return(strPulseWeightText);
        }
Beispiel #2
0
        /// <summary>
        /// This method retrieves the text that should be displayed for the pulse width
        /// meter value.
        /// </summary>
        /// <param name="Output">The KYZ output to check.</param>
        /// <returns>The text to show for pulse width.</returns>
        // Revision History
        // MM/DD/YY who Version Issue# Description
        // -------- --- ------- ------ -------------------------------------------
        // 04/20/09 jrf 2.20.02 n/a	Created
        //
        public string GetPulseWidthText(KYZOutput Output)
        {
            string strPulseWidthText = "";
            ushort usPulseWidth      = 0;

            switch (Output)
            {
            case KYZOutput.KYZ1:
            {
                usPulseWidth = m_usKYZ1PulseWidth;
                break;
            }

            case KYZOutput.KYZ2:
            {
                usPulseWidth = m_usKYZ2PulseWidth;
                break;
            }

            case KYZOutput.LC1:
            {
                usPulseWidth = m_usLC1PulseWidth;
                break;
            }

            default:
            {
                throw new ArgumentException("Invalid KYZ Output: " + Output.ToString(), "Output");
            }
            }

            //If zero is pulse width then pulse width is used to
            //indicate a toggle or a state change.
            if (0 == usPulseWidth)
            {
                //If it uses a pulse weight, we know it's an energy.
                if (true == UsesPulseWeight(Output))
                {
                    strPulseWidthText = "Toggle";
                }
                else
                {
                    strPulseWidthText = "State Change";
                }
            }
            else
            {
                strPulseWidthText = usPulseWidth.ToString("0", CultureInfo.CurrentCulture) + " msec";
            }

            return(strPulseWidthText);
        }