private ResourceDescription CreateGeographicalRegionResourceDescription(DERMS.GeographicalRegion cimRegion) { ResourceDescription rd = null; if (cimRegion != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.REGION, importHelper.CheckOutIndexForDMSType(DMSType.REGION)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimRegion.ID, gid); ////populate ResourceDescription DERMSConveter.PopulateGeographicalRegionProperties(cimRegion, rd); } return(rd); }
private ResourceDescription CreateBaseVoltageResourceDescription(FTN.BaseVoltage cimBaseVoltage) { ResourceDescription rd = null; if (cimBaseVoltage != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.BASEVOLTAGE, importHelper.CheckOutIndexForDMSType(DMSType.BASEVOLTAGE)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimBaseVoltage.ID, gid); ////populate ResourceDescription PowerTransformerConverter.PopulateBaseVoltageProperties(cimBaseVoltage, rd); } return(rd); }
private ResourceDescription CreateBaseVoltageResourceDescription(FTN.Terminal cimTerminal) { ResourceDescription rd = null; if (cimTerminal != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.TERMINAL, importHelper.CheckOutIndexForDMSType(DMSType.TERMINAL)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimTerminal.ID, gid); ////populate ResourceDescription PowerTransformerConverter.PopulateTerminalProperties(cimTerminal, rd, importHelper, report); } return(rd); }
private ResourceDescription CreateReactiveCapabilityCurveResourceDescription(FTN.ReactiveCapabilityCurve cimReactiveCapabilityCurve) { ResourceDescription rd = null; if (cimReactiveCapabilityCurve != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.REACTIVECAPABILITYCURVE, importHelper.CheckOutIndexForDMSType(DMSType.REACTIVECAPABILITYCURVE)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimReactiveCapabilityCurve.ID, gid); ////populate ResourceDescription Converter.PopulateReactiveCapabilityCurveProperties(cimReactiveCapabilityCurve, rd); } return(rd); }
private ResourceDescription CreateConnNodeContResourceDescription(FTN.ConnectivityNodeContainer cimCNC) { ResourceDescription rd = null; if (cimCNC != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.CONNECTNODECONT, importHelper.CheckOutIndexForDMSType(DMSType.CONNECTNODECONT)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimCNC.ID, gid); ////populate ResourceDescription OMSConverter.PopulateConnectivityNodeContainerProperties(cimCNC, rd, importHelper, report); } return(rd); }
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); }
private ResourceDescription CreateAssetResourceDescription(Asset cimAssset) { ResourceDescription rd = null; if (cimAssset != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.ASSET, importHelper.CheckOutIndexForDMSType(DMSType.ASSET)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimAssset.ID, gid); PowerTransformerConverter.PopulateAssetProperties(cimAssset, rd, importHelper, report); } return(rd); }
private ResourceDescription CreateDiscreteResourceDescription(FTN.Discrete discrete) { ResourceDescription rd = null; if (discrete != null) { long gid = 0; int iteratorId = 0; int resourcesLeft = 0; int numberOfResources = 2; string message = string.Empty; bool contains = false; ModelCode modelCodeDiscrete = ModelCode.DISCRETE; List <ModelCode> properties = new List <ModelCode>(); ModelResourcesDesc modelResourcesDesc = new ModelResourcesDesc(); List <ResourceDescription> retList = new List <ResourceDescription>(); properties = modelResourcesDesc.GetAllPropertyIds(modelCodeDiscrete); iteratorId = NetworkModelGDAProxy.Instance.GetExtentValues(modelCodeDiscrete, properties); resourcesLeft = NetworkModelGDAProxy.Instance.IteratorResourcesLeft(iteratorId); while (resourcesLeft > 0) { List <ResourceDescription> rds = NetworkModelGDAProxy.Instance.IteratorNext(numberOfResources, iteratorId); retList.AddRange(rds); resourcesLeft = NetworkModelGDAProxy.Instance.IteratorResourcesLeft(iteratorId); } NetworkModelGDAProxy.Instance.IteratorClose(iteratorId); foreach (ResourceDescription res in retList) { foreach (Property pr in res.Properties) { if (pr.PropertyValue.StringValue.Equals(discrete.MRID)) { contains = true; gid = res.Id; } } } if (!contains) { gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.DISCRETE, importHelper.CheckOutIndexForDMSType(DMSType.DISCRETE)); } rd = new ResourceDescription(gid); importHelper.DefineIDMapping(discrete.ID, gid); PowerTransformerConverter.PopulateDiscreteProperties(discrete, rd, importHelper, report); } return(rd); }
private ResourceDescription CreatePhaseImpedanceDataResourceDescription(FTN.PhaseImpedanceData cimPhaseImpedanceData) { ResourceDescription rd = null; if (cimPhaseImpedanceData != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.PHASEIMPENDANCEDATA, importHelper.CheckOutIndexForDMSType(DMSType.PHASEIMPENDANCEDATA)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimPhaseImpedanceData.ID, gid); ////populate ResourceDescription PowerTransformerConverter.PopulatePhaseImpedanceDataProperties(cimPhaseImpedanceData, rd, importHelper, report); } return(rd); }
private ResourceDescription CreateRegulatingControlResourceDescription(FTN.RegulatingControl cimRegulatingControl) { ResourceDescription rd = null; if (cimRegulatingControl != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.REGULATINGCONTROL, importHelper.CheckOutIndexForDMSType(DMSType.REGULATINGCONTROL)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimRegulatingControl.ID, gid); ////populate ResourceDescription PowerTransformerConverter.PopulateRegulatingControlProperties(cimRegulatingControl, rd); } return(rd); }
/// <summary> /// Generic method to create resource description based on DMSType /// </summary> /// <typeparam name="T"></typeparam> /// <param name="cimObj"></param> /// <param name="dmsType"></param> /// <returns></returns> private ResourceDescription CreateResourceDescription <T>(T cimObj, DMSType dmsType) where T : IdentifiedObject { if (cimObj == null) { return(null); } long gid = ModelCodeHelper.CreateGlobalId(0, (short)dmsType, importHelper.CheckOutIndexForDMSType(dmsType)); var rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimObj.ID, gid); IES1Converter.PopulateProperties(cimObj, rd, importHelper, report); return(rd); }
private ResourceDescription CreateConnectivityNodeContainerResourceDescription(ConnectivityNodeContainer cimConnectivityNodeContainer) { ResourceDescription rd = null; if (cimConnectivityNodeContainer != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.CONNECTNODECONTAINER, importHelper.CheckOutIndexForDMSType(DMSType.CONNECTNODECONTAINER)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimConnectivityNodeContainer.ID, gid); IES21Converter.PopulateConnectivityNodeContainerProperties(cimConnectivityNodeContainer, rd); } return(rd); }
private ResourceDescription CreateConnectivityNodeResourceDescription(FTN.ConnectivityNode cimConnectivityNode) { ResourceDescription rd = null; if (cimConnectivityNode != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.CONNODE, importHelper.CheckOutIndexForDMSType(DMSType.CONNODE)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimConnectivityNode.ID, gid); ////populate ResourceDescription PowerTransformerConverter.PopulateConnectivityNodeProperties(cimConnectivityNode, rd); } return(rd); }
private ResourceDescription CreateGroundDisconnectorResourceDescription(FTN.GroundDisconnector cimGroundDisconnector) { ResourceDescription rd = null; if (cimGroundDisconnector != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.GROUNDDDISCONNECTOR, importHelper.CheckOutIndexForDMSType(DMSType.GROUNDDDISCONNECTOR)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimGroundDisconnector.ID, gid); ////populate ResourceDescription PowerTransformerConverter.PopulateGroundDisconnectorProperties(cimGroundDisconnector, rd, importHelper, report); } return(rd); }
private ResourceDescription CreateSeriesCompensatorResourceDescription(FTN.SeriesCompensator cimSeriesCompensator) { ResourceDescription rd = null; if (cimSeriesCompensator != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.SERIESCOMPENSATOR, importHelper.CheckOutIndexForDMSType(DMSType.SERIESCOMPENSATOR)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimSeriesCompensator.ID, gid); ////populate ResourceDescription PowerTransformerConverter.PopulateSeriesCompensatorProperties(cimSeriesCompensator, rd, importHelper, report); } return(rd); }
private ResourceDescription CreateBaysResourceDescription(Bay bay) { ResourceDescription rd = null; if (bay != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.BAY, importHelper.CheckOutIndexForDMSType(DMSType.BAY)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(bay.ID, gid); ////populate ResourceDescription PowerTransformerConverter.PopulateBaysProperties(bay, rd, importHelper, report); } return(rd); }
private ResourceDescription CreateSubstationResourceDescription(Substation cimSubstation) { ResourceDescription rd = null; if (cimSubstation != null) { long gid = ModelCodeHelper.CreateGlobalId(0, (short)DMSType.SUBSTATION, importHelper.CheckOutIndexForDMSType(DMSType.SUBSTATION)); rd = new ResourceDescription(gid); importHelper.DefineIDMapping(cimSubstation.ID, gid); SCADAConverter.PopulateSubstationProperties(cimSubstation, rd, importHelper, report); } return(rd); }