Exemple #1
0
        /// <summary>
        /// A verbose string representation of the <see cref="LinearStateEstimator.Modeling.CircuitBreaker"/> and can be used for detailed text based output via a console or a text file.
        /// </summary>
        /// <returns>A verbose string representation of the <see cref="LinearStateEstimator.Modeling.CircuitBreaker"/>.</returns>
        public new string ToVerboseString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine();
            stringBuilder.AppendFormat("----- Circuit Breaker ----------------------------------------------------------");
            stringBuilder.AppendLine();
            stringBuilder.AppendFormat("      InternalID: " + InternalID.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("          Number: " + Number.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("            Name: " + Name + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("     Description: " + Description + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat(" Can Infer State: " + CanInferState.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("Group A Reported: " + CrossDevicePhasors.GroupAWasReported + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("Group B Reported: " + CrossDevicePhasors.GroupBWasReported + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("          Normal: " + NormalState.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("          Actual: " + ActualState.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("        Measured: " + MeasuredState.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("   Measured Open: " + IsMeasuredOpen.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat(" Measured Closed: " + IsMeasuredClosed.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("   Inferred Open: " + IsInferredOpen.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat(" Inferred Closed: " + IsInferredClosed.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("         Is Open: " + IsOpen.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("       Is Closed: " + IsClosed.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat(" In Pruning Mode: " + InPruningMode.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("          Manual: " + InManualOverrideMode.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("        FromNode: " + FromNode.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("          ToNode: " + ToNode.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("ParentSubstation: " + m_parentSubstation.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("          Status: {0}", Environment.NewLine);
            stringBuilder.AppendFormat(m_breakerStatus.ToStatusString() + "{0}", Environment.NewLine);
            stringBuilder.AppendLine();
            return(stringBuilder.ToString());
        }
Exemple #2
0
        /// <summary>
        /// A verbose string representation of the <see cref="Switch"/>.
        /// </summary>
        /// <returns>A verbose string representation of the <see cref="Switch"/>.</returns>
        public new string ToVerboseString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendLine();
            stringBuilder.AppendFormat("----- Switch -------------------------------------------------------------------");
            stringBuilder.AppendLine();
            stringBuilder.AppendFormat("      InternalID: " + InternalID.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("          Number: " + Number.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("            Name: " + Name + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("     Description: " + Description + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat(" Can Infer State: " + CanInferState.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("Group A Reported: " + CrossDevicePhasors.GroupAWasReported + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("Group B Reported: " + CrossDevicePhasors.GroupBWasReported + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("        Normally: " + NormalState.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("        Actually: " + ActualState.ToString() + "{0}", Environment.NewLine); stringBuilder.AppendFormat("   Inferred Open: " + IsInferredOpen.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat(" Inferred Closed: " + IsInferredClosed.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("         Is Open: " + IsOpen.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("       Is Closed: " + IsClosed.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat(" In Pruning Mode: " + InPruningMode.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("          Manual: " + InManualOverrideMode.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("        FromNode: " + FromNode.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendFormat("          ToNode: " + ToNode.ToString() + "{0}", Environment.NewLine);
            if (m_parentSubstation != null)
            {
                stringBuilder.AppendFormat("ParentSubstation: " + m_parentSubstation.ToString() + "{0}", Environment.NewLine);
            }
            if (m_parentTransmissionLine != null)
            {
                stringBuilder.AppendFormat("ParntTrnsmsnLine: " + m_parentTransmissionLine.ToString() + "{0}", Environment.NewLine);
            }
            stringBuilder.AppendFormat("   InDefaultMode: " + m_isInDefaultMode.ToString() + "{0}", Environment.NewLine);
            stringBuilder.AppendLine();
            return(stringBuilder.ToString());
        }
Exemple #3
0
 public string GetString()
 {
     return
         ("[DP=" + DastgahPardakhtCode.ToString() +
          ", SP=" + ShahrPardakhtCode.ToString() +
          ", MO=" + Mobile.ToString() +
          ", ISC=" + IsClosed.ToString() +
          ", ISV=" + IsValid.ToString() +
          ", NSD=" + (NazarsanjiDone ? "1" : "0") +
          "]");
 }
Exemple #4
0
        public override void WriteXml(XmlWriter writer)
        {
            writer.WriteStartElement(GetType().ToString());
            base.WriteXml(writer);

            writer.WriteAttributeString(nameof(IsClosed), IsClosed.ToString());
            CentrePoint.WriteXml(writer);

            writer.WriteStartElement(nameof(Points));
            foreach (var point in Points)
            {
                point.WriteXml(writer);
            }
            writer.WriteEndElement();
            writer.WriteEndElement();
        }
Exemple #5
0
        public new string ToCsvLineString()
        {
            StringBuilder csvLine = new StringBuilder();

            csvLine.AppendFormat($"{InternalID.ToString()},");
            csvLine.AppendFormat($"{Number.ToString()},");
            csvLine.AppendFormat($"{Name},");
            csvLine.AppendFormat($"{Description},");
            csvLine.AppendFormat($"{CanInferState.ToString()},");
            csvLine.AppendFormat($"{CrossDevicePhasors.GroupAWasReported},");
            csvLine.AppendFormat($"{CrossDevicePhasors.GroupBWasReported},");
            csvLine.AppendFormat($"{NormalState.ToString()},");
            csvLine.AppendFormat($"{ActualState.ToString()},");
            csvLine.AppendFormat($"{IsInferredOpen.ToString()},");
            csvLine.AppendFormat($"{IsInferredClosed.ToString()},");
            csvLine.AppendFormat($"{IsOpen.ToString()},");
            csvLine.AppendFormat($"{IsClosed.ToString()},");
            csvLine.AppendFormat($"{InPruningMode.ToString()},");
            csvLine.AppendFormat($"{InManualOverrideMode.ToString()},");
            csvLine.AppendFormat($"{FromNode.ToString()},");
            csvLine.AppendFormat($"{ToNode.ToString()},");
            if (ParentSubstation != null)
            {
                csvLine.AppendFormat($"{ParentSubstation.Name},");
            }
            else
            {
                csvLine.AppendFormat("None,");
            }
            if (m_parentTransmissionLine != null)
            {
                csvLine.AppendFormat($"{ParentTransmissionLine.Name},");
            }
            else
            {
                csvLine.AppendFormat("None,");
            }
            csvLine.AppendFormat($"{IsInDefaultMode}{Environment.NewLine}");
            return(csvLine.ToString());
        }