Ejemplo n.º 1
0
        /// <summary>
        /// A verbose string representation of the instance of the class and can be used for descriptive text output in a console or text file.
        /// </summary>
        /// <returns>A verbose string representatin of the instance of the class.</returns>
        public string ToVerboseString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine();
            stringBuilder.AppendFormat("----- Breaker Status -----------------------------------------------------------");
            stringBuilder.AppendLine();
            stringBuilder.AppendFormat("      InternalID: " + m_internalID.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("          Number: " + m_number.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("            Name: " + m_name + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("     Description: " + m_description + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("          Status: " + this.Value.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("    Binary Value: " + AddPrefixOfZerosIfNeeded(Convert.ToString(m_binaryValue, 2)) + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("             Bit: " + m_bitPosition.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("             Key: " + m_inputMeasurementKey + "{0}", Environment.NewLine);
            if (m_parentCircuitBreaker != null)
            {
                stringBuilder.AppendFormat("       Parent CB: " + m_parentCircuitBreaker.ToString() + "{0}", Environment.NewLine);
            }
            else
            {
                stringBuilder.AppendFormat("       Parent CB: Unclaimed {0}", Environment.NewLine);
            }
            stringBuilder.AppendLine();
            return(stringBuilder.ToString());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// A descriptive string representation of the <see cref="LinearStateEstimator.Measurements.BreakerStatus"/> class instance. The format is <i>BreakerStatus,internalId,number,name,description,bitPosition,enabledFlag,measurementKey,parentCircuitBreakerInternalID</i> and can be used for a rudimentary momento design pattern.
 /// </summary>
 /// <returns>A string representation of the instance of the class.</returns>
 public override string ToString()
 {
     return("BreakerStatus," + m_internalID.ToString() + "," + m_number.ToString() + "," + m_name + "," + m_name + "," + m_description + "," + m_bitPosition.ToString() + "," + m_enabled.ToString() + "," + m_inputMeasurementKey + "," + m_parentCircuitBreakerID.ToString());
 }