示例#1
0
        public static string WindingTestToString(WindingTest winding, string num)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine($"\t\t\t\tWT {num}");
            sb.AppendLine($"\t\t\t\t\tNAME: {winding.Name}");
            sb.AppendLine($"\t\t\t\t\tMRID: {winding.MRID}");
            sb.AppendLine($"\t\t\t\t\tDESCRIPTION: {winding.Description}");
            return(sb.ToString());
        }
示例#2
0
        /// <summary>
        /// Creates entity for specified global inside the container.
        /// </summary>
        /// <param name="globalId">Global id of the entity for insert</param>
        /// <returns>Created entity (identified object).</returns>
        public IdentifiedObject CreateEntity(long globalId)
        {
            short type = ModelCodeHelper.ExtractTypeFromGlobalId(globalId);

            IdentifiedObject io = null;

            switch ((DMSType)type)
            {
            case DMSType.BASEVOLTAGE:
                io = new BaseVoltage(globalId);
                break;

            case DMSType.LOCATION:
                io = new Location(globalId);
                break;

            case DMSType.POWERTR:
                io = new PowerTransformer(globalId);
                break;

            case DMSType.POWERTRWINDING:
                io = new TransformerWinding(globalId);
                break;

            case DMSType.WINDINGTEST:
                io = new WindingTest(globalId);
                break;

            case DMSType.TERMINAL:
                io = new Terminal(globalId);
                break;

            default:
                string message = String.Format("Failed to create entity because specified type ({0}) is not supported.", type);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
                throw new Exception(message);
            }

            // Add entity to map
            this.AddEntity(io);

            return(io);
        }