Пример #1
0
 public static void PopulateRegularIntervalSchedule(RegularIntervalSchedule regularIntervalSchedule, ResourceDescription rd)
 {
     if ((regularIntervalSchedule != null) && (rd != null))
     {
         IES1Converter.PopulateBasicIntervalScheduleProperties(regularIntervalSchedule, rd);
     }
 }
Пример #2
0
        private ResourceDescription CreateRegularIntervalScheduleResourceDescription(RegularIntervalSchedule s)
        {
            ResourceDescription rd = null;

            if (s != null)
            {
                long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.REGULARINTERVALSCHEDULE, importHelper.CheckOutIndexForDMSType(DMSType.REGULARINTERVALSCHEDULE));
                rd = new ResourceDescription(gid);
                importHelper.DefineIDMapping(s.ID, gid);
                PowerTransformerConverter.PopulateRegularIntervalScheduleProperties(s, rd);
            }
            return(rd);
        }
Пример #3
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.CURVE:
                io = new Curve(globalId);
                break;

            case DMSType.CURVEDATA:
                io = new CurveData(globalId);
                break;

            case DMSType.DISCONNECTOR:
                io = new Disconnector(globalId);
                break;

            case DMSType.IRREGULARTIMEPOINT:
                io = new IrregularTimePoint(globalId);
                break;

            case DMSType.OUTAGESCHEDULE:
                io = new OutageSchedule(globalId);
                break;

            case DMSType.PROTSWITCH:
                io = new ProtectedSwitch(globalId);
                break;

            case DMSType.REGULARTIMEPOINT:
                io = new RegularTimePoint(globalId);
                break;

            case DMSType.REGULARINTERVALSCHEDULE:
                io = new RegularIntervalSchedule(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);
        }
        public static void PopulateRegularIntervalScheduleProperties(RegularIntervalSchedule r, ResourceDescription rd)
        {
            if (r != null && rd != null)
            {
                PowerTransformerConverter.PopulateBasicIntervalScheduleProperties(r, rd);

                if (r.EndTimeHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.REGULARINTERVALSCHEDULE_ENDTIME, r.EndTime));
                }

                if (r.TimeStepHasValue)
                {
                    rd.AddProperty(new Property(ModelCode.REGULARINTERVALSCHEDULE_TIMESTEP, r.TimeStep));
                }
            }
        }
Пример #5
0
        private void ImportRegularIntervalSchedule()
        {
            SortedDictionary <string, object> ps = concreteModel.GetAllObjectsOfType("FTN.RegularIntervalSchedule");

            foreach (var v in ps)
            {
                RegularIntervalSchedule s = v.Value as RegularIntervalSchedule;

                ResourceDescription rd = CreateRegularIntervalScheduleResourceDescription(s);
                if (rd != null)
                {
                    delta.AddDeltaOperation(DeltaOpType.Insert, rd, true);
                    report.Report.Append("REGULARINTERVALSCHEDULE ID = ").Append(s.ID).Append(" SUCCESSFULLY converted to GID = ").AppendLine(rd.Id.ToString());
                }
                else
                {
                    report.Report.Append("REGULARINTERVALSCHEDULE ID = ").Append(s.ID).AppendLine(" FAILED to be converted");
                }
            }
            report.Report.AppendLine();
        }