From e8613996cad90f0f4848d262e1bff401af92bd5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francis=20Go=CC=81mez?= Date: Mon, 7 Aug 2017 18:13:53 +0200 Subject: [PATCH 1/3] New package for the CIM v16 and Dynamics --- CIM16/CDPSM/Asset/Element.py | 39 + .../Asset/IEC61968/AssetModels/CableInfo.py | 79 ++ .../AssetModels/ConcentricNeutralCableInfo.py | 47 ++ .../IEC61968/AssetModels/ConductorInfo.py | 111 +++ .../IEC61968/AssetModels/EndDeviceInfo.py | 51 ++ .../AssetModels/OverheadConductorInfo.py | 51 ++ .../AssetModels/PowerTransformerInfo.py | 65 ++ .../IEC61968/AssetModels/TapChangerInfo.py | 95 +++ .../AssetModels/TapeShieldCableInfo.py | 47 ++ .../AssetModels/TransformerEndInfo.py | 122 +++ .../AssetModels/TransformerTankInfo.py | 112 +++ .../IEC61968/AssetModels/WireArrangement.py | 93 +++ .../Asset/IEC61968/AssetModels/WireType.py | 113 +++ .../Asset/IEC61968/AssetModels/__init__.py | 69 ++ .../CDPSM/Asset/IEC61968/Assets/AssetInfo.py | 39 + CIM16/CDPSM/Asset/IEC61968/Assets/__init__.py | 28 + CIM16/CDPSM/Asset/IEC61968/__init__.py | 27 + .../Asset/IEC61970/Core/IdentifiedObject.py | 73 ++ CIM16/CDPSM/Asset/IEC61970/Core/Name.py | 85 +++ CIM16/CDPSM/Asset/IEC61970/Core/NameType.py | 65 ++ CIM16/CDPSM/Asset/IEC61970/Core/__init__.py | 30 + .../Asset/IEC61970/Wires/ACLineSegment.py | 102 +++ .../IEC61970/Wires/PerLengthPhaseImpedance.py | 65 ++ .../Wires/PerLengthSequenceImpedance.py | 65 ++ .../Wires/TransformerCoreAdmittance.py | 63 ++ .../Asset/IEC61970/Wires/TransformerEnd.py | 102 +++ .../Wires/TransformerStarImpedance.py | 65 ++ .../Asset/IEC61970/Wires/TransformerTank.py | 60 ++ .../IEC61970/Wires/TransformerTankEnd.py | 39 + CIM16/CDPSM/Asset/IEC61970/Wires/__init__.py | 40 + CIM16/CDPSM/Asset/IEC61970/__init__.py | 27 + CIM16/CDPSM/Asset/__init__.py | 138 ++++ CIM16/CDPSM/Balanced/Element.py | 39 + .../IEC61970/Core/IdentifiedObject.py | 73 ++ CIM16/CDPSM/Balanced/IEC61970/Core/Name.py | 85 +++ .../CDPSM/Balanced/IEC61970/Core/NameType.py | 65 ++ .../CDPSM/Balanced/IEC61970/Core/__init__.py | 35 + .../Generation/Production/GeneratingUnit.py | 81 ++ .../Generation/Production/__init__.py | 33 + .../Balanced/IEC61970/Generation/__init__.py | 27 + .../LoadModel/LoadResponseCharacteristic.py | 109 +++ .../Balanced/IEC61970/LoadModel/__init__.py | 28 + .../Balanced/IEC61970/Wires/ACLineSegment.py | 63 ++ .../Balanced/IEC61970/Wires/DCLineSegment.py | 39 + .../Balanced/IEC61970/Wires/EnergyConsumer.py | 80 ++ .../Balanced/IEC61970/Wires/EnergySource.py | 59 ++ .../IEC61970/Wires/PhaseTapChanger.py | 39 + .../Wires/PhaseTapChangerAsymetrical.py | 43 ++ .../IEC61970/Wires/PhaseTapChangerLinear.py | 43 ++ .../Wires/PhaseTapChangerNonLinear.py | 43 ++ .../Wires/PhaseTapChangerSymetrical.py | 39 + .../IEC61970/Wires/PowerTransformer.py | 39 + .../IEC61970/Wires/PowerTransformerEnd.py | 83 +++ .../IEC61970/Wires/ProtectedSwitch.py | 43 ++ .../IEC61970/Wires/RatioTapChanger.py | 47 ++ .../IEC61970/Wires/SeriesCompensator.py | 47 ++ .../IEC61970/Wires/ShuntCompensator.py | 87 +++ .../IEC61970/Wires/SynchronousMachine.py | 80 ++ .../Balanced/IEC61970/Wires/TapChanger.py | 59 ++ .../Wires/TransformerCoreAdmittance.py | 79 ++ .../Balanced/IEC61970/Wires/TransformerEnd.py | 139 ++++ .../Wires/TransformerMeshImpedance.py | 108 +++ .../Wires/TransformerStarImpedance.py | 81 ++ .../IEC61970/Wires/TransformerTankEnd.py | 39 + .../CDPSM/Balanced/IEC61970/Wires/__init__.py | 84 +++ CIM16/CDPSM/Balanced/IEC61970/__init__.py | 27 + CIM16/CDPSM/Balanced/__init__.py | 151 ++++ CIM16/CDPSM/Connectivity/Element.py | 39 + .../Connectivity/IEC61970/Core/BaseVoltage.py | 95 +++ CIM16/CDPSM/Connectivity/IEC61970/Core/Bay.py | 81 ++ .../IEC61970/Core/ConductingEquipment.py | 65 ++ .../IEC61970/Core/ConnectivityNode.py | 86 +++ .../Core/ConnectivityNodeContainer.py | 65 ++ .../Connectivity/IEC61970/Core/Equipment.py | 60 ++ .../IEC61970/Core/EquipmentContainer.py | 65 ++ .../IEC61970/Core/GeographicalRegion.py | 65 ++ .../IEC61970/Core/IdentifiedObject.py | 73 ++ .../CDPSM/Connectivity/IEC61970/Core/Name.py | 85 +++ .../Connectivity/IEC61970/Core/NameType.py | 94 +++ .../IEC61970/Core/NameTypeAuthority.py | 73 ++ .../Connectivity/IEC61970/Core/PSRType.py | 39 + .../IEC61970/Core/PowerSystemResource.py | 39 + .../IEC61970/Core/SubGeographicalRegion.py | 112 +++ .../Connectivity/IEC61970/Core/Substation.py | 112 +++ .../Connectivity/IEC61970/Core/Terminal.py | 111 +++ .../IEC61970/Core/VoltageLevel.py | 115 +++ .../Connectivity/IEC61970/Core/__init__.py | 50 ++ .../IEC61970/Wires/ACLineSegment.py | 60 ++ .../Connectivity/IEC61970/Wires/Breaker.py | 39 + .../IEC61970/Wires/BusbarSection.py | 39 + .../Connectivity/IEC61970/Wires/Conductor.py | 43 ++ .../IEC61970/Wires/DCLineSegment.py | 39 + .../IEC61970/Wires/Disconnector.py | 39 + .../IEC61970/Wires/EnergyConsumer.py | 39 + .../IEC61970/Wires/EnergySource.py | 39 + .../CDPSM/Connectivity/IEC61970/Wires/Fuse.py | 39 + .../Connectivity/IEC61970/Wires/Ground.py | 39 + .../IEC61970/Wires/GroundDisconnector.py | 39 + .../Connectivity/IEC61970/Wires/Jumper.py | 39 + .../Connectivity/IEC61970/Wires/Junction.py | 39 + .../CDPSM/Connectivity/IEC61970/Wires/Line.py | 60 ++ .../IEC61970/Wires/LoadBreakSwitch.py | 39 + .../IEC61970/Wires/PowerTransformer.py | 91 +++ .../IEC61970/Wires/PowerTransformerEnd.py | 59 ++ .../IEC61970/Wires/Sectionaliser.py | 39 + .../IEC61970/Wires/SeriesCompensator.py | 39 + .../IEC61970/Wires/ShuntCompensator.py | 39 + .../Connectivity/IEC61970/Wires/Switch.py | 43 ++ .../IEC61970/Wires/SynchronousMachine.py | 39 + .../IEC61970/Wires/TransformerEnd.py | 60 ++ .../IEC61970/Wires/TransformerTank.py | 86 +++ .../IEC61970/Wires/TransformerTankEnd.py | 64 ++ .../Connectivity/IEC61970/Wires/__init__.py | 52 ++ .../WiresPhaseModel/ShuntCompensatorPhase.py | 39 + .../IEC61970/WiresPhaseModel/SwitchPhase.py | 39 + .../IEC61970/WiresPhaseModel/__init__.py | 32 + CIM16/CDPSM/Connectivity/IEC61970/__init__.py | 27 + CIM16/CDPSM/Connectivity/__init__.py | 114 +++ CIM16/CDPSM/Geographical/Element.py | 39 + .../IEC61968/Common/CoordinateSystem.py | 69 ++ .../Geographical/IEC61968/Common/Location.py | 112 +++ .../IEC61968/Common/PositionPoint.py | 76 ++ .../Geographical/IEC61968/Common/__init__.py | 30 + CIM16/CDPSM/Geographical/IEC61968/__init__.py | 27 + .../IEC61970/Core/ConductingEquipment.py | 39 + .../Geographical/IEC61970/Core/Equipment.py | 39 + .../IEC61970/Core/IdentifiedObject.py | 73 ++ .../CDPSM/Geographical/IEC61970/Core/Name.py | 85 +++ .../Geographical/IEC61970/Core/NameType.py | 65 ++ .../IEC61970/Core/PowerSystemResource.py | 60 ++ .../Geographical/IEC61970/Core/__init__.py | 33 + .../IEC61970/Wires/ACLineSegment.py | 39 + .../Geographical/IEC61970/Wires/Breaker.py | 39 + .../IEC61970/Wires/BusbarSection.py | 39 + .../IEC61970/Wires/DCLineSegment.py | 39 + .../IEC61970/Wires/Disconnector.py | 39 + .../IEC61970/Wires/EnergyConsumer.py | 39 + .../IEC61970/Wires/EnergySource.py | 39 + .../CDPSM/Geographical/IEC61970/Wires/Fuse.py | 39 + .../IEC61970/Wires/GroundDisconnector.py | 39 + .../Geographical/IEC61970/Wires/Jumper.py | 39 + .../Geographical/IEC61970/Wires/Junction.py | 39 + .../CDPSM/Geographical/IEC61970/Wires/Line.py | 39 + .../IEC61970/Wires/LoadBreakSwitch.py | 39 + .../IEC61970/Wires/PowerTransformer.py | 39 + .../IEC61970/Wires/SeriesCompensator.py | 39 + .../IEC61970/Wires/ShuntCompensator.py | 39 + .../IEC61970/Wires/SynchronousMachine.py | 39 + .../Geographical/IEC61970/Wires/__init__.py | 44 ++ CIM16/CDPSM/Geographical/IEC61970/__init__.py | 27 + CIM16/CDPSM/Geographical/__init__.py | 85 +++ CIM16/CDPSM/__init__.py | 25 + CIM16/CombinedVersion.py | 47 ++ CIM16/Element.py | 39 + CIM16/IEC61968/AssetModels/CableInfo.py | 99 +++ .../AssetModels/ConcentricNeutralCableInfo.py | 68 ++ CIM16/IEC61968/AssetModels/ConductorInfo.py | 111 +++ CIM16/IEC61968/AssetModels/EndDeviceInfo.py | 77 ++ CIM16/IEC61968/AssetModels/NoLoadTest.py | 80 ++ CIM16/IEC61968/AssetModels/OpenCircuitTest.py | 101 +++ .../AssetModels/OverheadConductorInfo.py | 71 ++ .../AssetModels/PowerTransformerInfo.py | 91 +++ .../IEC61968/AssetModels/ShortCircuitTest.py | 116 +++ CIM16/IEC61968/AssetModels/TapChangerInfo.py | 125 ++++ .../AssetModels/TapeShieldCableInfo.py | 47 ++ .../AssetModels/TransformerEndInfo.py | 336 +++++++++ .../AssetModels/TransformerTankInfo.py | 162 ++++ CIM16/IEC61968/AssetModels/TransformerTest.py | 47 ++ CIM16/IEC61968/AssetModels/WireArrangement.py | 93 +++ CIM16/IEC61968/AssetModels/WireType.py | 139 ++++ CIM16/IEC61968/AssetModels/__init__.py | 73 ++ CIM16/IEC61968/Assets/AcceptanceTest.py | 49 ++ CIM16/IEC61968/Assets/Asset.py | 701 ++++++++++++++++++ CIM16/IEC61968/Assets/AssetContainer.py | 121 +++ CIM16/IEC61968/Assets/AssetFunction.py | 79 ++ CIM16/IEC61968/Assets/AssetInfo.py | 99 +++ CIM16/IEC61968/Assets/AssetModel.py | 84 +++ CIM16/IEC61968/Assets/ComMedia.py | 39 + CIM16/IEC61968/Assets/ProductAssetModel.py | 105 +++ CIM16/IEC61968/Assets/Seal.py | 76 ++ CIM16/IEC61968/Assets/__init__.py | 56 ++ CIM16/IEC61968/Common/ActivityRecord.py | 206 +++++ CIM16/IEC61968/Common/Agreement.py | 49 ++ CIM16/IEC61968/Common/CoordinateSystem.py | 125 ++++ CIM16/IEC61968/Common/Document.py | 438 +++++++++++ CIM16/IEC61968/Common/ElectronicAddress.py | 67 ++ CIM16/IEC61968/Common/Location.py | 477 ++++++++++++ CIM16/IEC61968/Common/Organisation.py | 100 +++ CIM16/IEC61968/Common/PositionPoint.py | 76 ++ CIM16/IEC61968/Common/PostalAddress.py | 57 ++ CIM16/IEC61968/Common/Status.py | 53 ++ CIM16/IEC61968/Common/StreetAddress.py | 55 ++ CIM16/IEC61968/Common/StreetDetail.py | 77 ++ CIM16/IEC61968/Common/TelephoneNumber.py | 57 ++ CIM16/IEC61968/Common/TimePoint.py | 109 +++ CIM16/IEC61968/Common/TimeSchedule.py | 87 +++ CIM16/IEC61968/Common/TownDetail.py | 57 ++ CIM16/IEC61968/Common/UserAttribute.py | 287 +++++++ CIM16/IEC61968/Common/__init__.py | 44 ++ CIM16/IEC61968/Customers/Customer.py | 246 ++++++ CIM16/IEC61968/Customers/CustomerAccount.py | 166 +++++ CIM16/IEC61968/Customers/CustomerAgreement.py | 354 +++++++++ CIM16/IEC61968/Customers/PricingStructure.py | 206 +++++ CIM16/IEC61968/Customers/ServiceCategory.py | 95 +++ CIM16/IEC61968/Customers/ServiceLocation.py | 160 ++++ CIM16/IEC61968/Customers/Tariff.py | 111 +++ CIM16/IEC61968/Customers/__init__.py | 49 ++ CIM16/IEC61968/IEC61968CIMVersion.py | 47 ++ .../LoadControl/ConnectDisconnectFunction.py | 104 +++ .../RemoteConnectDisconnectInfo.py | 85 +++ CIM16/IEC61968/LoadControl/__init__.py | 29 + CIM16/IEC61968/Metering/ComFunction.py | 51 ++ .../Metering/DemandResponseProgram.py | 127 ++++ CIM16/IEC61968/Metering/DynamicDemand.py | 49 ++ .../Metering/ElectricMeteringFunction.py | 71 ++ CIM16/IEC61968/Metering/EndDevice.py | 215 ++++++ CIM16/IEC61968/Metering/EndDeviceControl.py | 145 ++++ CIM16/IEC61968/Metering/EndDeviceEvent.py | 85 +++ CIM16/IEC61968/Metering/EndDeviceFunction.py | 141 ++++ CIM16/IEC61968/Metering/EndDeviceGroup.py | 122 +++ CIM16/IEC61968/Metering/IntervalBlock.py | 134 ++++ CIM16/IEC61968/Metering/IntervalReading.py | 101 +++ CIM16/IEC61968/Metering/Meter.py | 155 ++++ CIM16/IEC61968/Metering/MeterReading.py | 192 +++++ CIM16/IEC61968/Metering/MeterServiceWork.py | 81 ++ CIM16/IEC61968/Metering/PendingCalculation.py | 105 +++ CIM16/IEC61968/Metering/Reading.py | 122 +++ CIM16/IEC61968/Metering/ReadingMultiplier.py | 45 ++ CIM16/IEC61968/Metering/ReadingQuality.py | 85 +++ CIM16/IEC61968/Metering/ReadingType.py | 169 +++++ CIM16/IEC61968/Metering/Register.py | 88 +++ CIM16/IEC61968/Metering/SDPLocation.py | 87 +++ .../IEC61968/Metering/ServiceDeliveryPoint.py | 320 ++++++++ .../Metering/SimpleEndDeviceFunction.py | 43 ++ CIM16/IEC61968/Metering/__init__.py | 65 ++ .../PaymentMetering/AccountMovement.py | 49 ++ .../PaymentMetering/AccountingUnit.py | 53 ++ .../PaymentMetering/AuxiliaryAccount.py | 144 ++++ .../PaymentMetering/AuxiliaryAgreement.py | 126 ++++ .../PaymentMetering/BankAccountDetail.py | 57 ++ CIM16/IEC61968/PaymentMetering/Card.py | 75 ++ CIM16/IEC61968/PaymentMetering/Cashier.py | 71 ++ .../IEC61968/PaymentMetering/CashierShift.py | 136 ++++ CIM16/IEC61968/PaymentMetering/Charge.py | 196 +++++ CIM16/IEC61968/PaymentMetering/Cheque.py | 81 ++ .../ConsumptionTariffInterval.py | 143 ++++ CIM16/IEC61968/PaymentMetering/Due.py | 57 ++ CIM16/IEC61968/PaymentMetering/LineDetail.py | 53 ++ .../PaymentMetering/MerchantAccount.py | 126 ++++ .../PaymentMetering/MerchantAgreement.py | 65 ++ CIM16/IEC61968/PaymentMetering/PointOfSale.py | 69 ++ CIM16/IEC61968/PaymentMetering/Receipt.py | 143 ++++ .../PaymentMetering/ServiceSupplier.py | 125 ++++ CIM16/IEC61968/PaymentMetering/Shift.py | 65 ++ .../IEC61968/PaymentMetering/TariffProfile.py | 139 ++++ CIM16/IEC61968/PaymentMetering/Tender.py | 112 +++ .../PaymentMetering/TimeTariffInterval.py | 143 ++++ CIM16/IEC61968/PaymentMetering/Transaction.py | 246 ++++++ CIM16/IEC61968/PaymentMetering/Transactor.py | 71 ++ CIM16/IEC61968/PaymentMetering/Vendor.py | 65 ++ CIM16/IEC61968/PaymentMetering/VendorShift.py | 139 ++++ CIM16/IEC61968/PaymentMetering/__init__.py | 78 ++ CIM16/IEC61968/Work/Work.py | 289 ++++++++ CIM16/IEC61968/Work/__init__.py | 33 + CIM16/IEC61968/__init__.py | 28 + .../AuxiliaryEquipment/AuxiliaryEquipment.py | 60 ++ .../AuxiliaryEquipment/CurrentTransformer.py | 84 +++ .../AuxiliaryEquipment/FaultIndicator.py | 60 ++ .../PotentialTransformer.py | 72 ++ CIM16/IEC61970/AuxiliaryEquipment/Sensor.py | 39 + .../AuxiliaryEquipment/SurgeProtector.py | 60 ++ CIM16/IEC61970/AuxiliaryEquipment/__init__.py | 31 + CIM16/IEC61970/Contingency/Contingency.py | 69 ++ .../Contingency/ContingencyElement.py | 60 ++ .../Contingency/ContingencyEquipment.py | 64 ++ CIM16/IEC61970/Contingency/__init__.py | 35 + .../ControlArea/AltGeneratingUnitMeas.py | 85 +++ CIM16/IEC61970/ControlArea/AltTieMeas.py | 85 +++ CIM16/IEC61970/ControlArea/ControlArea.py | 123 +++ .../ControlArea/ControlAreaGeneratingUnit.py | 107 +++ CIM16/IEC61970/ControlArea/TieFlow.py | 111 +++ CIM16/IEC61970/ControlArea/__init__.py | 37 + CIM16/IEC61970/Core/BasePower.py | 43 ++ CIM16/IEC61970/Core/BaseVoltage.py | 147 ++++ CIM16/IEC61970/Core/BasicIntervalSchedule.py | 59 ++ CIM16/IEC61970/Core/Bay.py | 97 +++ CIM16/IEC61970/Core/ConductingEquipment.py | 189 +++++ CIM16/IEC61970/Core/ConnectivityNode.py | 107 +++ .../Core/ConnectivityNodeContainer.py | 91 +++ CIM16/IEC61970/Core/Curve.py | 101 +++ CIM16/IEC61970/Core/CurveData.py | 76 ++ CIM16/IEC61970/Core/Equipment.py | 125 ++++ CIM16/IEC61970/Core/EquipmentContainer.py | 65 ++ CIM16/IEC61970/Core/GeographicalRegion.py | 65 ++ CIM16/IEC61970/Core/IdentifiedObject.py | 124 ++++ .../Core/IrregularIntervalSchedule.py | 65 ++ CIM16/IEC61970/Core/IrregularTimePoint.py | 72 ++ CIM16/IEC61970/Core/Name.py | 85 +++ CIM16/IEC61970/Core/NameType.py | 94 +++ CIM16/IEC61970/Core/NameTypeAuthority.py | 73 ++ CIM16/IEC61970/Core/OperatingParticipant.py | 65 ++ CIM16/IEC61970/Core/OperatingShare.py | 85 +++ CIM16/IEC61970/Core/PSRType.py | 65 ++ CIM16/IEC61970/Core/PowerSystemResource.py | 436 +++++++++++ CIM16/IEC61970/Core/PsrList.py | 74 ++ .../IEC61970/Core/RegularIntervalSchedule.py | 73 ++ CIM16/IEC61970/Core/RegularTimePoint.py | 72 ++ CIM16/IEC61970/Core/ReportingGroup.py | 144 ++++ CIM16/IEC61970/Core/ReportingSuperGroup.py | 65 ++ CIM16/IEC61970/Core/SubGeographicalRegion.py | 112 +++ CIM16/IEC61970/Core/Substation.py | 112 +++ CIM16/IEC61970/Core/Terminal.py | 407 ++++++++++ CIM16/IEC61970/Core/VoltageLevel.py | 115 +++ CIM16/IEC61970/Core/__init__.py | 83 +++ CIM16/IEC61970/CutsJumpers/Clamp.py | 63 ++ CIM16/IEC61970/CutsJumpers/Cut.py | 63 ++ CIM16/IEC61970/CutsJumpers/__init__.py | 27 + CIM16/IEC61970/Domain/DateTimeInterval.py | 45 ++ CIM16/IEC61970/Domain/__init__.py | 267 +++++++ .../Dynamics/DynamicsFunctionBlock.py | 41 + .../Dynamics/RotatingMachineDynamics.py | 53 ++ .../Dynamics/SynchronousMachineDetailed.py | 47 ++ .../Dynamics/SynchronousMachineDynamics.py | 39 + .../SynchronousMachineEquivalentCircuit.py | 61 ++ .../Dynamics/SynchronousMachineSimplified.py | 39 + ...SynchronousMachineTimeConstantReactance.py | 67 ++ .../Dynamics/SynchronousMachineUserDefined.py | 41 + CIM16/IEC61970/Dynamics/__init__.py | 35 + .../IEC61970/Equivalents/EquivalentBranch.py | 47 ++ .../Equivalents/EquivalentEquipment.py | 60 ++ .../Equivalents/EquivalentInjection.py | 59 ++ .../IEC61970/Equivalents/EquivalentNetwork.py | 65 ++ CIM16/IEC61970/Equivalents/EquivalentShunt.py | 47 ++ CIM16/IEC61970/Equivalents/__init__.py | 32 + .../GenerationDynamics/BWRSteamSupply.py | 123 +++ .../CTTempActivePowerCurve.py | 59 ++ .../GenerationDynamics/CombustionTurbine.py | 132 ++++ .../GenerationDynamics/DrumBoiler.py | 43 ++ .../GenerationDynamics/FossilSteamSupply.py | 143 ++++ .../GenerationDynamics/HeatRecoveryBoiler.py | 69 ++ .../GenerationDynamics/HydroTurbine.py | 83 +++ .../GenerationDynamics/PWRSteamSupply.py | 119 +++ .../GenerationDynamics/PrimeMover.py | 75 ++ .../GenerationDynamics/SteamSupply.py | 75 ++ .../GenerationDynamics/SteamTurbine.py | 119 +++ .../GenerationDynamics/Subcritical.py | 39 + .../GenerationDynamics/Supercritical.py | 39 + .../Generation/GenerationDynamics/__init__.py | 50 ++ .../Generation/Production/AirCompressor.py | 83 +++ .../Generation/Production/CAESPlant.py | 87 +++ .../Production/CogenerationPlant.py | 105 +++ .../Production/CombinedCyclePlant.py | 69 ++ .../Generation/Production/EmissionAccount.py | 68 ++ .../Generation/Production/EmissionCurve.py | 72 ++ .../Generation/Production/FossilFuel.py | 126 ++++ .../Production/FuelAllocationSchedule.py | 101 +++ .../Production/GenUnitOpCostCurve.py | 64 ++ .../Production/GenUnitOpSchedule.py | 59 ++ .../Generation/Production/GeneratingUnit.py | 335 +++++++++ .../Production/GrossToNetActivePowerCurve.py | 60 ++ .../Generation/Production/HeatInputCurve.py | 79 ++ .../Generation/Production/HeatRateCurve.py | 63 ++ .../HydroGeneratingEfficiencyCurve.py | 60 ++ .../Production/HydroGeneratingUnit.py | 140 ++++ .../Generation/Production/HydroPowerPlant.py | 169 +++++ .../Generation/Production/HydroPump.py | 116 +++ .../Production/HydroPumpOpSchedule.py | 59 ++ .../Production/IncrementalHeatRateCurve.py | 63 ++ .../Generation/Production/InflowForecast.py | 60 ++ .../Production/LevelVsVolumeCurve.py | 60 ++ .../Production/NuclearGeneratingUnit.py | 39 + .../Production/PenstockLossCurve.py | 59 ++ .../Generation/Production/Reservoir.py | 254 +++++++ .../Generation/Production/ShutdownCurve.py | 67 ++ .../Production/StartIgnFuelCurve.py | 63 ++ .../Production/StartMainFuelCurve.py | 63 ++ .../Generation/Production/StartRampCurve.py | 63 ++ .../Generation/Production/StartupModel.py | 159 ++++ .../Production/SteamSendoutSchedule.py | 59 ++ .../Generation/Production/TailbayLossCurve.py | 60 ++ .../Production/TargetLevelSchedule.py | 67 ++ .../Production/ThermalGeneratingUnit.py | 309 ++++++++ .../Production/WindGeneratingUnit.py | 39 + .../Generation/Production/__init__.py | 131 ++++ CIM16/IEC61970/Generation/__init__.py | 27 + CIM16/IEC61970/Graphics/DiagramObject.py | 180 +++++ .../Graphics/DiagramObjectGluePoint.py | 65 ++ CIM16/IEC61970/Graphics/DiagramObjectPoint.py | 97 +++ CIM16/IEC61970/Graphics/DiagramObjectStyle.py | 65 ++ CIM16/IEC61970/Graphics/TextDiagramObject.py | 43 ++ CIM16/IEC61970/Graphics/VisibilityLayer.py | 75 ++ CIM16/IEC61970/Graphics/__init__.py | 36 + CIM16/IEC61970/IEC61970CIMVersion.py | 50 ++ .../InfAssetModels/AssetModelCatalogue.py | 69 ++ .../InfAssetModels/AssetModelCatalogueItem.py | 133 ++++ .../InfAssetModels/TransformerAssetModel.py | 140 ++++ .../Informative/InfAssetModels/__init__.py | 53 ++ .../Informative/InfAssets/AssetAssetRole.py | 79 ++ .../InfAssets/AssetPropertyCurve.py | 90 +++ .../Informative/InfAssets/BreakerInfo.py | 43 ++ .../IEC61970/Informative/InfAssets/Bushing.py | 103 +++ .../InfAssets/BushingInsulationPF.py | 88 +++ .../IEC61970/Informative/InfAssets/Cabinet.py | 39 + .../Informative/InfAssets/ComEquipment.py | 65 ++ .../InfAssets/CompositeSwitchInfo.py | 75 ++ .../Informative/InfAssets/ConductorAsset.py | 91 +++ .../InfAssets/CurrentTransformerInfo.py | 139 ++++ .../Informative/InfAssets/DimensionsInfo.py | 140 ++++ .../Informative/InfAssets/DocAssetRole.py | 79 ++ CIM16/IEC61970/Informative/InfAssets/Duct.py | 92 +++ .../Informative/InfAssets/DuctBank.py | 68 ++ .../Informative/InfAssets/ElectricalInfo.py | 107 +++ .../Informative/InfAssets/FACTSDevice.py | 43 ++ .../Informative/InfAssets/Facility.py | 43 ++ .../Informative/InfAssets/FailureEvent.py | 55 ++ .../InfAssets/FaultIndicatorInfo.py | 69 ++ .../Informative/InfAssets/FinancialInfo.py | 102 +++ .../InfAssets/GenericAssetModelOrMaterial.py | 210 ++++++ CIM16/IEC61970/Informative/InfAssets/Joint.py | 51 ++ .../IEC61970/Informative/InfAssets/Medium.py | 98 +++ .../InfAssets/MountingConnection.py | 101 +++ .../Informative/InfAssets/MountingPoint.py | 107 +++ .../Informative/InfAssets/OrgAssetRole.py | 83 +++ CIM16/IEC61970/Informative/InfAssets/Pole.py | 109 +++ .../InfAssets/PotentialTransformerInfo.py | 96 +++ .../Informative/InfAssets/PowerRating.py | 82 ++ .../Informative/InfAssets/Procedure.py | 168 +++++ .../Informative/InfAssets/ProcedureDataSet.py | 157 ++++ .../InfAssets/ProtectionEquipmentInfo.py | 47 ++ .../Informative/InfAssets/RecloserInfo.py | 59 ++ .../Informative/InfAssets/ReliabilityInfo.py | 98 +++ CIM16/IEC61970/Informative/InfAssets/SVC.py | 47 ++ .../InfAssets/ShuntCompensatorInfo.py | 63 ++ .../InfAssets/ShuntImpedanceInfo.py | 132 ++++ .../Informative/InfAssets/Specification.py | 228 ++++++ .../Informative/InfAssets/Streetlight.py | 72 ++ .../Informative/InfAssets/Structure.py | 123 +++ .../Informative/InfAssets/StructureSupport.py | 87 +++ .../Informative/InfAssets/SubstationAsset.py | 43 ++ .../InfAssets/SurgeProtectorInfo.py | 81 ++ .../Informative/InfAssets/SwitchInfo.py | 75 ++ .../Informative/InfAssets/TestDataSet.py | 51 ++ CIM16/IEC61970/Informative/InfAssets/Tool.py | 63 ++ CIM16/IEC61970/Informative/InfAssets/Tower.py | 43 ++ .../Informative/InfAssets/TransformerAsset.py | 139 ++++ .../InfAssets/TransformerObservation.py | 217 ++++++ .../InfAssets/UndergroundStructure.py | 55 ++ .../IEC61970/Informative/InfAssets/Vehicle.py | 71 ++ .../InfAssets/WindingInsulation.py | 136 ++++ .../Informative/InfAssets/WorkEquipment.py | 84 +++ .../Informative/InfAssets/__init__.py | 210 ++++++ CIM16/IEC61970/Informative/InfCommon/Bank.py | 77 ++ .../Informative/InfCommon/BankAccount.py | 85 +++ .../Informative/InfCommon/BusinessPlan.py | 39 + .../Informative/InfCommon/BusinessRole.py | 79 ++ CIM16/IEC61970/Informative/InfCommon/Craft.py | 141 ++++ .../Informative/InfCommon/DocDocRole.py | 79 ++ .../Informative/InfCommon/DocPsrRole.py | 79 ++ CIM16/IEC61970/Informative/InfCommon/Ratio.py | 45 ++ CIM16/IEC61970/Informative/InfCommon/Role.py | 48 ++ .../InfCommon/ScheduleParameterInfo.py | 132 ++++ .../Informative/InfCommon/ScheduledEvent.py | 162 ++++ CIM16/IEC61970/Informative/InfCommon/Skill.py | 135 ++++ .../Informative/InfCommon/__init__.py | 44 ++ .../Informative/InfCore/ModelingAuthority.py | 65 ++ .../InfCore/ModelingAuthoritySet.py | 86 +++ .../IEC61970/Informative/InfCore/__init__.py | 27 + .../InfCustomers/ComplianceEvent.py | 43 ++ .../InfCustomers/CustomerBillingInfo.py | 122 +++ .../InfCustomers/ExternalCustomerAgreement.py | 39 + .../Informative/InfCustomers/OutageHistory.py | 65 ++ .../InfCustomers/PowerQualityPricing.py | 75 ++ .../InfCustomers/ServiceGuarantee.py | 57 ++ .../InfCustomers/StandardIndustryCode.py | 68 ++ .../InfCustomers/SubscribePowerCurve.py | 39 + .../InfCustomers/WorkBillingInfo.py | 143 ++++ .../Informative/InfCustomers/__init__.py | 41 + .../InfERPSupport/DocErpPersonRole.py | 79 ++ .../Informative/InfERPSupport/DocOrgRole.py | 79 ++ .../Informative/InfERPSupport/ErpBOM.py | 84 +++ .../InfERPSupport/ErpBankAccount.py | 43 ++ .../InfERPSupport/ErpBomItemData.py | 99 +++ .../InfERPSupport/ErpChartOfAccounts.py | 39 + .../InfERPSupport/ErpCompetency.py | 64 ++ .../InfERPSupport/ErpEngChangeOrder.py | 39 + .../Informative/InfERPSupport/ErpInventory.py | 63 ++ .../InfERPSupport/ErpInventoryCount.py | 84 +++ .../Informative/InfERPSupport/ErpInvoice.py | 120 +++ .../InfERPSupport/ErpInvoiceLineItem.py | 368 +++++++++ .../InfERPSupport/ErpIssueInventory.py | 84 +++ .../InfERPSupport/ErpItemMaster.py | 63 ++ .../Informative/InfERPSupport/ErpJournal.py | 64 ++ .../InfERPSupport/ErpJournalEntry.py | 216 ++++++ .../InfERPSupport/ErpLedBudLineItem.py | 83 +++ .../Informative/InfERPSupport/ErpLedger.py | 64 ++ .../InfERPSupport/ErpLedgerBudget.py | 64 ++ .../InfERPSupport/ErpLedgerEntry.py | 153 ++++ .../InfERPSupport/ErpOrganisation.py | 389 ++++++++++ .../InfERPSupport/ErpPOLineItem.py | 137 ++++ .../Informative/InfERPSupport/ErpPayable.py | 95 +++ .../InfERPSupport/ErpPayableLineItem.py | 145 ++++ .../Informative/InfERPSupport/ErpPayment.py | 136 ++++ .../Informative/InfERPSupport/ErpPerson.py | 536 +++++++++++++ .../Informative/InfERPSupport/ErpPersonnel.py | 69 ++ .../InfERPSupport/ErpProjectAccounting.py | 139 ++++ .../InfERPSupport/ErpPurchaseOrder.py | 64 ++ .../Informative/InfERPSupport/ErpQuote.py | 64 ++ .../InfERPSupport/ErpQuoteLineItem.py | 161 ++++ .../InfERPSupport/ErpRecDelvLineItem.py | 164 ++++ .../InfERPSupport/ErpRecLineItem.py | 145 ++++ .../InfERPSupport/ErpReceivable.py | 64 ++ .../InfERPSupport/ErpReceiveDelivery.py | 64 ++ .../InfERPSupport/ErpReqLineItem.py | 158 ++++ .../InfERPSupport/ErpRequisition.py | 64 ++ .../InfERPSupport/ErpSalesOrder.py | 39 + .../InfERPSupport/ErpSiteLevelData.py | 64 ++ .../Informative/InfERPSupport/ErpTimeEntry.py | 84 +++ .../Informative/InfERPSupport/ErpTimeSheet.py | 64 ++ .../InfERPSupport/OrgErpPersonRole.py | 83 +++ .../Informative/InfERPSupport/OrgOrgRole.py | 83 +++ .../Informative/InfERPSupport/__init__.py | 90 +++ .../Informative/InfGMLSupport/Diagram.py | 171 +++++ .../InfGMLSupport/GmlBaseSymbol.py | 64 ++ .../Informative/InfGMLSupport/GmlColour.py | 126 ++++ .../InfGMLSupport/GmlDiagramObject.py | 288 +++++++ .../InfGMLSupport/GmlFeatureStyle.py | 204 +++++ .../InfGMLSupport/GmlFeatureType.py | 70 ++ .../Informative/InfGMLSupport/GmlFill.py | 175 +++++ .../Informative/InfGMLSupport/GmlFont.py | 135 ++++ .../InfGMLSupport/GmlGeometryStyle.py | 91 +++ .../Informative/InfGMLSupport/GmlGraphic.py | 123 +++ .../Informative/InfGMLSupport/GmlHalo.py | 72 ++ .../InfGMLSupport/GmlLabelPlacement.py | 92 +++ .../InfGMLSupport/GmlLabelStyle.py | 121 +++ .../InfGMLSupport/GmlLineGeometry.py | 43 ++ .../InfGMLSupport/GmlLineSymbol.py | 83 +++ .../Informative/InfGMLSupport/GmlMark.py | 136 ++++ .../InfGMLSupport/GmlObservation.py | 136 ++++ .../InfGMLSupport/GmlPointGeometry.py | 39 + .../InfGMLSupport/GmlPointSymbol.py | 79 ++ .../InfGMLSupport/GmlPolygonGeometry.py | 39 + .../InfGMLSupport/GmlPolygonSymbol.py | 99 +++ .../Informative/InfGMLSupport/GmlPosition.py | 39 + .../InfGMLSupport/GmlRasterSymbol.py | 91 +++ .../Informative/InfGMLSupport/GmlSelector.py | 95 +++ .../Informative/InfGMLSupport/GmlStroke.py | 199 +++++ .../InfGMLSupport/GmlSvgParameter.py | 140 ++++ .../Informative/InfGMLSupport/GmlSymbol.py | 102 +++ .../InfGMLSupport/GmlTextSymbol.py | 159 ++++ .../InfGMLSupport/GmlTopologyStyle.py | 79 ++ .../Informative/InfGMLSupport/GmlValue.py | 91 +++ .../IEC61970/Informative/InfGMLSupport/Map.py | 47 ++ .../Informative/InfGMLSupport/__init__.py | 68 ++ .../InfLoadControl/LoadLimitFunction.py | 55 ++ .../InfLoadControl/LoadMgmtFunction.py | 119 +++ .../InfLoadControl/LoadMgmtRecord.py | 63 ++ .../InfLoadControl/LoadShedFunction.py | 43 ++ .../Informative/InfLoadControl/__init__.py | 39 + .../Informative/InfLocations/Direction.py | 63 ++ .../Informative/InfLocations/Hazard.py | 80 ++ .../Informative/InfLocations/LandProperty.py | 258 +++++++ .../Informative/InfLocations/LocationGrant.py | 64 ++ .../InfLocations/OrgPropertyRole.py | 90 +++ .../InfLocations/PersonPropertyRole.py | 79 ++ .../Informative/InfLocations/RedLine.py | 75 ++ .../Informative/InfLocations/RightOfWay.py | 75 ++ .../Informative/InfLocations/Route.py | 104 +++ .../IEC61970/Informative/InfLocations/Zone.py | 43 ++ .../Informative/InfLocations/__init__.py | 50 ++ .../InfMetering/GasMeteringFunction.py | 39 + .../InfMetering/WaterMeteringFunction.py | 39 + .../Informative/InfMetering/__init__.py | 27 + .../Informative/InfOperations/CallBack.py | 151 ++++ .../Informative/InfOperations/ChangeItem.py | 252 +++++++ .../Informative/InfOperations/ChangeSet.py | 131 ++++ .../Informative/InfOperations/Circuit.py | 70 ++ .../InfOperations/CircuitSection.py | 99 +++ .../ErpPersonScheduleStepRole.py | 78 ++ .../Informative/InfOperations/IncidentCode.py | 74 ++ .../InfOperations/IncidentRecord.py | 101 +++ .../Informative/InfOperations/LandBase.py | 39 + .../InfOperations/NetworkDataSet.py | 166 +++++ .../InfOperations/OperationalRestriction.py | 45 ++ .../Informative/InfOperations/OrgPsrRole.py | 79 ++ .../Informative/InfOperations/OutageCode.py | 105 +++ .../InfOperations/OutageNotification.py | 82 ++ .../Informative/InfOperations/OutageRecord.py | 135 ++++ .../Informative/InfOperations/OutageReport.py | 96 +++ .../Informative/InfOperations/OutageStep.py | 206 +++++ .../InfOperations/OutageStepPsrRole.py | 79 ++ .../Informative/InfOperations/PSREvent.py | 64 ++ .../InfOperations/PlannedOutage.py | 94 +++ .../InfOperations/SafetyDocument.py | 109 +++ .../InfOperations/SwitchingSchedule.py | 126 ++++ .../InfOperations/SwitchingStep.py | 151 ++++ .../InfOperations/TroubleTicket.py | 152 ++++ .../Informative/InfOperations/__init__.py | 81 ++ .../InfTypeAsset/GeneratorTypeAsset.py | 103 +++ .../InfTypeAsset/TypeAssetCatalogue.py | 69 ++ .../Informative/InfTypeAsset/__init__.py | 27 + .../Informative/InfWork/AccessPermit.py | 59 ++ .../Informative/InfWork/Appointment.py | 110 +++ .../Informative/InfWork/Assignment.py | 77 ++ .../Informative/InfWork/BusinessCase.py | 93 +++ .../Informative/InfWork/CUAllowableAction.py | 69 ++ CIM16/IEC61970/Informative/InfWork/CUAsset.py | 102 +++ .../Informative/InfWork/CUContractorItem.py | 83 +++ CIM16/IEC61970/Informative/InfWork/CUGroup.py | 162 ++++ .../Informative/InfWork/CULaborCode.py | 73 ++ .../Informative/InfWork/CULaborItem.py | 138 ++++ .../Informative/InfWork/CUMaterialItem.py | 134 ++++ .../InfWork/CUWorkEquipmentItem.py | 102 +++ .../Informative/InfWork/Capability.py | 140 ++++ .../Informative/InfWork/CompatibleUnit.py | 344 +++++++++ .../Informative/InfWork/ConditionFactor.py | 145 ++++ .../Informative/InfWork/ContractorItem.py | 127 ++++ .../IEC61970/Informative/InfWork/CostType.py | 186 +++++ CIM16/IEC61970/Informative/InfWork/Crew.py | 415 +++++++++++ CIM16/IEC61970/Informative/InfWork/Design.py | 258 +++++++ .../Informative/InfWork/DesignLocation.py | 272 +++++++ .../Informative/InfWork/DesignLocationCU.py | 243 ++++++ .../Informative/InfWork/DiagnosisDataSet.py | 91 +++ .../Informative/InfWork/EquipmentItem.py | 92 +++ .../Informative/InfWork/InfoQuestion.py | 67 ++ .../Informative/InfWork/InspectionDataSet.py | 68 ++ .../IEC61970/Informative/InfWork/LaborItem.py | 131 ++++ .../Informative/InfWork/MaintenanceDataSet.py | 51 ++ .../Informative/InfWork/MaterialItem.py | 258 +++++++ .../Informative/InfWork/MiscCostItem.py | 124 ++++ .../Informative/InfWork/NonStandardItem.py | 47 ++ .../Informative/InfWork/OneCallRequest.py | 76 ++ .../Informative/InfWork/OverheadCost.py | 102 +++ CIM16/IEC61970/Informative/InfWork/Project.py | 184 +++++ .../Informative/InfWork/PropertyUnit.py | 143 ++++ .../InfWork/QualificationRequirement.py | 167 +++++ .../Informative/InfWork/Regulation.py | 43 ++ CIM16/IEC61970/Informative/InfWork/Request.py | 146 ++++ .../Informative/InfWork/ShiftPattern.py | 89 +++ .../Informative/InfWork/TypeMaterial.py | 155 ++++ CIM16/IEC61970/Informative/InfWork/Usage.py | 104 +++ .../Informative/InfWork/WorkCostDetail.py | 361 +++++++++ .../Informative/InfWork/WorkCostSummary.py | 58 ++ .../Informative/InfWork/WorkFlowStep.py | 93 +++ .../Informative/InfWork/WorkLocation.py | 106 +++ .../Informative/InfWork/WorkStatusEntry.py | 43 ++ .../IEC61970/Informative/InfWork/WorkTask.py | 477 ++++++++++++ .../IEC61970/Informative/InfWork/__init__.py | 88 +++ CIM16/IEC61970/Informative/__init__.py | 27 + CIM16/IEC61970/LoadModel/ConformLoad.py | 60 ++ CIM16/IEC61970/LoadModel/ConformLoadGroup.py | 91 +++ .../IEC61970/LoadModel/ConformLoadSchedule.py | 60 ++ CIM16/IEC61970/LoadModel/DayType.py | 65 ++ CIM16/IEC61970/LoadModel/EnergyArea.py | 59 ++ CIM16/IEC61970/LoadModel/LoadArea.py | 65 ++ CIM16/IEC61970/LoadModel/LoadGroup.py | 60 ++ .../LoadModel/LoadResponseCharacteristic.py | 109 +++ CIM16/IEC61970/LoadModel/NonConformLoad.py | 60 ++ .../IEC61970/LoadModel/NonConformLoadGroup.py | 91 +++ .../LoadModel/NonConformLoadSchedule.py | 60 ++ CIM16/IEC61970/LoadModel/PowerCutZone.py | 73 ++ CIM16/IEC61970/LoadModel/Season.py | 77 ++ .../LoadModel/SeasonDayTypeSchedule.py | 81 ++ CIM16/IEC61970/LoadModel/StationSupply.py | 39 + CIM16/IEC61970/LoadModel/SubLoadArea.py | 86 +++ CIM16/IEC61970/LoadModel/__init__.py | 48 ++ CIM16/IEC61970/Meas/Accumulator.py | 101 +++ CIM16/IEC61970/Meas/AccumulatorLimit.py | 64 ++ CIM16/IEC61970/Meas/AccumulatorLimitSet.py | 97 +++ CIM16/IEC61970/Meas/AccumulatorValue.py | 64 ++ CIM16/IEC61970/Meas/Analog.py | 133 ++++ CIM16/IEC61970/Meas/AnalogLimit.py | 64 ++ CIM16/IEC61970/Meas/AnalogLimitSet.py | 97 +++ CIM16/IEC61970/Meas/AnalogValue.py | 116 +++ CIM16/IEC61970/Meas/Command.py | 88 +++ CIM16/IEC61970/Meas/Control.py | 117 +++ CIM16/IEC61970/Meas/ControlType.py | 65 ++ CIM16/IEC61970/Meas/Discrete.py | 118 +++ CIM16/IEC61970/Meas/DiscreteValue.py | 64 ++ CIM16/IEC61970/Meas/Limit.py | 70 ++ CIM16/IEC61970/Meas/LimitSet.py | 43 ++ CIM16/IEC61970/Meas/Measurement.py | 180 +++++ CIM16/IEC61970/Meas/MeasurementValue.py | 184 +++++ .../IEC61970/Meas/MeasurementValueQuality.py | 59 ++ CIM16/IEC61970/Meas/MeasurementValueSource.py | 65 ++ CIM16/IEC61970/Meas/Quality61850.py | 87 +++ CIM16/IEC61970/Meas/SetPoint.py | 75 ++ CIM16/IEC61970/Meas/StringMeasurement.py | 65 ++ CIM16/IEC61970/Meas/StringMeasurementValue.py | 64 ++ CIM16/IEC61970/Meas/ValueAliasSet.py | 117 +++ CIM16/IEC61970/Meas/ValueToAlias.py | 64 ++ CIM16/IEC61970/Meas/__init__.py | 57 ++ .../OperationalLimits/ActivePowerLimit.py | 63 ++ .../OperationalLimits/ActivePowerLimitSet.py | 62 ++ .../OperationalLimits/ApparentPowerLimit.py | 63 ++ .../ApparentPowerLimitSet.py | 62 ++ .../IEC61970/OperationalLimits/BranchGroup.py | 89 +++ .../OperationalLimits/BranchGroupTerminal.py | 85 +++ .../OperationalLimits/CurrentLimit.py | 63 ++ .../OperationalLimits/CurrentLimitSet.py | 62 ++ .../OperationalLimits/OperationalLimit.py | 81 ++ .../OperationalLimits/OperationalLimitSet.py | 86 +++ .../OperationalLimits/OperationalLimitType.py | 73 ++ .../OperationalLimits/VoltageLimit.py | 63 ++ .../OperationalLimits/VoltageLimitSet.py | 62 ++ CIM16/IEC61970/OperationalLimits/__init__.py | 45 ++ CIM16/IEC61970/Outage/ClearanceTag.py | 133 ++++ CIM16/IEC61970/Outage/ClearanceTagType.py | 65 ++ CIM16/IEC61970/Outage/OutageSchedule.py | 105 +++ CIM16/IEC61970/Outage/SwitchingOperation.py | 100 +++ CIM16/IEC61970/Outage/__init__.py | 36 + CIM16/IEC61970/Protection/CurrentRelay.py | 67 ++ .../Protection/ProtectionEquipment.py | 127 ++++ CIM16/IEC61970/Protection/RecloseSequence.py | 68 ++ .../IEC61970/Protection/SynchrocheckRelay.py | 51 ++ CIM16/IEC61970/Protection/__init__.py | 31 + CIM16/IEC61970/SCADA/CommunicationLink.py | 71 ++ CIM16/IEC61970/SCADA/RemoteControl.py | 71 ++ CIM16/IEC61970/SCADA/RemotePoint.py | 60 ++ CIM16/IEC61970/SCADA/RemoteSource.py | 75 ++ CIM16/IEC61970/SCADA/RemoteUnit.py | 101 +++ CIM16/IEC61970/SCADA/__init__.py | 42 ++ .../IEC61970/StateVariables/StateVariable.py | 39 + CIM16/IEC61970/StateVariables/SvInjection.py | 67 ++ CIM16/IEC61970/StateVariables/SvPowerFlow.py | 67 ++ .../IEC61970/StateVariables/SvShortCircuit.py | 75 ++ .../SvShuntCompensatorSections.py | 63 ++ CIM16/IEC61970/StateVariables/SvStatus.py | 63 ++ CIM16/IEC61970/StateVariables/SvTapStep.py | 63 ++ CIM16/IEC61970/StateVariables/SvVoltage.py | 67 ++ .../StateVariables/TopologicalIsland.py | 85 +++ CIM16/IEC61970/StateVariables/__init__.py | 36 + CIM16/IEC61970/Topology/BusNameMarker.py | 86 +++ CIM16/IEC61970/Topology/TopologicalNode.py | 255 +++++++ CIM16/IEC61970/Topology/__init__.py | 29 + CIM16/IEC61970/Wires/ACLineSegment.py | 251 +++++++ CIM16/IEC61970/Wires/Breaker.py | 43 ++ CIM16/IEC61970/Wires/BusbarSection.py | 59 ++ CIM16/IEC61970/Wires/CompositeSwitch.py | 69 ++ CIM16/IEC61970/Wires/Conductor.py | 43 ++ CIM16/IEC61970/Wires/Connector.py | 39 + CIM16/IEC61970/Wires/DCLineSegment.py | 47 ++ CIM16/IEC61970/Wires/Disconnector.py | 39 + CIM16/IEC61970/Wires/EnergyConsumer.py | 155 ++++ CIM16/IEC61970/Wires/EnergySource.py | 79 ++ CIM16/IEC61970/Wires/FrequencyConverter.py | 63 ++ CIM16/IEC61970/Wires/Fuse.py | 39 + CIM16/IEC61970/Wires/Ground.py | 64 ++ CIM16/IEC61970/Wires/GroundDisconnector.py | 39 + CIM16/IEC61970/Wires/Jumper.py | 39 + CIM16/IEC61970/Wires/Junction.py | 39 + CIM16/IEC61970/Wires/Line.py | 60 ++ CIM16/IEC61970/Wires/LoadBreakSwitch.py | 39 + CIM16/IEC61970/Wires/MutualCoupling.py | 113 +++ .../IEC61970/Wires/PerLengthPhaseImpedance.py | 95 +++ .../Wires/PerLengthSequenceImpedance.py | 97 +++ CIM16/IEC61970/Wires/PhaseImpedanceData.py | 76 ++ CIM16/IEC61970/Wires/PhaseTapChanger.py | 79 ++ .../Wires/PhaseTapChangerAsymetrical.py | 43 ++ CIM16/IEC61970/Wires/PhaseTapChangerLinear.py | 43 ++ .../Wires/PhaseTapChangerNonLinear.py | 51 ++ .../Wires/PhaseTapChangerSymetrical.py | 39 + .../IEC61970/Wires/PhaseTapChangerTabular.py | 89 +++ .../Wires/PhaseTapChangerTabularPoint.py | 71 ++ CIM16/IEC61970/Wires/Plant.py | 39 + CIM16/IEC61970/Wires/PowerTransformer.py | 115 +++ CIM16/IEC61970/Wires/PowerTransformerEnd.py | 103 +++ CIM16/IEC61970/Wires/ProtectedSwitch.py | 101 +++ CIM16/IEC61970/Wires/RatioTapChanger.py | 89 +++ .../IEC61970/Wires/RatioTapChangerTabular.py | 89 +++ .../Wires/RatioTapChangerTabularPoint.py | 71 ++ .../IEC61970/Wires/ReactiveCapabilityCurve.py | 105 +++ CIM16/IEC61970/Wires/Recloser.py | 39 + CIM16/IEC61970/Wires/RectifierInverter.py | 87 +++ CIM16/IEC61970/Wires/RegulatingCondEq.py | 86 +++ CIM16/IEC61970/Wires/RegulatingControl.py | 134 ++++ CIM16/IEC61970/Wires/RegulationSchedule.py | 86 +++ CIM16/IEC61970/Wires/Resistor.py | 39 + CIM16/IEC61970/Wires/Sectionaliser.py | 39 + CIM16/IEC61970/Wires/SeriesCompensator.py | 47 ++ CIM16/IEC61970/Wires/ShuntCompensator.py | 144 ++++ CIM16/IEC61970/Wires/StaticVarCompensator.py | 59 ++ CIM16/IEC61970/Wires/Switch.py | 225 ++++++ CIM16/IEC61970/Wires/SwitchSchedule.py | 60 ++ CIM16/IEC61970/Wires/SynchronousMachine.py | 302 ++++++++ CIM16/IEC61970/Wires/TapChanger.py | 162 ++++ CIM16/IEC61970/Wires/TapChangerControl.py | 89 +++ CIM16/IEC61970/Wires/TapSchedule.py | 60 ++ .../Wires/TransformerCoreAdmittance.py | 99 +++ CIM16/IEC61970/Wires/TransformerEnd.py | 317 ++++++++ .../Wires/TransformerMeshImpedance.py | 161 ++++ .../Wires/TransformerStarImpedance.py | 81 ++ CIM16/IEC61970/Wires/TransformerTank.py | 158 ++++ CIM16/IEC61970/Wires/TransformerTankEnd.py | 64 ++ CIM16/IEC61970/Wires/VoltageControlZone.py | 80 ++ CIM16/IEC61970/Wires/__init__.py | 147 ++++ .../WiresPhaseModel/ACLineSegmentPhase.py | 59 ++ .../WiresPhaseModel/EnergyConsumerPhase.py | 61 ++ .../WiresPhaseModel/ShuntCompensatorPhase.py | 59 ++ CIM16/IEC61970/WiresPhaseModel/SwitchPhase.py | 71 ++ CIM16/IEC61970/WiresPhaseModel/__init__.py | 34 + CIM16/IEC61970/__init__.py | 28 + CIM16/IEC62325/IEC62325CIMVersion.py | 47 ++ CIM16/IEC62325/MarketParticipant.py | 69 ++ CIM16/IEC62325/MarketRole.py | 80 ++ CIM16/IEC62325/__init__.py | 33 + CIM16/Package.py | 37 + .../PackageDependenciesCIMVeresion.py | 47 ++ CIM16/PackageDependencies/__init__.py | 28 + CIM16/Stereotype.py | 37 + CIM16/__init__.py | 673 +++++++++++++++++ PyCIM/RDFXMLReader.py | 13 +- PyCIM/__init__.py | 3 +- 812 files changed, 74371 insertions(+), 5 deletions(-) create mode 100755 CIM16/CDPSM/Asset/Element.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/AssetModels/CableInfo.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/AssetModels/ConcentricNeutralCableInfo.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/AssetModels/ConductorInfo.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/AssetModels/EndDeviceInfo.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/AssetModels/OverheadConductorInfo.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/AssetModels/PowerTransformerInfo.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/AssetModels/TapChangerInfo.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/AssetModels/TapeShieldCableInfo.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/AssetModels/TransformerEndInfo.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/AssetModels/TransformerTankInfo.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/AssetModels/WireArrangement.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/AssetModels/WireType.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/AssetModels/__init__.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/Assets/AssetInfo.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/Assets/__init__.py create mode 100755 CIM16/CDPSM/Asset/IEC61968/__init__.py create mode 100755 CIM16/CDPSM/Asset/IEC61970/Core/IdentifiedObject.py create mode 100755 CIM16/CDPSM/Asset/IEC61970/Core/Name.py create mode 100755 CIM16/CDPSM/Asset/IEC61970/Core/NameType.py create mode 100755 CIM16/CDPSM/Asset/IEC61970/Core/__init__.py create mode 100755 CIM16/CDPSM/Asset/IEC61970/Wires/ACLineSegment.py create mode 100755 CIM16/CDPSM/Asset/IEC61970/Wires/PerLengthPhaseImpedance.py create mode 100755 CIM16/CDPSM/Asset/IEC61970/Wires/PerLengthSequenceImpedance.py create mode 100755 CIM16/CDPSM/Asset/IEC61970/Wires/TransformerCoreAdmittance.py create mode 100755 CIM16/CDPSM/Asset/IEC61970/Wires/TransformerEnd.py create mode 100755 CIM16/CDPSM/Asset/IEC61970/Wires/TransformerStarImpedance.py create mode 100755 CIM16/CDPSM/Asset/IEC61970/Wires/TransformerTank.py create mode 100755 CIM16/CDPSM/Asset/IEC61970/Wires/TransformerTankEnd.py create mode 100755 CIM16/CDPSM/Asset/IEC61970/Wires/__init__.py create mode 100755 CIM16/CDPSM/Asset/IEC61970/__init__.py create mode 100755 CIM16/CDPSM/Asset/__init__.py create mode 100755 CIM16/CDPSM/Balanced/Element.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Core/IdentifiedObject.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Core/Name.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Core/NameType.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Core/__init__.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Generation/Production/GeneratingUnit.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Generation/Production/__init__.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Generation/__init__.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/LoadModel/LoadResponseCharacteristic.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/LoadModel/__init__.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/ACLineSegment.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/DCLineSegment.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/EnergyConsumer.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/EnergySource.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChanger.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerAsymetrical.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerLinear.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerNonLinear.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerSymetrical.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/PowerTransformer.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/PowerTransformerEnd.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/ProtectedSwitch.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/RatioTapChanger.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/SeriesCompensator.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/ShuntCompensator.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/SynchronousMachine.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/TapChanger.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerCoreAdmittance.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerEnd.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerMeshImpedance.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerStarImpedance.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerTankEnd.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/Wires/__init__.py create mode 100755 CIM16/CDPSM/Balanced/IEC61970/__init__.py create mode 100755 CIM16/CDPSM/Balanced/__init__.py create mode 100755 CIM16/CDPSM/Connectivity/Element.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/BaseVoltage.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/Bay.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/ConductingEquipment.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/ConnectivityNode.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/ConnectivityNodeContainer.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/Equipment.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/EquipmentContainer.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/GeographicalRegion.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/IdentifiedObject.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/Name.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/NameType.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/NameTypeAuthority.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/PSRType.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/PowerSystemResource.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/SubGeographicalRegion.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/Substation.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/Terminal.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/VoltageLevel.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Core/__init__.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/ACLineSegment.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/Breaker.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/BusbarSection.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/Conductor.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/DCLineSegment.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/Disconnector.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/EnergyConsumer.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/EnergySource.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/Fuse.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/Ground.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/GroundDisconnector.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/Jumper.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/Junction.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/Line.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/LoadBreakSwitch.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/PowerTransformer.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/PowerTransformerEnd.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/Sectionaliser.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/SeriesCompensator.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/ShuntCompensator.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/Switch.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/SynchronousMachine.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/TransformerEnd.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/TransformerTank.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/TransformerTankEnd.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/Wires/__init__.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/WiresPhaseModel/ShuntCompensatorPhase.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/WiresPhaseModel/SwitchPhase.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/WiresPhaseModel/__init__.py create mode 100755 CIM16/CDPSM/Connectivity/IEC61970/__init__.py create mode 100755 CIM16/CDPSM/Connectivity/__init__.py create mode 100755 CIM16/CDPSM/Geographical/Element.py create mode 100755 CIM16/CDPSM/Geographical/IEC61968/Common/CoordinateSystem.py create mode 100755 CIM16/CDPSM/Geographical/IEC61968/Common/Location.py create mode 100755 CIM16/CDPSM/Geographical/IEC61968/Common/PositionPoint.py create mode 100755 CIM16/CDPSM/Geographical/IEC61968/Common/__init__.py create mode 100755 CIM16/CDPSM/Geographical/IEC61968/__init__.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Core/ConductingEquipment.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Core/Equipment.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Core/IdentifiedObject.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Core/Name.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Core/NameType.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Core/PowerSystemResource.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Core/__init__.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/ACLineSegment.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/Breaker.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/BusbarSection.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/DCLineSegment.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/Disconnector.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/EnergyConsumer.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/EnergySource.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/Fuse.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/GroundDisconnector.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/Jumper.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/Junction.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/Line.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/LoadBreakSwitch.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/PowerTransformer.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/SeriesCompensator.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/ShuntCompensator.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/SynchronousMachine.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/Wires/__init__.py create mode 100755 CIM16/CDPSM/Geographical/IEC61970/__init__.py create mode 100755 CIM16/CDPSM/Geographical/__init__.py create mode 100755 CIM16/CDPSM/__init__.py create mode 100755 CIM16/CombinedVersion.py create mode 100755 CIM16/Element.py create mode 100755 CIM16/IEC61968/AssetModels/CableInfo.py create mode 100755 CIM16/IEC61968/AssetModels/ConcentricNeutralCableInfo.py create mode 100755 CIM16/IEC61968/AssetModels/ConductorInfo.py create mode 100755 CIM16/IEC61968/AssetModels/EndDeviceInfo.py create mode 100755 CIM16/IEC61968/AssetModels/NoLoadTest.py create mode 100755 CIM16/IEC61968/AssetModels/OpenCircuitTest.py create mode 100755 CIM16/IEC61968/AssetModels/OverheadConductorInfo.py create mode 100755 CIM16/IEC61968/AssetModels/PowerTransformerInfo.py create mode 100755 CIM16/IEC61968/AssetModels/ShortCircuitTest.py create mode 100755 CIM16/IEC61968/AssetModels/TapChangerInfo.py create mode 100755 CIM16/IEC61968/AssetModels/TapeShieldCableInfo.py create mode 100755 CIM16/IEC61968/AssetModels/TransformerEndInfo.py create mode 100755 CIM16/IEC61968/AssetModels/TransformerTankInfo.py create mode 100755 CIM16/IEC61968/AssetModels/TransformerTest.py create mode 100755 CIM16/IEC61968/AssetModels/WireArrangement.py create mode 100755 CIM16/IEC61968/AssetModels/WireType.py create mode 100755 CIM16/IEC61968/AssetModels/__init__.py create mode 100755 CIM16/IEC61968/Assets/AcceptanceTest.py create mode 100755 CIM16/IEC61968/Assets/Asset.py create mode 100755 CIM16/IEC61968/Assets/AssetContainer.py create mode 100755 CIM16/IEC61968/Assets/AssetFunction.py create mode 100755 CIM16/IEC61968/Assets/AssetInfo.py create mode 100755 CIM16/IEC61968/Assets/AssetModel.py create mode 100755 CIM16/IEC61968/Assets/ComMedia.py create mode 100755 CIM16/IEC61968/Assets/ProductAssetModel.py create mode 100755 CIM16/IEC61968/Assets/Seal.py create mode 100755 CIM16/IEC61968/Assets/__init__.py create mode 100755 CIM16/IEC61968/Common/ActivityRecord.py create mode 100755 CIM16/IEC61968/Common/Agreement.py create mode 100755 CIM16/IEC61968/Common/CoordinateSystem.py create mode 100755 CIM16/IEC61968/Common/Document.py create mode 100755 CIM16/IEC61968/Common/ElectronicAddress.py create mode 100755 CIM16/IEC61968/Common/Location.py create mode 100755 CIM16/IEC61968/Common/Organisation.py create mode 100755 CIM16/IEC61968/Common/PositionPoint.py create mode 100755 CIM16/IEC61968/Common/PostalAddress.py create mode 100755 CIM16/IEC61968/Common/Status.py create mode 100755 CIM16/IEC61968/Common/StreetAddress.py create mode 100755 CIM16/IEC61968/Common/StreetDetail.py create mode 100755 CIM16/IEC61968/Common/TelephoneNumber.py create mode 100755 CIM16/IEC61968/Common/TimePoint.py create mode 100755 CIM16/IEC61968/Common/TimeSchedule.py create mode 100755 CIM16/IEC61968/Common/TownDetail.py create mode 100755 CIM16/IEC61968/Common/UserAttribute.py create mode 100755 CIM16/IEC61968/Common/__init__.py create mode 100755 CIM16/IEC61968/Customers/Customer.py create mode 100755 CIM16/IEC61968/Customers/CustomerAccount.py create mode 100755 CIM16/IEC61968/Customers/CustomerAgreement.py create mode 100755 CIM16/IEC61968/Customers/PricingStructure.py create mode 100755 CIM16/IEC61968/Customers/ServiceCategory.py create mode 100755 CIM16/IEC61968/Customers/ServiceLocation.py create mode 100755 CIM16/IEC61968/Customers/Tariff.py create mode 100755 CIM16/IEC61968/Customers/__init__.py create mode 100755 CIM16/IEC61968/IEC61968CIMVersion.py create mode 100755 CIM16/IEC61968/LoadControl/ConnectDisconnectFunction.py create mode 100755 CIM16/IEC61968/LoadControl/RemoteConnectDisconnectInfo.py create mode 100755 CIM16/IEC61968/LoadControl/__init__.py create mode 100755 CIM16/IEC61968/Metering/ComFunction.py create mode 100755 CIM16/IEC61968/Metering/DemandResponseProgram.py create mode 100755 CIM16/IEC61968/Metering/DynamicDemand.py create mode 100755 CIM16/IEC61968/Metering/ElectricMeteringFunction.py create mode 100755 CIM16/IEC61968/Metering/EndDevice.py create mode 100755 CIM16/IEC61968/Metering/EndDeviceControl.py create mode 100755 CIM16/IEC61968/Metering/EndDeviceEvent.py create mode 100755 CIM16/IEC61968/Metering/EndDeviceFunction.py create mode 100755 CIM16/IEC61968/Metering/EndDeviceGroup.py create mode 100755 CIM16/IEC61968/Metering/IntervalBlock.py create mode 100755 CIM16/IEC61968/Metering/IntervalReading.py create mode 100755 CIM16/IEC61968/Metering/Meter.py create mode 100755 CIM16/IEC61968/Metering/MeterReading.py create mode 100755 CIM16/IEC61968/Metering/MeterServiceWork.py create mode 100755 CIM16/IEC61968/Metering/PendingCalculation.py create mode 100755 CIM16/IEC61968/Metering/Reading.py create mode 100755 CIM16/IEC61968/Metering/ReadingMultiplier.py create mode 100755 CIM16/IEC61968/Metering/ReadingQuality.py create mode 100755 CIM16/IEC61968/Metering/ReadingType.py create mode 100755 CIM16/IEC61968/Metering/Register.py create mode 100755 CIM16/IEC61968/Metering/SDPLocation.py create mode 100755 CIM16/IEC61968/Metering/ServiceDeliveryPoint.py create mode 100755 CIM16/IEC61968/Metering/SimpleEndDeviceFunction.py create mode 100755 CIM16/IEC61968/Metering/__init__.py create mode 100755 CIM16/IEC61968/PaymentMetering/AccountMovement.py create mode 100755 CIM16/IEC61968/PaymentMetering/AccountingUnit.py create mode 100755 CIM16/IEC61968/PaymentMetering/AuxiliaryAccount.py create mode 100755 CIM16/IEC61968/PaymentMetering/AuxiliaryAgreement.py create mode 100755 CIM16/IEC61968/PaymentMetering/BankAccountDetail.py create mode 100755 CIM16/IEC61968/PaymentMetering/Card.py create mode 100755 CIM16/IEC61968/PaymentMetering/Cashier.py create mode 100755 CIM16/IEC61968/PaymentMetering/CashierShift.py create mode 100755 CIM16/IEC61968/PaymentMetering/Charge.py create mode 100755 CIM16/IEC61968/PaymentMetering/Cheque.py create mode 100755 CIM16/IEC61968/PaymentMetering/ConsumptionTariffInterval.py create mode 100755 CIM16/IEC61968/PaymentMetering/Due.py create mode 100755 CIM16/IEC61968/PaymentMetering/LineDetail.py create mode 100755 CIM16/IEC61968/PaymentMetering/MerchantAccount.py create mode 100755 CIM16/IEC61968/PaymentMetering/MerchantAgreement.py create mode 100755 CIM16/IEC61968/PaymentMetering/PointOfSale.py create mode 100755 CIM16/IEC61968/PaymentMetering/Receipt.py create mode 100755 CIM16/IEC61968/PaymentMetering/ServiceSupplier.py create mode 100755 CIM16/IEC61968/PaymentMetering/Shift.py create mode 100755 CIM16/IEC61968/PaymentMetering/TariffProfile.py create mode 100755 CIM16/IEC61968/PaymentMetering/Tender.py create mode 100755 CIM16/IEC61968/PaymentMetering/TimeTariffInterval.py create mode 100755 CIM16/IEC61968/PaymentMetering/Transaction.py create mode 100755 CIM16/IEC61968/PaymentMetering/Transactor.py create mode 100755 CIM16/IEC61968/PaymentMetering/Vendor.py create mode 100755 CIM16/IEC61968/PaymentMetering/VendorShift.py create mode 100755 CIM16/IEC61968/PaymentMetering/__init__.py create mode 100755 CIM16/IEC61968/Work/Work.py create mode 100755 CIM16/IEC61968/Work/__init__.py create mode 100755 CIM16/IEC61968/__init__.py create mode 100755 CIM16/IEC61970/AuxiliaryEquipment/AuxiliaryEquipment.py create mode 100755 CIM16/IEC61970/AuxiliaryEquipment/CurrentTransformer.py create mode 100755 CIM16/IEC61970/AuxiliaryEquipment/FaultIndicator.py create mode 100755 CIM16/IEC61970/AuxiliaryEquipment/PotentialTransformer.py create mode 100755 CIM16/IEC61970/AuxiliaryEquipment/Sensor.py create mode 100755 CIM16/IEC61970/AuxiliaryEquipment/SurgeProtector.py create mode 100755 CIM16/IEC61970/AuxiliaryEquipment/__init__.py create mode 100755 CIM16/IEC61970/Contingency/Contingency.py create mode 100755 CIM16/IEC61970/Contingency/ContingencyElement.py create mode 100755 CIM16/IEC61970/Contingency/ContingencyEquipment.py create mode 100755 CIM16/IEC61970/Contingency/__init__.py create mode 100755 CIM16/IEC61970/ControlArea/AltGeneratingUnitMeas.py create mode 100755 CIM16/IEC61970/ControlArea/AltTieMeas.py create mode 100755 CIM16/IEC61970/ControlArea/ControlArea.py create mode 100755 CIM16/IEC61970/ControlArea/ControlAreaGeneratingUnit.py create mode 100755 CIM16/IEC61970/ControlArea/TieFlow.py create mode 100755 CIM16/IEC61970/ControlArea/__init__.py create mode 100755 CIM16/IEC61970/Core/BasePower.py create mode 100755 CIM16/IEC61970/Core/BaseVoltage.py create mode 100755 CIM16/IEC61970/Core/BasicIntervalSchedule.py create mode 100755 CIM16/IEC61970/Core/Bay.py create mode 100755 CIM16/IEC61970/Core/ConductingEquipment.py create mode 100755 CIM16/IEC61970/Core/ConnectivityNode.py create mode 100755 CIM16/IEC61970/Core/ConnectivityNodeContainer.py create mode 100755 CIM16/IEC61970/Core/Curve.py create mode 100755 CIM16/IEC61970/Core/CurveData.py create mode 100755 CIM16/IEC61970/Core/Equipment.py create mode 100755 CIM16/IEC61970/Core/EquipmentContainer.py create mode 100755 CIM16/IEC61970/Core/GeographicalRegion.py create mode 100755 CIM16/IEC61970/Core/IdentifiedObject.py create mode 100755 CIM16/IEC61970/Core/IrregularIntervalSchedule.py create mode 100755 CIM16/IEC61970/Core/IrregularTimePoint.py create mode 100755 CIM16/IEC61970/Core/Name.py create mode 100755 CIM16/IEC61970/Core/NameType.py create mode 100755 CIM16/IEC61970/Core/NameTypeAuthority.py create mode 100755 CIM16/IEC61970/Core/OperatingParticipant.py create mode 100755 CIM16/IEC61970/Core/OperatingShare.py create mode 100755 CIM16/IEC61970/Core/PSRType.py create mode 100755 CIM16/IEC61970/Core/PowerSystemResource.py create mode 100755 CIM16/IEC61970/Core/PsrList.py create mode 100755 CIM16/IEC61970/Core/RegularIntervalSchedule.py create mode 100755 CIM16/IEC61970/Core/RegularTimePoint.py create mode 100755 CIM16/IEC61970/Core/ReportingGroup.py create mode 100755 CIM16/IEC61970/Core/ReportingSuperGroup.py create mode 100755 CIM16/IEC61970/Core/SubGeographicalRegion.py create mode 100755 CIM16/IEC61970/Core/Substation.py create mode 100755 CIM16/IEC61970/Core/Terminal.py create mode 100755 CIM16/IEC61970/Core/VoltageLevel.py create mode 100755 CIM16/IEC61970/Core/__init__.py create mode 100755 CIM16/IEC61970/CutsJumpers/Clamp.py create mode 100755 CIM16/IEC61970/CutsJumpers/Cut.py create mode 100755 CIM16/IEC61970/CutsJumpers/__init__.py create mode 100755 CIM16/IEC61970/Domain/DateTimeInterval.py create mode 100755 CIM16/IEC61970/Domain/__init__.py create mode 100755 CIM16/IEC61970/Dynamics/DynamicsFunctionBlock.py create mode 100755 CIM16/IEC61970/Dynamics/RotatingMachineDynamics.py create mode 100755 CIM16/IEC61970/Dynamics/SynchronousMachineDetailed.py create mode 100755 CIM16/IEC61970/Dynamics/SynchronousMachineDynamics.py create mode 100755 CIM16/IEC61970/Dynamics/SynchronousMachineEquivalentCircuit.py create mode 100755 CIM16/IEC61970/Dynamics/SynchronousMachineSimplified.py create mode 100755 CIM16/IEC61970/Dynamics/SynchronousMachineTimeConstantReactance.py create mode 100755 CIM16/IEC61970/Dynamics/SynchronousMachineUserDefined.py create mode 100755 CIM16/IEC61970/Dynamics/__init__.py create mode 100755 CIM16/IEC61970/Equivalents/EquivalentBranch.py create mode 100755 CIM16/IEC61970/Equivalents/EquivalentEquipment.py create mode 100755 CIM16/IEC61970/Equivalents/EquivalentInjection.py create mode 100755 CIM16/IEC61970/Equivalents/EquivalentNetwork.py create mode 100755 CIM16/IEC61970/Equivalents/EquivalentShunt.py create mode 100755 CIM16/IEC61970/Equivalents/__init__.py create mode 100755 CIM16/IEC61970/Generation/GenerationDynamics/BWRSteamSupply.py create mode 100755 CIM16/IEC61970/Generation/GenerationDynamics/CTTempActivePowerCurve.py create mode 100755 CIM16/IEC61970/Generation/GenerationDynamics/CombustionTurbine.py create mode 100755 CIM16/IEC61970/Generation/GenerationDynamics/DrumBoiler.py create mode 100755 CIM16/IEC61970/Generation/GenerationDynamics/FossilSteamSupply.py create mode 100755 CIM16/IEC61970/Generation/GenerationDynamics/HeatRecoveryBoiler.py create mode 100755 CIM16/IEC61970/Generation/GenerationDynamics/HydroTurbine.py create mode 100755 CIM16/IEC61970/Generation/GenerationDynamics/PWRSteamSupply.py create mode 100755 CIM16/IEC61970/Generation/GenerationDynamics/PrimeMover.py create mode 100755 CIM16/IEC61970/Generation/GenerationDynamics/SteamSupply.py create mode 100755 CIM16/IEC61970/Generation/GenerationDynamics/SteamTurbine.py create mode 100755 CIM16/IEC61970/Generation/GenerationDynamics/Subcritical.py create mode 100755 CIM16/IEC61970/Generation/GenerationDynamics/Supercritical.py create mode 100755 CIM16/IEC61970/Generation/GenerationDynamics/__init__.py create mode 100755 CIM16/IEC61970/Generation/Production/AirCompressor.py create mode 100755 CIM16/IEC61970/Generation/Production/CAESPlant.py create mode 100755 CIM16/IEC61970/Generation/Production/CogenerationPlant.py create mode 100755 CIM16/IEC61970/Generation/Production/CombinedCyclePlant.py create mode 100755 CIM16/IEC61970/Generation/Production/EmissionAccount.py create mode 100755 CIM16/IEC61970/Generation/Production/EmissionCurve.py create mode 100755 CIM16/IEC61970/Generation/Production/FossilFuel.py create mode 100755 CIM16/IEC61970/Generation/Production/FuelAllocationSchedule.py create mode 100755 CIM16/IEC61970/Generation/Production/GenUnitOpCostCurve.py create mode 100755 CIM16/IEC61970/Generation/Production/GenUnitOpSchedule.py create mode 100755 CIM16/IEC61970/Generation/Production/GeneratingUnit.py create mode 100755 CIM16/IEC61970/Generation/Production/GrossToNetActivePowerCurve.py create mode 100755 CIM16/IEC61970/Generation/Production/HeatInputCurve.py create mode 100755 CIM16/IEC61970/Generation/Production/HeatRateCurve.py create mode 100755 CIM16/IEC61970/Generation/Production/HydroGeneratingEfficiencyCurve.py create mode 100755 CIM16/IEC61970/Generation/Production/HydroGeneratingUnit.py create mode 100755 CIM16/IEC61970/Generation/Production/HydroPowerPlant.py create mode 100755 CIM16/IEC61970/Generation/Production/HydroPump.py create mode 100755 CIM16/IEC61970/Generation/Production/HydroPumpOpSchedule.py create mode 100755 CIM16/IEC61970/Generation/Production/IncrementalHeatRateCurve.py create mode 100755 CIM16/IEC61970/Generation/Production/InflowForecast.py create mode 100755 CIM16/IEC61970/Generation/Production/LevelVsVolumeCurve.py create mode 100755 CIM16/IEC61970/Generation/Production/NuclearGeneratingUnit.py create mode 100755 CIM16/IEC61970/Generation/Production/PenstockLossCurve.py create mode 100755 CIM16/IEC61970/Generation/Production/Reservoir.py create mode 100755 CIM16/IEC61970/Generation/Production/ShutdownCurve.py create mode 100755 CIM16/IEC61970/Generation/Production/StartIgnFuelCurve.py create mode 100755 CIM16/IEC61970/Generation/Production/StartMainFuelCurve.py create mode 100755 CIM16/IEC61970/Generation/Production/StartRampCurve.py create mode 100755 CIM16/IEC61970/Generation/Production/StartupModel.py create mode 100755 CIM16/IEC61970/Generation/Production/SteamSendoutSchedule.py create mode 100755 CIM16/IEC61970/Generation/Production/TailbayLossCurve.py create mode 100755 CIM16/IEC61970/Generation/Production/TargetLevelSchedule.py create mode 100755 CIM16/IEC61970/Generation/Production/ThermalGeneratingUnit.py create mode 100755 CIM16/IEC61970/Generation/Production/WindGeneratingUnit.py create mode 100755 CIM16/IEC61970/Generation/Production/__init__.py create mode 100755 CIM16/IEC61970/Generation/__init__.py create mode 100755 CIM16/IEC61970/Graphics/DiagramObject.py create mode 100755 CIM16/IEC61970/Graphics/DiagramObjectGluePoint.py create mode 100755 CIM16/IEC61970/Graphics/DiagramObjectPoint.py create mode 100755 CIM16/IEC61970/Graphics/DiagramObjectStyle.py create mode 100755 CIM16/IEC61970/Graphics/TextDiagramObject.py create mode 100755 CIM16/IEC61970/Graphics/VisibilityLayer.py create mode 100755 CIM16/IEC61970/Graphics/__init__.py create mode 100755 CIM16/IEC61970/IEC61970CIMVersion.py create mode 100755 CIM16/IEC61970/Informative/InfAssetModels/AssetModelCatalogue.py create mode 100755 CIM16/IEC61970/Informative/InfAssetModels/AssetModelCatalogueItem.py create mode 100755 CIM16/IEC61970/Informative/InfAssetModels/TransformerAssetModel.py create mode 100755 CIM16/IEC61970/Informative/InfAssetModels/__init__.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/AssetAssetRole.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/AssetPropertyCurve.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/BreakerInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/Bushing.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/BushingInsulationPF.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/Cabinet.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/ComEquipment.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/CompositeSwitchInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/ConductorAsset.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/CurrentTransformerInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/DimensionsInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/DocAssetRole.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/Duct.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/DuctBank.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/ElectricalInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/FACTSDevice.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/Facility.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/FailureEvent.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/FaultIndicatorInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/FinancialInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/GenericAssetModelOrMaterial.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/Joint.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/Medium.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/MountingConnection.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/MountingPoint.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/OrgAssetRole.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/Pole.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/PotentialTransformerInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/PowerRating.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/Procedure.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/ProcedureDataSet.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/ProtectionEquipmentInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/RecloserInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/ReliabilityInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/SVC.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/ShuntCompensatorInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/ShuntImpedanceInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/Specification.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/Streetlight.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/Structure.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/StructureSupport.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/SubstationAsset.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/SurgeProtectorInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/SwitchInfo.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/TestDataSet.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/Tool.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/Tower.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/TransformerAsset.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/TransformerObservation.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/UndergroundStructure.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/Vehicle.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/WindingInsulation.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/WorkEquipment.py create mode 100755 CIM16/IEC61970/Informative/InfAssets/__init__.py create mode 100755 CIM16/IEC61970/Informative/InfCommon/Bank.py create mode 100755 CIM16/IEC61970/Informative/InfCommon/BankAccount.py create mode 100755 CIM16/IEC61970/Informative/InfCommon/BusinessPlan.py create mode 100755 CIM16/IEC61970/Informative/InfCommon/BusinessRole.py create mode 100755 CIM16/IEC61970/Informative/InfCommon/Craft.py create mode 100755 CIM16/IEC61970/Informative/InfCommon/DocDocRole.py create mode 100755 CIM16/IEC61970/Informative/InfCommon/DocPsrRole.py create mode 100755 CIM16/IEC61970/Informative/InfCommon/Ratio.py create mode 100755 CIM16/IEC61970/Informative/InfCommon/Role.py create mode 100755 CIM16/IEC61970/Informative/InfCommon/ScheduleParameterInfo.py create mode 100755 CIM16/IEC61970/Informative/InfCommon/ScheduledEvent.py create mode 100755 CIM16/IEC61970/Informative/InfCommon/Skill.py create mode 100755 CIM16/IEC61970/Informative/InfCommon/__init__.py create mode 100755 CIM16/IEC61970/Informative/InfCore/ModelingAuthority.py create mode 100755 CIM16/IEC61970/Informative/InfCore/ModelingAuthoritySet.py create mode 100755 CIM16/IEC61970/Informative/InfCore/__init__.py create mode 100755 CIM16/IEC61970/Informative/InfCustomers/ComplianceEvent.py create mode 100755 CIM16/IEC61970/Informative/InfCustomers/CustomerBillingInfo.py create mode 100755 CIM16/IEC61970/Informative/InfCustomers/ExternalCustomerAgreement.py create mode 100755 CIM16/IEC61970/Informative/InfCustomers/OutageHistory.py create mode 100755 CIM16/IEC61970/Informative/InfCustomers/PowerQualityPricing.py create mode 100755 CIM16/IEC61970/Informative/InfCustomers/ServiceGuarantee.py create mode 100755 CIM16/IEC61970/Informative/InfCustomers/StandardIndustryCode.py create mode 100755 CIM16/IEC61970/Informative/InfCustomers/SubscribePowerCurve.py create mode 100755 CIM16/IEC61970/Informative/InfCustomers/WorkBillingInfo.py create mode 100755 CIM16/IEC61970/Informative/InfCustomers/__init__.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/DocErpPersonRole.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/DocOrgRole.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpBOM.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpBankAccount.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpBomItemData.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpChartOfAccounts.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpCompetency.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpEngChangeOrder.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpInventory.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpInventoryCount.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpInvoice.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpInvoiceLineItem.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpIssueInventory.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpItemMaster.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpJournal.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpJournalEntry.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpLedBudLineItem.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpLedger.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpLedgerBudget.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpLedgerEntry.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpOrganisation.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpPOLineItem.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpPayable.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpPayableLineItem.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpPayment.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpPerson.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpPersonnel.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpProjectAccounting.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpPurchaseOrder.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpQuote.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpQuoteLineItem.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpRecDelvLineItem.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpRecLineItem.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpReceivable.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpReceiveDelivery.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpReqLineItem.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpRequisition.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpSalesOrder.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpSiteLevelData.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpTimeEntry.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/ErpTimeSheet.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/OrgErpPersonRole.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/OrgOrgRole.py create mode 100755 CIM16/IEC61970/Informative/InfERPSupport/__init__.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/Diagram.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlBaseSymbol.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlColour.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlDiagramObject.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlFeatureStyle.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlFeatureType.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlFill.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlFont.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlGeometryStyle.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlGraphic.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlHalo.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlLabelPlacement.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlLabelStyle.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlLineGeometry.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlLineSymbol.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlMark.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlObservation.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlPointGeometry.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlPointSymbol.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlPolygonGeometry.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlPolygonSymbol.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlPosition.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlRasterSymbol.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlSelector.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlStroke.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlSvgParameter.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlSymbol.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlTextSymbol.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlTopologyStyle.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/GmlValue.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/Map.py create mode 100755 CIM16/IEC61970/Informative/InfGMLSupport/__init__.py create mode 100755 CIM16/IEC61970/Informative/InfLoadControl/LoadLimitFunction.py create mode 100755 CIM16/IEC61970/Informative/InfLoadControl/LoadMgmtFunction.py create mode 100755 CIM16/IEC61970/Informative/InfLoadControl/LoadMgmtRecord.py create mode 100755 CIM16/IEC61970/Informative/InfLoadControl/LoadShedFunction.py create mode 100755 CIM16/IEC61970/Informative/InfLoadControl/__init__.py create mode 100755 CIM16/IEC61970/Informative/InfLocations/Direction.py create mode 100755 CIM16/IEC61970/Informative/InfLocations/Hazard.py create mode 100755 CIM16/IEC61970/Informative/InfLocations/LandProperty.py create mode 100755 CIM16/IEC61970/Informative/InfLocations/LocationGrant.py create mode 100755 CIM16/IEC61970/Informative/InfLocations/OrgPropertyRole.py create mode 100755 CIM16/IEC61970/Informative/InfLocations/PersonPropertyRole.py create mode 100755 CIM16/IEC61970/Informative/InfLocations/RedLine.py create mode 100755 CIM16/IEC61970/Informative/InfLocations/RightOfWay.py create mode 100755 CIM16/IEC61970/Informative/InfLocations/Route.py create mode 100755 CIM16/IEC61970/Informative/InfLocations/Zone.py create mode 100755 CIM16/IEC61970/Informative/InfLocations/__init__.py create mode 100755 CIM16/IEC61970/Informative/InfMetering/GasMeteringFunction.py create mode 100755 CIM16/IEC61970/Informative/InfMetering/WaterMeteringFunction.py create mode 100755 CIM16/IEC61970/Informative/InfMetering/__init__.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/CallBack.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/ChangeItem.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/ChangeSet.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/Circuit.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/CircuitSection.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/ErpPersonScheduleStepRole.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/IncidentCode.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/IncidentRecord.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/LandBase.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/NetworkDataSet.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/OperationalRestriction.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/OrgPsrRole.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/OutageCode.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/OutageNotification.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/OutageRecord.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/OutageReport.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/OutageStep.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/OutageStepPsrRole.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/PSREvent.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/PlannedOutage.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/SafetyDocument.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/SwitchingSchedule.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/SwitchingStep.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/TroubleTicket.py create mode 100755 CIM16/IEC61970/Informative/InfOperations/__init__.py create mode 100755 CIM16/IEC61970/Informative/InfTypeAsset/GeneratorTypeAsset.py create mode 100755 CIM16/IEC61970/Informative/InfTypeAsset/TypeAssetCatalogue.py create mode 100755 CIM16/IEC61970/Informative/InfTypeAsset/__init__.py create mode 100755 CIM16/IEC61970/Informative/InfWork/AccessPermit.py create mode 100755 CIM16/IEC61970/Informative/InfWork/Appointment.py create mode 100755 CIM16/IEC61970/Informative/InfWork/Assignment.py create mode 100755 CIM16/IEC61970/Informative/InfWork/BusinessCase.py create mode 100755 CIM16/IEC61970/Informative/InfWork/CUAllowableAction.py create mode 100755 CIM16/IEC61970/Informative/InfWork/CUAsset.py create mode 100755 CIM16/IEC61970/Informative/InfWork/CUContractorItem.py create mode 100755 CIM16/IEC61970/Informative/InfWork/CUGroup.py create mode 100755 CIM16/IEC61970/Informative/InfWork/CULaborCode.py create mode 100755 CIM16/IEC61970/Informative/InfWork/CULaborItem.py create mode 100755 CIM16/IEC61970/Informative/InfWork/CUMaterialItem.py create mode 100755 CIM16/IEC61970/Informative/InfWork/CUWorkEquipmentItem.py create mode 100755 CIM16/IEC61970/Informative/InfWork/Capability.py create mode 100755 CIM16/IEC61970/Informative/InfWork/CompatibleUnit.py create mode 100755 CIM16/IEC61970/Informative/InfWork/ConditionFactor.py create mode 100755 CIM16/IEC61970/Informative/InfWork/ContractorItem.py create mode 100755 CIM16/IEC61970/Informative/InfWork/CostType.py create mode 100755 CIM16/IEC61970/Informative/InfWork/Crew.py create mode 100755 CIM16/IEC61970/Informative/InfWork/Design.py create mode 100755 CIM16/IEC61970/Informative/InfWork/DesignLocation.py create mode 100755 CIM16/IEC61970/Informative/InfWork/DesignLocationCU.py create mode 100755 CIM16/IEC61970/Informative/InfWork/DiagnosisDataSet.py create mode 100755 CIM16/IEC61970/Informative/InfWork/EquipmentItem.py create mode 100755 CIM16/IEC61970/Informative/InfWork/InfoQuestion.py create mode 100755 CIM16/IEC61970/Informative/InfWork/InspectionDataSet.py create mode 100755 CIM16/IEC61970/Informative/InfWork/LaborItem.py create mode 100755 CIM16/IEC61970/Informative/InfWork/MaintenanceDataSet.py create mode 100755 CIM16/IEC61970/Informative/InfWork/MaterialItem.py create mode 100755 CIM16/IEC61970/Informative/InfWork/MiscCostItem.py create mode 100755 CIM16/IEC61970/Informative/InfWork/NonStandardItem.py create mode 100755 CIM16/IEC61970/Informative/InfWork/OneCallRequest.py create mode 100755 CIM16/IEC61970/Informative/InfWork/OverheadCost.py create mode 100755 CIM16/IEC61970/Informative/InfWork/Project.py create mode 100755 CIM16/IEC61970/Informative/InfWork/PropertyUnit.py create mode 100755 CIM16/IEC61970/Informative/InfWork/QualificationRequirement.py create mode 100755 CIM16/IEC61970/Informative/InfWork/Regulation.py create mode 100755 CIM16/IEC61970/Informative/InfWork/Request.py create mode 100755 CIM16/IEC61970/Informative/InfWork/ShiftPattern.py create mode 100755 CIM16/IEC61970/Informative/InfWork/TypeMaterial.py create mode 100755 CIM16/IEC61970/Informative/InfWork/Usage.py create mode 100755 CIM16/IEC61970/Informative/InfWork/WorkCostDetail.py create mode 100755 CIM16/IEC61970/Informative/InfWork/WorkCostSummary.py create mode 100755 CIM16/IEC61970/Informative/InfWork/WorkFlowStep.py create mode 100755 CIM16/IEC61970/Informative/InfWork/WorkLocation.py create mode 100755 CIM16/IEC61970/Informative/InfWork/WorkStatusEntry.py create mode 100755 CIM16/IEC61970/Informative/InfWork/WorkTask.py create mode 100755 CIM16/IEC61970/Informative/InfWork/__init__.py create mode 100755 CIM16/IEC61970/Informative/__init__.py create mode 100755 CIM16/IEC61970/LoadModel/ConformLoad.py create mode 100755 CIM16/IEC61970/LoadModel/ConformLoadGroup.py create mode 100755 CIM16/IEC61970/LoadModel/ConformLoadSchedule.py create mode 100755 CIM16/IEC61970/LoadModel/DayType.py create mode 100755 CIM16/IEC61970/LoadModel/EnergyArea.py create mode 100755 CIM16/IEC61970/LoadModel/LoadArea.py create mode 100755 CIM16/IEC61970/LoadModel/LoadGroup.py create mode 100755 CIM16/IEC61970/LoadModel/LoadResponseCharacteristic.py create mode 100755 CIM16/IEC61970/LoadModel/NonConformLoad.py create mode 100755 CIM16/IEC61970/LoadModel/NonConformLoadGroup.py create mode 100755 CIM16/IEC61970/LoadModel/NonConformLoadSchedule.py create mode 100755 CIM16/IEC61970/LoadModel/PowerCutZone.py create mode 100755 CIM16/IEC61970/LoadModel/Season.py create mode 100755 CIM16/IEC61970/LoadModel/SeasonDayTypeSchedule.py create mode 100755 CIM16/IEC61970/LoadModel/StationSupply.py create mode 100755 CIM16/IEC61970/LoadModel/SubLoadArea.py create mode 100755 CIM16/IEC61970/LoadModel/__init__.py create mode 100755 CIM16/IEC61970/Meas/Accumulator.py create mode 100755 CIM16/IEC61970/Meas/AccumulatorLimit.py create mode 100755 CIM16/IEC61970/Meas/AccumulatorLimitSet.py create mode 100755 CIM16/IEC61970/Meas/AccumulatorValue.py create mode 100755 CIM16/IEC61970/Meas/Analog.py create mode 100755 CIM16/IEC61970/Meas/AnalogLimit.py create mode 100755 CIM16/IEC61970/Meas/AnalogLimitSet.py create mode 100755 CIM16/IEC61970/Meas/AnalogValue.py create mode 100755 CIM16/IEC61970/Meas/Command.py create mode 100755 CIM16/IEC61970/Meas/Control.py create mode 100755 CIM16/IEC61970/Meas/ControlType.py create mode 100755 CIM16/IEC61970/Meas/Discrete.py create mode 100755 CIM16/IEC61970/Meas/DiscreteValue.py create mode 100755 CIM16/IEC61970/Meas/Limit.py create mode 100755 CIM16/IEC61970/Meas/LimitSet.py create mode 100755 CIM16/IEC61970/Meas/Measurement.py create mode 100755 CIM16/IEC61970/Meas/MeasurementValue.py create mode 100755 CIM16/IEC61970/Meas/MeasurementValueQuality.py create mode 100755 CIM16/IEC61970/Meas/MeasurementValueSource.py create mode 100755 CIM16/IEC61970/Meas/Quality61850.py create mode 100755 CIM16/IEC61970/Meas/SetPoint.py create mode 100755 CIM16/IEC61970/Meas/StringMeasurement.py create mode 100755 CIM16/IEC61970/Meas/StringMeasurementValue.py create mode 100755 CIM16/IEC61970/Meas/ValueAliasSet.py create mode 100755 CIM16/IEC61970/Meas/ValueToAlias.py create mode 100755 CIM16/IEC61970/Meas/__init__.py create mode 100755 CIM16/IEC61970/OperationalLimits/ActivePowerLimit.py create mode 100755 CIM16/IEC61970/OperationalLimits/ActivePowerLimitSet.py create mode 100755 CIM16/IEC61970/OperationalLimits/ApparentPowerLimit.py create mode 100755 CIM16/IEC61970/OperationalLimits/ApparentPowerLimitSet.py create mode 100755 CIM16/IEC61970/OperationalLimits/BranchGroup.py create mode 100755 CIM16/IEC61970/OperationalLimits/BranchGroupTerminal.py create mode 100755 CIM16/IEC61970/OperationalLimits/CurrentLimit.py create mode 100755 CIM16/IEC61970/OperationalLimits/CurrentLimitSet.py create mode 100755 CIM16/IEC61970/OperationalLimits/OperationalLimit.py create mode 100755 CIM16/IEC61970/OperationalLimits/OperationalLimitSet.py create mode 100755 CIM16/IEC61970/OperationalLimits/OperationalLimitType.py create mode 100755 CIM16/IEC61970/OperationalLimits/VoltageLimit.py create mode 100755 CIM16/IEC61970/OperationalLimits/VoltageLimitSet.py create mode 100755 CIM16/IEC61970/OperationalLimits/__init__.py create mode 100755 CIM16/IEC61970/Outage/ClearanceTag.py create mode 100755 CIM16/IEC61970/Outage/ClearanceTagType.py create mode 100755 CIM16/IEC61970/Outage/OutageSchedule.py create mode 100755 CIM16/IEC61970/Outage/SwitchingOperation.py create mode 100755 CIM16/IEC61970/Outage/__init__.py create mode 100755 CIM16/IEC61970/Protection/CurrentRelay.py create mode 100755 CIM16/IEC61970/Protection/ProtectionEquipment.py create mode 100755 CIM16/IEC61970/Protection/RecloseSequence.py create mode 100755 CIM16/IEC61970/Protection/SynchrocheckRelay.py create mode 100755 CIM16/IEC61970/Protection/__init__.py create mode 100755 CIM16/IEC61970/SCADA/CommunicationLink.py create mode 100755 CIM16/IEC61970/SCADA/RemoteControl.py create mode 100755 CIM16/IEC61970/SCADA/RemotePoint.py create mode 100755 CIM16/IEC61970/SCADA/RemoteSource.py create mode 100755 CIM16/IEC61970/SCADA/RemoteUnit.py create mode 100755 CIM16/IEC61970/SCADA/__init__.py create mode 100755 CIM16/IEC61970/StateVariables/StateVariable.py create mode 100755 CIM16/IEC61970/StateVariables/SvInjection.py create mode 100755 CIM16/IEC61970/StateVariables/SvPowerFlow.py create mode 100755 CIM16/IEC61970/StateVariables/SvShortCircuit.py create mode 100755 CIM16/IEC61970/StateVariables/SvShuntCompensatorSections.py create mode 100755 CIM16/IEC61970/StateVariables/SvStatus.py create mode 100755 CIM16/IEC61970/StateVariables/SvTapStep.py create mode 100755 CIM16/IEC61970/StateVariables/SvVoltage.py create mode 100755 CIM16/IEC61970/StateVariables/TopologicalIsland.py create mode 100755 CIM16/IEC61970/StateVariables/__init__.py create mode 100755 CIM16/IEC61970/Topology/BusNameMarker.py create mode 100755 CIM16/IEC61970/Topology/TopologicalNode.py create mode 100755 CIM16/IEC61970/Topology/__init__.py create mode 100755 CIM16/IEC61970/Wires/ACLineSegment.py create mode 100755 CIM16/IEC61970/Wires/Breaker.py create mode 100755 CIM16/IEC61970/Wires/BusbarSection.py create mode 100755 CIM16/IEC61970/Wires/CompositeSwitch.py create mode 100755 CIM16/IEC61970/Wires/Conductor.py create mode 100755 CIM16/IEC61970/Wires/Connector.py create mode 100755 CIM16/IEC61970/Wires/DCLineSegment.py create mode 100755 CIM16/IEC61970/Wires/Disconnector.py create mode 100755 CIM16/IEC61970/Wires/EnergyConsumer.py create mode 100755 CIM16/IEC61970/Wires/EnergySource.py create mode 100755 CIM16/IEC61970/Wires/FrequencyConverter.py create mode 100755 CIM16/IEC61970/Wires/Fuse.py create mode 100755 CIM16/IEC61970/Wires/Ground.py create mode 100755 CIM16/IEC61970/Wires/GroundDisconnector.py create mode 100755 CIM16/IEC61970/Wires/Jumper.py create mode 100755 CIM16/IEC61970/Wires/Junction.py create mode 100755 CIM16/IEC61970/Wires/Line.py create mode 100755 CIM16/IEC61970/Wires/LoadBreakSwitch.py create mode 100755 CIM16/IEC61970/Wires/MutualCoupling.py create mode 100755 CIM16/IEC61970/Wires/PerLengthPhaseImpedance.py create mode 100755 CIM16/IEC61970/Wires/PerLengthSequenceImpedance.py create mode 100755 CIM16/IEC61970/Wires/PhaseImpedanceData.py create mode 100755 CIM16/IEC61970/Wires/PhaseTapChanger.py create mode 100755 CIM16/IEC61970/Wires/PhaseTapChangerAsymetrical.py create mode 100755 CIM16/IEC61970/Wires/PhaseTapChangerLinear.py create mode 100755 CIM16/IEC61970/Wires/PhaseTapChangerNonLinear.py create mode 100755 CIM16/IEC61970/Wires/PhaseTapChangerSymetrical.py create mode 100755 CIM16/IEC61970/Wires/PhaseTapChangerTabular.py create mode 100755 CIM16/IEC61970/Wires/PhaseTapChangerTabularPoint.py create mode 100755 CIM16/IEC61970/Wires/Plant.py create mode 100755 CIM16/IEC61970/Wires/PowerTransformer.py create mode 100755 CIM16/IEC61970/Wires/PowerTransformerEnd.py create mode 100755 CIM16/IEC61970/Wires/ProtectedSwitch.py create mode 100755 CIM16/IEC61970/Wires/RatioTapChanger.py create mode 100755 CIM16/IEC61970/Wires/RatioTapChangerTabular.py create mode 100755 CIM16/IEC61970/Wires/RatioTapChangerTabularPoint.py create mode 100755 CIM16/IEC61970/Wires/ReactiveCapabilityCurve.py create mode 100755 CIM16/IEC61970/Wires/Recloser.py create mode 100755 CIM16/IEC61970/Wires/RectifierInverter.py create mode 100755 CIM16/IEC61970/Wires/RegulatingCondEq.py create mode 100755 CIM16/IEC61970/Wires/RegulatingControl.py create mode 100755 CIM16/IEC61970/Wires/RegulationSchedule.py create mode 100755 CIM16/IEC61970/Wires/Resistor.py create mode 100755 CIM16/IEC61970/Wires/Sectionaliser.py create mode 100755 CIM16/IEC61970/Wires/SeriesCompensator.py create mode 100755 CIM16/IEC61970/Wires/ShuntCompensator.py create mode 100755 CIM16/IEC61970/Wires/StaticVarCompensator.py create mode 100755 CIM16/IEC61970/Wires/Switch.py create mode 100755 CIM16/IEC61970/Wires/SwitchSchedule.py create mode 100755 CIM16/IEC61970/Wires/SynchronousMachine.py create mode 100755 CIM16/IEC61970/Wires/TapChanger.py create mode 100755 CIM16/IEC61970/Wires/TapChangerControl.py create mode 100755 CIM16/IEC61970/Wires/TapSchedule.py create mode 100755 CIM16/IEC61970/Wires/TransformerCoreAdmittance.py create mode 100755 CIM16/IEC61970/Wires/TransformerEnd.py create mode 100755 CIM16/IEC61970/Wires/TransformerMeshImpedance.py create mode 100755 CIM16/IEC61970/Wires/TransformerStarImpedance.py create mode 100755 CIM16/IEC61970/Wires/TransformerTank.py create mode 100755 CIM16/IEC61970/Wires/TransformerTankEnd.py create mode 100755 CIM16/IEC61970/Wires/VoltageControlZone.py create mode 100755 CIM16/IEC61970/Wires/__init__.py create mode 100755 CIM16/IEC61970/WiresPhaseModel/ACLineSegmentPhase.py create mode 100755 CIM16/IEC61970/WiresPhaseModel/EnergyConsumerPhase.py create mode 100755 CIM16/IEC61970/WiresPhaseModel/ShuntCompensatorPhase.py create mode 100755 CIM16/IEC61970/WiresPhaseModel/SwitchPhase.py create mode 100755 CIM16/IEC61970/WiresPhaseModel/__init__.py create mode 100755 CIM16/IEC61970/__init__.py create mode 100755 CIM16/IEC62325/IEC62325CIMVersion.py create mode 100755 CIM16/IEC62325/MarketParticipant.py create mode 100755 CIM16/IEC62325/MarketRole.py create mode 100755 CIM16/IEC62325/__init__.py create mode 100755 CIM16/Package.py create mode 100755 CIM16/PackageDependencies/PackageDependenciesCIMVeresion.py create mode 100755 CIM16/PackageDependencies/__init__.py create mode 100755 CIM16/Stereotype.py create mode 100755 CIM16/__init__.py diff --git a/CIM16/CDPSM/Asset/Element.py b/CIM16/CDPSM/Asset/Element.py new file mode 100755 index 00000000..fddaa815 --- /dev/null +++ b/CIM16/CDPSM/Asset/Element.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class Element(object): + + def __init__(self, UUID=''): + """Initialises a new 'Element' instance. + + @param UUID: + """ + + self.UUID = UUID + + + _attrs = ["UUID"] + _attr_types = {"UUID": str} + _defaults = {"UUID": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Asset/IEC61968/AssetModels/CableInfo.py b/CIM16/CDPSM/Asset/IEC61968/AssetModels/CableInfo.py new file mode 100755 index 00000000..599808f0 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/AssetModels/CableInfo.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61968.AssetModels.ConductorInfo import ConductorInfo + +class CableInfo(ConductorInfo): + """Cable data. + """ + + def __init__(self, diameterOverJacket=0.0, constructionKind="sector", shieldMaterial="lead", outerJacketKind="pvc", isStrandFill=False, diameterOverInsulation=0.0, diameterOverScreen=0.0, sheathAsNeutral=False, nominalTemperature=0.0, diameterOverCore=0.0, *args, **kw_args): + """Initialises a new 'CableInfo' instance. + + @param diameterOverJacket: Diameter over the outermost jacketing layer. + @param constructionKind: Kind of construction of this cable. Values are: "sector", "other", "solid", "compacted", "stranded", "segmental", "compressed" + @param shieldMaterial: Material of the shield. Values are: "lead", "aluminum", "other", "copper", "steel" + @param outerJacketKind: Kind of outer jacket of this cable. Values are: "pvc", "linearLowDensityPolyethylene", "none", "insulating", "other", "polyethylene", "semiconducting" + @param isStrandFill: True if wire strands are extruded in a way to fill the voids in the cable. + @param diameterOverInsulation: Diameter over the insulating layer, excluding outer screen. + @param diameterOverScreen: Diameter over the outer screen; should be the shield's inside diameter.. + @param sheathAsNeutral: True if sheath / shield is used as a neutral (i.e., bonded). + @param nominalTemperature: Maximum nominal design operating temperature. + @param diameterOverCore: Diameter over the core, including any semi-con screen; should be the insulating layer's inside diameter. + """ + #: Diameter over the outermost jacketing layer. + self.diameterOverJacket = diameterOverJacket + + #: Kind of construction of this cable. Values are: "sector", "other", "solid", "compacted", "stranded", "segmental", "compressed" + self.constructionKind = constructionKind + + #: Material of the shield. Values are: "lead", "aluminum", "other", "copper", "steel" + self.shieldMaterial = shieldMaterial + + #: Kind of outer jacket of this cable. Values are: "pvc", "linearLowDensityPolyethylene", "none", "insulating", "other", "polyethylene", "semiconducting" + self.outerJacketKind = outerJacketKind + + #: True if wire strands are extruded in a way to fill the voids in the cable. + self.isStrandFill = isStrandFill + + #: Diameter over the insulating layer, excluding outer screen. + self.diameterOverInsulation = diameterOverInsulation + + #: Diameter over the outer screen; should be the shield's inside diameter.. + self.diameterOverScreen = diameterOverScreen + + #: True if sheath / shield is used as a neutral (i.e., bonded). + self.sheathAsNeutral = sheathAsNeutral + + #: Maximum nominal design operating temperature. + self.nominalTemperature = nominalTemperature + + #: Diameter over the core, including any semi-con screen; should be the insulating layer's inside diameter. + self.diameterOverCore = diameterOverCore + + super(CableInfo, self).__init__(*args, **kw_args) + + _attrs = ["diameterOverJacket", "constructionKind", "shieldMaterial", "outerJacketKind", "isStrandFill", "diameterOverInsulation", "diameterOverScreen", "sheathAsNeutral", "nominalTemperature", "diameterOverCore"] + _attr_types = {"diameterOverJacket": float, "constructionKind": str, "shieldMaterial": str, "outerJacketKind": str, "isStrandFill": bool, "diameterOverInsulation": float, "diameterOverScreen": float, "sheathAsNeutral": bool, "nominalTemperature": float, "diameterOverCore": float} + _defaults = {"diameterOverJacket": 0.0, "constructionKind": "sector", "shieldMaterial": "lead", "outerJacketKind": "pvc", "isStrandFill": False, "diameterOverInsulation": 0.0, "diameterOverScreen": 0.0, "sheathAsNeutral": False, "nominalTemperature": 0.0, "diameterOverCore": 0.0} + _enums = {"constructionKind": "CableConstructionKind", "shieldMaterial": "CableShieldMaterialKind", "outerJacketKind": "CableOuterJacketKind"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Asset/IEC61968/AssetModels/ConcentricNeutralCableInfo.py b/CIM16/CDPSM/Asset/IEC61968/AssetModels/ConcentricNeutralCableInfo.py new file mode 100755 index 00000000..f052378c --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/AssetModels/ConcentricNeutralCableInfo.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61968.AssetModels.CableInfo import CableInfo + +class ConcentricNeutralCableInfo(CableInfo): + """Concentric neutral cable data. + """ + + def __init__(self, diameterOverNeutral=0.0, neutralStrandCount=0, *args, **kw_args): + """Initialises a new 'ConcentricNeutralCableInfo' instance. + + @param diameterOverNeutral: Diameter over the concentric neutral strands. + @param neutralStrandCount: Number of concentric neutral strands. + """ + #: Diameter over the concentric neutral strands. + self.diameterOverNeutral = diameterOverNeutral + + #: Number of concentric neutral strands. + self.neutralStrandCount = neutralStrandCount + + super(ConcentricNeutralCableInfo, self).__init__(*args, **kw_args) + + _attrs = ["diameterOverNeutral", "neutralStrandCount"] + _attr_types = {"diameterOverNeutral": float, "neutralStrandCount": int} + _defaults = {"diameterOverNeutral": 0.0, "neutralStrandCount": 0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Asset/IEC61968/AssetModels/ConductorInfo.py b/CIM16/CDPSM/Asset/IEC61968/AssetModels/ConductorInfo.py new file mode 100755 index 00000000..7d6c051d --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/AssetModels/ConductorInfo.py @@ -0,0 +1,111 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo + +class ConductorInfo(AssetInfo): + """Conductor data. + """ + + def __init__(self, usage="secondary", insulationThickness=0.0, insulated=False, insulationMaterial="treeRetardantCrosslinkedPolyethylene", phaseCount=0, WireArrangements=None, LineSegments=None, *args, **kw_args): + """Initialises a new 'ConductorInfo' instance. + + @param usage: Usage of this conductor. Values are: "secondary", "other", "distribution", "transmission" + @param insulationThickness: (if insulated conductor) Thickness of the insulation. + @param insulated: True if conductor is insulated. + @param insulationMaterial: (if insulated conductor) Material used for insulation. Values are: "treeRetardantCrosslinkedPolyethylene", "butyl", "highPressureFluidFilled", "other", "varnishedCambricCloth", "siliconRubber", "beltedPilc", "crosslinkedPolyethylene", "oilPaper", "lowCapacitanceRubber", "asbestosAndVarnishedCambric", "treeResistantHighMolecularWeightPolyethylene", "unbeltedPilc", "ozoneResistantRubber", "ethylenePropyleneRubber", "highMolecularWeightPolyethylene", "varnishedDacronGlass", "rubber" + @param phaseCount: Number of phases (including neutral) to be retained. Any wires beyond this number should be reduced into the earth return. + @param WireArrangements: All wire arrangements (single wires) that make this conductor. + @param LineSegments: All line segments described by this conductor data. + """ + #: Usage of this conductor. Values are: "secondary", "other", "distribution", "transmission" + self.usage = usage + + #: (if insulated conductor) Thickness of the insulation. + self.insulationThickness = insulationThickness + + #: True if conductor is insulated. + self.insulated = insulated + + #: (if insulated conductor) Material used for insulation. Values are: "treeRetardantCrosslinkedPolyethylene", "butyl", "highPressureFluidFilled", "other", "varnishedCambricCloth", "siliconRubber", "beltedPilc", "crosslinkedPolyethylene", "oilPaper", "lowCapacitanceRubber", "asbestosAndVarnishedCambric", "treeResistantHighMolecularWeightPolyethylene", "unbeltedPilc", "ozoneResistantRubber", "ethylenePropyleneRubber", "highMolecularWeightPolyethylene", "varnishedDacronGlass", "rubber" + self.insulationMaterial = insulationMaterial + + #: Number of phases (including neutral) to be retained. Any wires beyond this number should be reduced into the earth return. + self.phaseCount = phaseCount + + self._WireArrangements = [] + self.WireArrangements = [] if WireArrangements is None else WireArrangements + + self._LineSegments = [] + self.LineSegments = [] if LineSegments is None else LineSegments + + super(ConductorInfo, self).__init__(*args, **kw_args) + + _attrs = ["usage", "insulationThickness", "insulated", "insulationMaterial", "phaseCount"] + _attr_types = {"usage": str, "insulationThickness": float, "insulated": bool, "insulationMaterial": str, "phaseCount": int} + _defaults = {"usage": "secondary", "insulationThickness": 0.0, "insulated": False, "insulationMaterial": "treeRetardantCrosslinkedPolyethylene", "phaseCount": 0} + _enums = {"usage": "ConductorUsageKind", "insulationMaterial": "ConductorInsulationKind"} + _refs = ["WireArrangements", "LineSegments"] + _many_refs = ["WireArrangements", "LineSegments"] + + def getWireArrangements(self): + """All wire arrangements (single wires) that make this conductor. + """ + return self._WireArrangements + + def setWireArrangements(self, value): + for x in self._WireArrangements: + x.ConductorInfo = None + for y in value: + y._ConductorInfo = self + self._WireArrangements = value + + WireArrangements = property(getWireArrangements, setWireArrangements) + + def addWireArrangements(self, *WireArrangements): + for obj in WireArrangements: + obj.ConductorInfo = self + + def removeWireArrangements(self, *WireArrangements): + for obj in WireArrangements: + obj.ConductorInfo = None + + def getLineSegments(self): + """All line segments described by this conductor data. + """ + return self._LineSegments + + def setLineSegments(self, value): + for x in self._LineSegments: + x.ConductorInfo = None + for y in value: + y._ConductorInfo = self + self._LineSegments = value + + LineSegments = property(getLineSegments, setLineSegments) + + def addLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.ConductorInfo = self + + def removeLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.ConductorInfo = None + diff --git a/CIM16/CDPSM/Asset/IEC61968/AssetModels/EndDeviceInfo.py b/CIM16/CDPSM/Asset/IEC61968/AssetModels/EndDeviceInfo.py new file mode 100755 index 00000000..50004202 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/AssetModels/EndDeviceInfo.py @@ -0,0 +1,51 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo + +class EndDeviceInfo(AssetInfo): + """End device data. + """ + + def __init__(self, ratedCurrent=0.0, ratedVoltage=0.0, phaseCount=0, *args, **kw_args): + """Initialises a new 'EndDeviceInfo' instance. + + @param ratedCurrent: Rated current. + @param ratedVoltage: Rated voltage. + @param phaseCount: Number of potential phases the end device supports, typically 0, 1 or 3. + """ + #: Rated current. + self.ratedCurrent = ratedCurrent + + #: Rated voltage. + self.ratedVoltage = ratedVoltage + + #: Number of potential phases the end device supports, typically 0, 1 or 3. + self.phaseCount = phaseCount + + super(EndDeviceInfo, self).__init__(*args, **kw_args) + + _attrs = ["ratedCurrent", "ratedVoltage", "phaseCount"] + _attr_types = {"ratedCurrent": float, "ratedVoltage": float, "phaseCount": int} + _defaults = {"ratedCurrent": 0.0, "ratedVoltage": 0.0, "phaseCount": 0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Asset/IEC61968/AssetModels/OverheadConductorInfo.py b/CIM16/CDPSM/Asset/IEC61968/AssetModels/OverheadConductorInfo.py new file mode 100755 index 00000000..1fa86c4d --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/AssetModels/OverheadConductorInfo.py @@ -0,0 +1,51 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61968.AssetModels.ConductorInfo import ConductorInfo + +class OverheadConductorInfo(ConductorInfo): + """Overhead conductor data. + """ + + def __init__(self, neutralInsulationThickness=0.0, phaseConductorSpacing=0.0, phaseConductorCount=0, *args, **kw_args): + """Initialises a new 'OverheadConductorInfo' instance. + + @param neutralInsulationThickness: (if applicable) Insulation thickness of the neutral conductor. + @param phaseConductorSpacing: Distance between conductor strands in a symmetrical bundle. + @param phaseConductorCount: Number of conductor strands in the symmetrical bundle (1-12). + """ + #: (if applicable) Insulation thickness of the neutral conductor. + self.neutralInsulationThickness = neutralInsulationThickness + + #: Distance between conductor strands in a symmetrical bundle. + self.phaseConductorSpacing = phaseConductorSpacing + + #: Number of conductor strands in the symmetrical bundle (1-12). + self.phaseConductorCount = phaseConductorCount + + super(OverheadConductorInfo, self).__init__(*args, **kw_args) + + _attrs = ["neutralInsulationThickness", "phaseConductorSpacing", "phaseConductorCount"] + _attr_types = {"neutralInsulationThickness": float, "phaseConductorSpacing": float, "phaseConductorCount": int} + _defaults = {"neutralInsulationThickness": 0.0, "phaseConductorSpacing": 0.0, "phaseConductorCount": 0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Asset/IEC61968/AssetModels/PowerTransformerInfo.py b/CIM16/CDPSM/Asset/IEC61968/AssetModels/PowerTransformerInfo.py new file mode 100755 index 00000000..ba275bba --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/AssetModels/PowerTransformerInfo.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo + +class PowerTransformerInfo(AssetInfo): + """Set of power transformer data, from an equipment library. + """ + + def __init__(self, TransformerTankInfo=None, *args, **kw_args): + """Initialises a new 'PowerTransformerInfo' instance. + + @param TransformerTankInfo: Data for all the tanks described by this power transformer data. + """ + self._TransformerTankInfo = [] + self.TransformerTankInfo = [] if TransformerTankInfo is None else TransformerTankInfo + + super(PowerTransformerInfo, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TransformerTankInfo"] + _many_refs = ["TransformerTankInfo"] + + def getTransformerTankInfo(self): + """Data for all the tanks described by this power transformer data. + """ + return self._TransformerTankInfo + + def setTransformerTankInfo(self, value): + for x in self._TransformerTankInfo: + x.PowerTransformerInfo = None + for y in value: + y._PowerTransformerInfo = self + self._TransformerTankInfo = value + + TransformerTankInfo = property(getTransformerTankInfo, setTransformerTankInfo) + + def addTransformerTankInfo(self, *TransformerTankInfo): + for obj in TransformerTankInfo: + obj.PowerTransformerInfo = self + + def removeTransformerTankInfo(self, *TransformerTankInfo): + for obj in TransformerTankInfo: + obj.PowerTransformerInfo = None + diff --git a/CIM16/CDPSM/Asset/IEC61968/AssetModels/TapChangerInfo.py b/CIM16/CDPSM/Asset/IEC61968/AssetModels/TapChangerInfo.py new file mode 100755 index 00000000..2218e898 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/AssetModels/TapChangerInfo.py @@ -0,0 +1,95 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo + +class TapChangerInfo(AssetInfo): + """Tap changer data. + """ + + def __init__(self, lowStep=0, frequency=0.0, ptRatio=0.0, ratedApparentPower=0.0, stepVoltageIncrement=0.0, ctRatio=0.0, ratedVoltage=0.0, neutralStep=0, ratedCurrent=0.0, ctRating=0.0, highStep=0, stepPhaseIncrement=0.0, neutralU=0.0, isTcul=False, *args, **kw_args): + """Initialises a new 'TapChangerInfo' instance. + + @param lowStep: Lowest possible tap step position, retard from neutral. + @param frequency: Frequency at which the ratings apply. + @param ptRatio: Built-in voltage transducer ratio. + @param ratedApparentPower: Rated apparent power. + @param stepVoltageIncrement: Tap step increment, in per cent of rated voltage, per step position. + @param ctRatio: Built-in current transducer ratio. + @param ratedVoltage: Rated voltage. + @param neutralStep: The neutral tap step position for the winding. + @param ratedCurrent: Rated current. + @param ctRating: Built-in current transformer primary rating. + @param highStep: Highest possible tap step position, advance from neutral. + @param stepPhaseIncrement: Phase shift per step position. + @param neutralU: Voltage at which the winding operates at the neutral tap setting. + @param isTcul: Whether this tap changer has under load tap changing capabilities. + """ + #: Lowest possible tap step position, retard from neutral. + self.lowStep = lowStep + + #: Frequency at which the ratings apply. + self.frequency = frequency + + #: Built-in voltage transducer ratio. + self.ptRatio = ptRatio + + #: Rated apparent power. + self.ratedApparentPower = ratedApparentPower + + #: Tap step increment, in per cent of rated voltage, per step position. + self.stepVoltageIncrement = stepVoltageIncrement + + #: Built-in current transducer ratio. + self.ctRatio = ctRatio + + #: Rated voltage. + self.ratedVoltage = ratedVoltage + + #: The neutral tap step position for the winding. + self.neutralStep = neutralStep + + #: Rated current. + self.ratedCurrent = ratedCurrent + + #: Built-in current transformer primary rating. + self.ctRating = ctRating + + #: Highest possible tap step position, advance from neutral. + self.highStep = highStep + + #: Phase shift per step position. + self.stepPhaseIncrement = stepPhaseIncrement + + #: Voltage at which the winding operates at the neutral tap setting. + self.neutralU = neutralU + + #: Whether this tap changer has under load tap changing capabilities. + self.isTcul = isTcul + + super(TapChangerInfo, self).__init__(*args, **kw_args) + + _attrs = ["lowStep", "frequency", "ptRatio", "ratedApparentPower", "stepVoltageIncrement", "ctRatio", "ratedVoltage", "neutralStep", "ratedCurrent", "ctRating", "highStep", "stepPhaseIncrement", "neutralU", "isTcul"] + _attr_types = {"lowStep": int, "frequency": float, "ptRatio": float, "ratedApparentPower": float, "stepVoltageIncrement": float, "ctRatio": float, "ratedVoltage": float, "neutralStep": int, "ratedCurrent": float, "ctRating": float, "highStep": int, "stepPhaseIncrement": float, "neutralU": float, "isTcul": bool} + _defaults = {"lowStep": 0, "frequency": 0.0, "ptRatio": 0.0, "ratedApparentPower": 0.0, "stepVoltageIncrement": 0.0, "ctRatio": 0.0, "ratedVoltage": 0.0, "neutralStep": 0, "ratedCurrent": 0.0, "ctRating": 0.0, "highStep": 0, "stepPhaseIncrement": 0.0, "neutralU": 0.0, "isTcul": False} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Asset/IEC61968/AssetModels/TapeShieldCableInfo.py b/CIM16/CDPSM/Asset/IEC61968/AssetModels/TapeShieldCableInfo.py new file mode 100755 index 00000000..fcc73ca6 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/AssetModels/TapeShieldCableInfo.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61968.AssetModels.CableInfo import CableInfo + +class TapeShieldCableInfo(CableInfo): + """Tape shield cable data. + """ + + def __init__(self, tapeLap=0.0, tapeThickness=0.0, *args, **kw_args): + """Initialises a new 'TapeShieldCableInfo' instance. + + @param tapeLap: Percentage of the tape shield width that overlaps in each wrap, typically 10% to 25%. + @param tapeThickness: Thickness of the tape shield, before wrapping. + """ + #: Percentage of the tape shield width that overlaps in each wrap, typically 10% to 25%. + self.tapeLap = tapeLap + + #: Thickness of the tape shield, before wrapping. + self.tapeThickness = tapeThickness + + super(TapeShieldCableInfo, self).__init__(*args, **kw_args) + + _attrs = ["tapeLap", "tapeThickness"] + _attr_types = {"tapeLap": float, "tapeThickness": float} + _defaults = {"tapeLap": 0.0, "tapeThickness": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Asset/IEC61968/AssetModels/TransformerEndInfo.py b/CIM16/CDPSM/Asset/IEC61968/AssetModels/TransformerEndInfo.py new file mode 100755 index 00000000..4e329cb9 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/AssetModels/TransformerEndInfo.py @@ -0,0 +1,122 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo + +class TransformerEndInfo(AssetInfo): + """Transformer end data. + """ + + def __init__(self, ratedU=0.0, endNumber=0, phaseAngleClock=0, emergencyS=0.0, ratedS=0.0, shortTermS=0.0, r=0.0, insulationU=0.0, connectionKind="Z", TransformerTankInfo=None, TransformerEnd=None, *args, **kw_args): + """Initialises a new 'TransformerEndInfo' instance. + + @param ratedU: Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings. + @param endNumber: Number for this transformer end, corresponding to the end's order in the PowerTransformer.vectorGroup attribute. Highest voltage winding should be 1. + @param phaseAngleClock: Winding phase angle where 360 degrees are represented with clock hours, so the valid values are {0, ..., 11}. For example, to express winding code 'Dyn11', set attributes as follows: 'connectionKind' = Yn and 'phaseAngleClock' = 11. + @param emergencyS: Apparent power that the winding can carry under emergency conditions (also called long-term emergency power). + @param ratedS: Normal apparent power rating. + @param shortTermS: Apparent power that this winding can carry for a short period of time (in emergency). + @param r: DC resistance. + @param insulationU: Basic insulation level voltage rating. + @param connectionKind: Kind of connection. Values are: "Z", "A", "Yn", "Y", "Zn", "D", "I" + @param TransformerTankInfo: Transformer tank data that this end description is part of. + @param TransformerEnd: All transformer ends described by this end data. + """ + #: Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings. + self.ratedU = ratedU + + #: Number for this transformer end, corresponding to the end's order in the PowerTransformer.vectorGroup attribute. Highest voltage winding should be 1. + self.endNumber = endNumber + + #: Winding phase angle where 360 degrees are represented with clock hours, so the valid values are {0, ..., 11}. For example, to express winding code 'Dyn11', set attributes as follows: 'connectionKind' = Yn and 'phaseAngleClock' = 11. + self.phaseAngleClock = phaseAngleClock + + #: Apparent power that the winding can carry under emergency conditions (also called long-term emergency power). + self.emergencyS = emergencyS + + #: Normal apparent power rating. + self.ratedS = ratedS + + #: Apparent power that this winding can carry for a short period of time (in emergency). + self.shortTermS = shortTermS + + #: DC resistance. + self.r = r + + #: Basic insulation level voltage rating. + self.insulationU = insulationU + + #: Kind of connection. Values are: "Z", "A", "Yn", "Y", "Zn", "D", "I" + self.connectionKind = connectionKind + + self._TransformerTankInfo = None + self.TransformerTankInfo = TransformerTankInfo + + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + super(TransformerEndInfo, self).__init__(*args, **kw_args) + + _attrs = ["ratedU", "endNumber", "phaseAngleClock", "emergencyS", "ratedS", "shortTermS", "r", "insulationU", "connectionKind"] + _attr_types = {"ratedU": float, "endNumber": int, "phaseAngleClock": int, "emergencyS": float, "ratedS": float, "shortTermS": float, "r": float, "insulationU": float, "connectionKind": str} + _defaults = {"ratedU": 0.0, "endNumber": 0, "phaseAngleClock": 0, "emergencyS": 0.0, "ratedS": 0.0, "shortTermS": 0.0, "r": 0.0, "insulationU": 0.0, "connectionKind": "Z"} + _enums = {"connectionKind": "WindingConnection"} + _refs = ["TransformerTankInfo", "TransformerEnd"] + _many_refs = ["TransformerEnd"] + + def getTransformerTankInfo(self): + """Transformer tank data that this end description is part of. + """ + return self._TransformerTankInfo + + def setTransformerTankInfo(self, value): + if self._TransformerTankInfo is not None: + filtered = [x for x in self.TransformerTankInfo.TransformerEndInfos if x != self] + self._TransformerTankInfo._TransformerEndInfos = filtered + + self._TransformerTankInfo = value + if self._TransformerTankInfo is not None: + if self not in self._TransformerTankInfo._TransformerEndInfos: + self._TransformerTankInfo._TransformerEndInfos.append(self) + + TransformerTankInfo = property(getTransformerTankInfo, setTransformerTankInfo) + + def getTransformerEnd(self): + """All transformer ends described by this end data. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.TransformerEndInfo = None + for y in value: + y._TransformerEndInfo = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.TransformerEndInfo = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.TransformerEndInfo = None + diff --git a/CIM16/CDPSM/Asset/IEC61968/AssetModels/TransformerTankInfo.py b/CIM16/CDPSM/Asset/IEC61968/AssetModels/TransformerTankInfo.py new file mode 100755 index 00000000..6e9a03dc --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/AssetModels/TransformerTankInfo.py @@ -0,0 +1,112 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo + +class TransformerTankInfo(AssetInfo): + """Set of transformer tank data, from an equipment library. + """ + + def __init__(self, PowerTransformerInfo=None, TransformerEndInfos=None, TransformerTanks=None, *args, **kw_args): + """Initialises a new 'TransformerTankInfo' instance. + + @param PowerTransformerInfo: Power transformer data that this tank description is part of. + @param TransformerEndInfos: Data for all the ends described by this transformer tank data. + @param TransformerTanks: All transformer tanks that can be described with this transformer tank data. + """ + self._PowerTransformerInfo = None + self.PowerTransformerInfo = PowerTransformerInfo + + self._TransformerEndInfos = [] + self.TransformerEndInfos = [] if TransformerEndInfos is None else TransformerEndInfos + + self._TransformerTanks = [] + self.TransformerTanks = [] if TransformerTanks is None else TransformerTanks + + super(TransformerTankInfo, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["PowerTransformerInfo", "TransformerEndInfos", "TransformerTanks"] + _many_refs = ["TransformerEndInfos", "TransformerTanks"] + + def getPowerTransformerInfo(self): + """Power transformer data that this tank description is part of. + """ + return self._PowerTransformerInfo + + def setPowerTransformerInfo(self, value): + if self._PowerTransformerInfo is not None: + filtered = [x for x in self.PowerTransformerInfo.TransformerTankInfo if x != self] + self._PowerTransformerInfo._TransformerTankInfo = filtered + + self._PowerTransformerInfo = value + if self._PowerTransformerInfo is not None: + if self not in self._PowerTransformerInfo._TransformerTankInfo: + self._PowerTransformerInfo._TransformerTankInfo.append(self) + + PowerTransformerInfo = property(getPowerTransformerInfo, setPowerTransformerInfo) + + def getTransformerEndInfos(self): + """Data for all the ends described by this transformer tank data. + """ + return self._TransformerEndInfos + + def setTransformerEndInfos(self, value): + for x in self._TransformerEndInfos: + x.TransformerTankInfo = None + for y in value: + y._TransformerTankInfo = self + self._TransformerEndInfos = value + + TransformerEndInfos = property(getTransformerEndInfos, setTransformerEndInfos) + + def addTransformerEndInfos(self, *TransformerEndInfos): + for obj in TransformerEndInfos: + obj.TransformerTankInfo = self + + def removeTransformerEndInfos(self, *TransformerEndInfos): + for obj in TransformerEndInfos: + obj.TransformerTankInfo = None + + def getTransformerTanks(self): + """All transformer tanks that can be described with this transformer tank data. + """ + return self._TransformerTanks + + def setTransformerTanks(self, value): + for x in self._TransformerTanks: + x.TransformerTankInfo = None + for y in value: + y._TransformerTankInfo = self + self._TransformerTanks = value + + TransformerTanks = property(getTransformerTanks, setTransformerTanks) + + def addTransformerTanks(self, *TransformerTanks): + for obj in TransformerTanks: + obj.TransformerTankInfo = self + + def removeTransformerTanks(self, *TransformerTanks): + for obj in TransformerTanks: + obj.TransformerTankInfo = None + diff --git a/CIM16/CDPSM/Asset/IEC61968/AssetModels/WireArrangement.py b/CIM16/CDPSM/Asset/IEC61968/AssetModels/WireArrangement.py new file mode 100755 index 00000000..579816f9 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/AssetModels/WireArrangement.py @@ -0,0 +1,93 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class WireArrangement(IdentifiedObject): + """Identification, spacing and configuration of the wires of a conductor, with reference to their type. + """ + + def __init__(self, mountingPointY=0.0, position=0, mountingPointX=0.0, WireType=None, ConductorInfo=None, *args, **kw_args): + """Initialises a new 'WireArrangement' instance. + + @param mountingPointY: Height above ground of the first wire. + @param position: Position number on the structure corresponding to this wire. For example, use 1..3 for phases and 4 for the neutral on a 3-phase structure. The individual phase assignments matter; for example, ABC will produce a different set of unbalanced line parameters, by phase, than BAC. + @param mountingPointX: Signed horizontal distance from the first wire to a common reference point. + @param WireType: Wire type used for this wire arrangement. + @param ConductorInfo: Conductor data this wire arrangement belongs to. + """ + #: Height above ground of the first wire. + self.mountingPointY = mountingPointY + + #: Position number on the structure corresponding to this wire. For example, use 1..3 for phases and 4 for the neutral on a 3-phase structure. The individual phase assignments matter; for example, ABC will produce a different set of unbalanced line parameters, by phase, than BAC. + self.position = position + + #: Signed horizontal distance from the first wire to a common reference point. + self.mountingPointX = mountingPointX + + self._WireType = None + self.WireType = WireType + + self._ConductorInfo = None + self.ConductorInfo = ConductorInfo + + super(WireArrangement, self).__init__(*args, **kw_args) + + _attrs = ["mountingPointY", "position", "mountingPointX"] + _attr_types = {"mountingPointY": float, "position": int, "mountingPointX": float} + _defaults = {"mountingPointY": 0.0, "position": 0, "mountingPointX": 0.0} + _enums = {} + _refs = ["WireType", "ConductorInfo"] + _many_refs = [] + + def getWireType(self): + """Wire type used for this wire arrangement. + """ + return self._WireType + + def setWireType(self, value): + if self._WireType is not None: + filtered = [x for x in self.WireType.WireArrangements if x != self] + self._WireType._WireArrangements = filtered + + self._WireType = value + if self._WireType is not None: + if self not in self._WireType._WireArrangements: + self._WireType._WireArrangements.append(self) + + WireType = property(getWireType, setWireType) + + def getConductorInfo(self): + """Conductor data this wire arrangement belongs to. + """ + return self._ConductorInfo + + def setConductorInfo(self, value): + if self._ConductorInfo is not None: + filtered = [x for x in self.ConductorInfo.WireArrangements if x != self] + self._ConductorInfo._WireArrangements = filtered + + self._ConductorInfo = value + if self._ConductorInfo is not None: + if self not in self._ConductorInfo._WireArrangements: + self._ConductorInfo._WireArrangements.append(self) + + ConductorInfo = property(getConductorInfo, setConductorInfo) + diff --git a/CIM16/CDPSM/Asset/IEC61968/AssetModels/WireType.py b/CIM16/CDPSM/Asset/IEC61968/AssetModels/WireType.py new file mode 100755 index 00000000..b739f492 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/AssetModels/WireType.py @@ -0,0 +1,113 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class WireType(IdentifiedObject): + """Wire conductor (per IEEE specs). A specific type of wire or combination of wires, not insulated from each other, suitable for carrying electrical current. + """ + + def __init__(self, rDC20=0.0, coreRadius=0.0, rAC75=0.0, material="aluminum", ratedCurrent=0.0, strandCount=0, rAC25=0.0, rAC50=0.0, radius=0.0, gmr=0.0, coreStrandCount=0, sizeDescription='', WireArrangements=None, *args, **kw_args): + """Initialises a new 'WireType' instance. + + @param rDC20: DC resistance per unit length of the conductor at 20 oC. + @param coreRadius: (if there is a different core material) Radius of the central core. + @param rAC75: AC resistance per unit length of the conductor at 75 oC. + @param material: Wire material. Values are: "aluminum", "copper", "other", "steel", "acsr" + @param ratedCurrent: Current carrying capacity of the wire under stated thermal conditions. + @param strandCount: Number of strands in the wire. + @param rAC25: AC resistance per unit length of the conductor at 25 oC. + @param rAC50: AC resistance per unit length of the conductor at 50 oC. + @param radius: Outside radius of the wire. + @param gmr: Geometric mean radius. If we replace the conductor by a thin walled tube of radius GMR, then its reactance is identical to the reactance of the actual conductor. + @param coreStrandCount: (if used) Number of strands in the steel core. + @param sizeDescription: Describes the wire guage or cross section (e.g., 4/0, #2, 336.5). + @param WireArrangements: All wire arrangements using this wire type. + """ + #: DC resistance per unit length of the conductor at 20 oC. + self.rDC20 = rDC20 + + #: (if there is a different core material) Radius of the central core. + self.coreRadius = coreRadius + + #: AC resistance per unit length of the conductor at 75 oC. + self.rAC75 = rAC75 + + #: Wire material. Values are: "aluminum", "copper", "other", "steel", "acsr" + self.material = material + + #: Current carrying capacity of the wire under stated thermal conditions. + self.ratedCurrent = ratedCurrent + + #: Number of strands in the wire. + self.strandCount = strandCount + + #: AC resistance per unit length of the conductor at 25 oC. + self.rAC25 = rAC25 + + #: AC resistance per unit length of the conductor at 50 oC. + self.rAC50 = rAC50 + + #: Outside radius of the wire. + self.radius = radius + + #: Geometric mean radius. If we replace the conductor by a thin walled tube of radius GMR, then its reactance is identical to the reactance of the actual conductor. + self.gmr = gmr + + #: (if used) Number of strands in the steel core. + self.coreStrandCount = coreStrandCount + + #: Describes the wire guage or cross section (e.g., 4/0, #2, 336.5). + self.sizeDescription = sizeDescription + + self._WireArrangements = [] + self.WireArrangements = [] if WireArrangements is None else WireArrangements + + super(WireType, self).__init__(*args, **kw_args) + + _attrs = ["rDC20", "coreRadius", "rAC75", "material", "ratedCurrent", "strandCount", "rAC25", "rAC50", "radius", "gmr", "coreStrandCount", "sizeDescription"] + _attr_types = {"rDC20": float, "coreRadius": float, "rAC75": float, "material": str, "ratedCurrent": float, "strandCount": int, "rAC25": float, "rAC50": float, "radius": float, "gmr": float, "coreStrandCount": int, "sizeDescription": str} + _defaults = {"rDC20": 0.0, "coreRadius": 0.0, "rAC75": 0.0, "material": "aluminum", "ratedCurrent": 0.0, "strandCount": 0, "rAC25": 0.0, "rAC50": 0.0, "radius": 0.0, "gmr": 0.0, "coreStrandCount": 0, "sizeDescription": ''} + _enums = {"material": "ConductorMaterialKind"} + _refs = ["WireArrangements"] + _many_refs = ["WireArrangements"] + + def getWireArrangements(self): + """All wire arrangements using this wire type. + """ + return self._WireArrangements + + def setWireArrangements(self, value): + for x in self._WireArrangements: + x.WireType = None + for y in value: + y._WireType = self + self._WireArrangements = value + + WireArrangements = property(getWireArrangements, setWireArrangements) + + def addWireArrangements(self, *WireArrangements): + for obj in WireArrangements: + obj.WireType = self + + def removeWireArrangements(self, *WireArrangements): + for obj in WireArrangements: + obj.WireType = None + diff --git a/CIM16/CDPSM/Asset/IEC61968/AssetModels/__init__.py b/CIM16/CDPSM/Asset/IEC61968/AssetModels/__init__.py new file mode 100755 index 00000000..90c33d82 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/AssetModels/__init__.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package is an extension of Assets package and contains the core information classes that support asset management and different network and work planning applications with specialized AssetInfo subclasses. They hold attributes that can be referenced by not only Asset-s or AssetModel-s but also by ConductingEquipment-s. +""" + +from CIM16.CDPSM.Asset.IEC61968.AssetModels.ConductorInfo import ConductorInfo +from CIM16.CDPSM.Asset.IEC61968.AssetModels.WireArrangement import WireArrangement +from CIM16.CDPSM.Asset.IEC61968.AssetModels.WireType import WireType +from CIM16.CDPSM.Asset.IEC61968.AssetModels.EndDeviceInfo import EndDeviceInfo +from CIM16.CDPSM.Asset.IEC61968.AssetModels.OverheadConductorInfo import OverheadConductorInfo +from CIM16.CDPSM.Asset.IEC61968.AssetModels.TapChangerInfo import TapChangerInfo +from CIM16.CDPSM.Asset.IEC61968.AssetModels.TransformerTankInfo import TransformerTankInfo +from CIM16.CDPSM.Asset.IEC61968.AssetModels.CableInfo import CableInfo +from CIM16.CDPSM.Asset.IEC61968.AssetModels.ConcentricNeutralCableInfo import ConcentricNeutralCableInfo +from CIM16.CDPSM.Asset.IEC61968.AssetModels.TapeShieldCableInfo import TapeShieldCableInfo +from CIM16.CDPSM.Asset.IEC61968.AssetModels.TransformerEndInfo import TransformerEndInfo +from CIM16.CDPSM.Asset.IEC61968.AssetModels.PowerTransformerInfo import PowerTransformerInfo + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM/Asset#AssetModels" +nsPrefix = "cimAssetModels" + + +class ConductorMaterialKind(str): + """Values are: aluminum, copper, other, steel, acsr + """ + pass + +class CableOuterJacketKind(str): + """Values are: pvc, linearLowDensityPolyethylene, none, insulating, other, polyethylene, semiconducting + """ + pass + +class ConductorUsageKind(str): + """Values are: secondary, other, distribution, transmission + """ + pass + +class CableConstructionKind(str): + """Values are: sector, other, solid, compacted, stranded, segmental, compressed + """ + pass + +class ConductorInsulationKind(str): + """Values are: treeRetardantCrosslinkedPolyethylene, butyl, highPressureFluidFilled, other, varnishedCambricCloth, siliconRubber, beltedPilc, crosslinkedPolyethylene, oilPaper, lowCapacitanceRubber, asbestosAndVarnishedCambric, treeResistantHighMolecularWeightPolyethylene, unbeltedPilc, ozoneResistantRubber, ethylenePropyleneRubber, highMolecularWeightPolyethylene, varnishedDacronGlass, rubber + """ + pass + +class CableShieldMaterialKind(str): + """Values are: lead, aluminum, other, copper, steel + """ + pass diff --git a/CIM16/CDPSM/Asset/IEC61968/Assets/AssetInfo.py b/CIM16/CDPSM/Asset/IEC61968/Assets/AssetInfo.py new file mode 100755 index 00000000..6c1474e7 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/Assets/AssetInfo.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class AssetInfo(IdentifiedObject): + """Set of attributes of an asset, representing typical data-sheet information of a physical device, that can be instantiated and shared in different data exchange contexts: - as attributes of an asset instance (installed or in stock) - as attributes of an asset model (product by a manufacturer) - as attributes of a type asset (generic type of an asset as used in designs/extension planning). + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'AssetInfo' instance. + + """ + super(AssetInfo, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Asset/IEC61968/Assets/__init__.py b/CIM16/CDPSM/Asset/IEC61968/Assets/__init__.py new file mode 100755 index 00000000..bf28ee62 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/Assets/__init__.py @@ -0,0 +1,28 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package contains the core information classes that support asset management applications that deal with the physical and lifecycle aspects of various network resources (as opposed to power system resource models defined in IEC61970::Wires package, which support network applications). +""" + +from CIM16.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM/Asset#Assets" +nsPrefix = "cimAssets" + diff --git a/CIM16/CDPSM/Asset/IEC61968/__init__.py b/CIM16/CDPSM/Asset/IEC61968/__init__.py new file mode 100755 index 00000000..7acb8eae --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61968/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package is an extension of the Metering package and contains the information classes that support specialised applications such as prepayment metering. These classes are generally associated with the collection and control of revenue from the customer for a delivered service. +""" + + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM/Asset#IEC61968" +nsPrefix = "cimIEC61968" + diff --git a/CIM16/CDPSM/Asset/IEC61970/Core/IdentifiedObject.py b/CIM16/CDPSM/Asset/IEC61970/Core/IdentifiedObject.py new file mode 100755 index 00000000..7252fe26 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61970/Core/IdentifiedObject.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.Element import Element + +class IdentifiedObject(Element): + """This is a root class to provide common identification for all classes needing identification and naming attributes + """ + + def __init__(self, name='', aliasName='', Names=None, *args, **kw_args): + """Initialises a new 'IdentifiedObject' instance. + + @param name: The name is any free human readable and possibly non unique text naming the object. + @param aliasName: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + @param Names: All names of this identified object. + """ + #: The name is any free human readable and possibly non unique text naming the object. + self.name = name + + #: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + self.aliasName = aliasName + + self._Names = [] + self.Names = [] if Names is None else Names + + super(IdentifiedObject, self).__init__(*args, **kw_args) + + _attrs = ["name", "aliasName"] + _attr_types = {"name": str, "aliasName": str} + _defaults = {"name": '', "aliasName": ''} + _enums = {} + _refs = ["Names"] + _many_refs = ["Names"] + + def getNames(self): + """All names of this identified object. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.IdentifiedObject = None + for y in value: + y._IdentifiedObject = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = self + + def removeNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = None + diff --git a/CIM16/CDPSM/Asset/IEC61970/Core/Name.py b/CIM16/CDPSM/Asset/IEC61970/Core/Name.py new file mode 100755 index 00000000..a30f1e84 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61970/Core/Name.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.Element import Element + +class Name(Element): + """The Name class provides the means to define any number of human readable names for an object. A name is not to be used for defining inter-object relationships. For inter-object relationships instead use the object identification 'mRID'. + """ + + def __init__(self, name='', IdentifiedObject=None, NameType=None, *args, **kw_args): + """Initialises a new 'Name' instance. + + @param name: Any free text that name the object. + @param IdentifiedObject: Identified object that this name designates. + @param NameType: Type of this name. + """ + #: Any free text that name the object. + self.name = name + + self._IdentifiedObject = None + self.IdentifiedObject = IdentifiedObject + + self._NameType = None + self.NameType = NameType + + super(Name, self).__init__(*args, **kw_args) + + _attrs = ["name"] + _attr_types = {"name": str} + _defaults = {"name": ''} + _enums = {} + _refs = ["IdentifiedObject", "NameType"] + _many_refs = [] + + def getIdentifiedObject(self): + """Identified object that this name designates. + """ + return self._IdentifiedObject + + def setIdentifiedObject(self, value): + if self._IdentifiedObject is not None: + filtered = [x for x in self.IdentifiedObject.Names if x != self] + self._IdentifiedObject._Names = filtered + + self._IdentifiedObject = value + if self._IdentifiedObject is not None: + if self not in self._IdentifiedObject._Names: + self._IdentifiedObject._Names.append(self) + + IdentifiedObject = property(getIdentifiedObject, setIdentifiedObject) + + def getNameType(self): + """Type of this name. + """ + return self._NameType + + def setNameType(self, value): + if self._NameType is not None: + filtered = [x for x in self.NameType.Names if x != self] + self._NameType._Names = filtered + + self._NameType = value + if self._NameType is not None: + if self not in self._NameType._Names: + self._NameType._Names.append(self) + + NameType = property(getNameType, setNameType) + diff --git a/CIM16/CDPSM/Asset/IEC61970/Core/NameType.py b/CIM16/CDPSM/Asset/IEC61970/Core/NameType.py new file mode 100755 index 00000000..e0d1163d --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61970/Core/NameType.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.Element import Element + +class NameType(Element): + """Type of name. Possible values for attribute 'name' are implementation dependent but standard profiles may specify types. An enterprise may have multiple IT systems each having its own local name for the same object, e.g. a planning system may have different names from an EMS. An object may also have different names within the same IT system, e.g. localName and aliasName as defined in CIM version 14. Their definitions from CIM14 are The localName is a human readable name of the object. It is only used with objects organized in a naming hierarchy. localName: A free text name local to a node in a naming hierarchy similar to a file directory structure. A power system related naming hierarchy may be: Substation, VoltageLevel, Equipment etc. Children of the same parent in such a hierarchy have names that typically are unique among them. aliasName: A free text alternate name typically used in tabular reports where the column width is limited. + """ + + def __init__(self, Names=None, *args, **kw_args): + """Initialises a new 'NameType' instance. + + @param Names: All names of this type. + """ + self._Names = [] + self.Names = [] if Names is None else Names + + super(NameType, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Names"] + _many_refs = ["Names"] + + def getNames(self): + """All names of this type. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.NameType = None + for y in value: + y._NameType = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.NameType = self + + def removeNames(self, *Names): + for obj in Names: + obj.NameType = None + diff --git a/CIM16/CDPSM/Asset/IEC61970/Core/__init__.py b/CIM16/CDPSM/Asset/IEC61970/Core/__init__.py new file mode 100755 index 00000000..f98a6077 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61970/Core/__init__.py @@ -0,0 +1,30 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""Contains the core PowerSystemResource and ConductingEquipment entities shared by all applications plus common collections of those entities. Not all applications require all the Core entities. This package does not depend on any other package except the Domain package, but most of the other packages have associations and generalizations that depend on it. +""" + +from CIM16.CDPSM.Asset.IEC61970.Core.NameType import NameType +from CIM16.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject +from CIM16.CDPSM.Asset.IEC61970.Core.Name import Name + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM/Asset#Core" +nsPrefix = "cimCore" + diff --git a/CIM16/CDPSM/Asset/IEC61970/Wires/ACLineSegment.py b/CIM16/CDPSM/Asset/IEC61970/Wires/ACLineSegment.py new file mode 100755 index 00000000..54dd07e5 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61970/Wires/ACLineSegment.py @@ -0,0 +1,102 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ACLineSegment(IdentifiedObject): + """A wire or combination of wires, with consistent electrical characteristics, building a single electrical system, used to carry alternating current between points in the power system. For symmetrical, transposed 3ph lines, it is sufficient to use ACLineSegment attributes, which describe sequence impedances and admittances for the entire length of the segment. If per lenght impedance data is available from a library of standard types, impedances and admittances can be calculated in one of the following ways: - calculate electrical parameters from asset data, using associated ConductorInfo, with values then multiplied by Conductor.length to produce a matrix model. - calculate unbalanced electrical parameters from associated PerLengthPhaseImpedance, then multiplied by Conductor.length to produce a matrix model. - calculate transposed electrical parameters from associated PerLengthSequenceImpedance, then multiplied by Conductor.length to produce a sequence model. + """ + + def __init__(self, SequenceImpedance=None, ConductorInfo=None, PhaseImpedance=None, *args, **kw_args): + """Initialises a new 'ACLineSegment' instance. + + @param SequenceImpedance: Sequence impedance of this line segment; used for balanced model. + @param ConductorInfo: Conductor data for this line segment. + @param PhaseImpedance: Phase impedance of this line segment; used for unbalanced model. + """ + self._SequenceImpedance = None + self.SequenceImpedance = SequenceImpedance + + self._ConductorInfo = None + self.ConductorInfo = ConductorInfo + + self._PhaseImpedance = None + self.PhaseImpedance = PhaseImpedance + + super(ACLineSegment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["SequenceImpedance", "ConductorInfo", "PhaseImpedance"] + _many_refs = [] + + def getSequenceImpedance(self): + """Sequence impedance of this line segment; used for balanced model. + """ + return self._SequenceImpedance + + def setSequenceImpedance(self, value): + if self._SequenceImpedance is not None: + filtered = [x for x in self.SequenceImpedance.LineSegments if x != self] + self._SequenceImpedance._LineSegments = filtered + + self._SequenceImpedance = value + if self._SequenceImpedance is not None: + if self not in self._SequenceImpedance._LineSegments: + self._SequenceImpedance._LineSegments.append(self) + + SequenceImpedance = property(getSequenceImpedance, setSequenceImpedance) + + def getConductorInfo(self): + """Conductor data for this line segment. + """ + return self._ConductorInfo + + def setConductorInfo(self, value): + if self._ConductorInfo is not None: + filtered = [x for x in self.ConductorInfo.LineSegments if x != self] + self._ConductorInfo._LineSegments = filtered + + self._ConductorInfo = value + if self._ConductorInfo is not None: + if self not in self._ConductorInfo._LineSegments: + self._ConductorInfo._LineSegments.append(self) + + ConductorInfo = property(getConductorInfo, setConductorInfo) + + def getPhaseImpedance(self): + """Phase impedance of this line segment; used for unbalanced model. + """ + return self._PhaseImpedance + + def setPhaseImpedance(self, value): + if self._PhaseImpedance is not None: + filtered = [x for x in self.PhaseImpedance.LineSegments if x != self] + self._PhaseImpedance._LineSegments = filtered + + self._PhaseImpedance = value + if self._PhaseImpedance is not None: + if self not in self._PhaseImpedance._LineSegments: + self._PhaseImpedance._LineSegments.append(self) + + PhaseImpedance = property(getPhaseImpedance, setPhaseImpedance) + diff --git a/CIM16/CDPSM/Asset/IEC61970/Wires/PerLengthPhaseImpedance.py b/CIM16/CDPSM/Asset/IEC61970/Wires/PerLengthPhaseImpedance.py new file mode 100755 index 00000000..1d9cf6a7 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61970/Wires/PerLengthPhaseImpedance.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PerLengthPhaseImpedance(IdentifiedObject): + """Impedance and admittance parameters per unit length for n-wire unbalanced lines, in matrix form. + """ + + def __init__(self, LineSegments=None, *args, **kw_args): + """Initialises a new 'PerLengthPhaseImpedance' instance. + + @param LineSegments: All line segments described by this phase impedance. + """ + self._LineSegments = [] + self.LineSegments = [] if LineSegments is None else LineSegments + + super(PerLengthPhaseImpedance, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["LineSegments"] + _many_refs = ["LineSegments"] + + def getLineSegments(self): + """All line segments described by this phase impedance. + """ + return self._LineSegments + + def setLineSegments(self, value): + for x in self._LineSegments: + x.PhaseImpedance = None + for y in value: + y._PhaseImpedance = self + self._LineSegments = value + + LineSegments = property(getLineSegments, setLineSegments) + + def addLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.PhaseImpedance = self + + def removeLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.PhaseImpedance = None + diff --git a/CIM16/CDPSM/Asset/IEC61970/Wires/PerLengthSequenceImpedance.py b/CIM16/CDPSM/Asset/IEC61970/Wires/PerLengthSequenceImpedance.py new file mode 100755 index 00000000..1f744184 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61970/Wires/PerLengthSequenceImpedance.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PerLengthSequenceImpedance(IdentifiedObject): + """Sequence impedance and admittance parameters per unit length, for transposed lines of 1, 2, or 3 phases. For 1-phase lines, define x=x0=xself. For 2-phase lines, define x=xs-xm and x0=xs+xm. + """ + + def __init__(self, LineSegments=None, *args, **kw_args): + """Initialises a new 'PerLengthSequenceImpedance' instance. + + @param LineSegments: All line segments described by this sequence impedance. + """ + self._LineSegments = [] + self.LineSegments = [] if LineSegments is None else LineSegments + + super(PerLengthSequenceImpedance, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["LineSegments"] + _many_refs = ["LineSegments"] + + def getLineSegments(self): + """All line segments described by this sequence impedance. + """ + return self._LineSegments + + def setLineSegments(self, value): + for x in self._LineSegments: + x.SequenceImpedance = None + for y in value: + y._SequenceImpedance = self + self._LineSegments = value + + LineSegments = property(getLineSegments, setLineSegments) + + def addLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.SequenceImpedance = self + + def removeLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.SequenceImpedance = None + diff --git a/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerCoreAdmittance.py b/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerCoreAdmittance.py new file mode 100755 index 00000000..d01b7ca6 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerCoreAdmittance.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerCoreAdmittance(IdentifiedObject): + + def __init__(self, TransformerEnd=None, *args, **kw_args): + """Initialises a new 'TransformerCoreAdmittance' instance. + + @param TransformerEnd: All transformer ends having this core admittance. + """ + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + super(TransformerCoreAdmittance, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TransformerEnd"] + _many_refs = ["TransformerEnd"] + + def getTransformerEnd(self): + """All transformer ends having this core admittance. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.CoreAdmittance = None + for y in value: + y._CoreAdmittance = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.CoreAdmittance = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.CoreAdmittance = None + diff --git a/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerEnd.py b/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerEnd.py new file mode 100755 index 00000000..cd64a8b6 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerEnd.py @@ -0,0 +1,102 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerEnd(IdentifiedObject): + """TransformerEnd is a conducting connection point of a power transformer. It corresponds to a physical transformer winding terminal. In earlier CIM versions, the TransformerWinding class served a similar purpose. This successor TransformerEnd class is more flexible and has important differences with TransformerWinding. + """ + + def __init__(self, CoreAdmittance=None, TransformerEndInfo=None, StarImpedance=None, *args, **kw_args): + """Initialises a new 'TransformerEnd' instance. + + @param CoreAdmittance: Core admittance of this transformer end, representing magnetising current and core losses. The full values of the transformer should be supplied for one transformer end only. + @param TransformerEndInfo: Data for this transformer end. + @param StarImpedance: (accurate for 2- or 3-winding transformers only) Pi-model impedances of this transformer end. By convention, for a two winding transformer, the full values of the transformer should be entered on the high voltage end (endNumber=1). + """ + self._CoreAdmittance = None + self.CoreAdmittance = CoreAdmittance + + self._TransformerEndInfo = None + self.TransformerEndInfo = TransformerEndInfo + + self._StarImpedance = None + self.StarImpedance = StarImpedance + + super(TransformerEnd, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["CoreAdmittance", "TransformerEndInfo", "StarImpedance"] + _many_refs = [] + + def getCoreAdmittance(self): + """Core admittance of this transformer end, representing magnetising current and core losses. The full values of the transformer should be supplied for one transformer end only. + """ + return self._CoreAdmittance + + def setCoreAdmittance(self, value): + if self._CoreAdmittance is not None: + filtered = [x for x in self.CoreAdmittance.TransformerEnd if x != self] + self._CoreAdmittance._TransformerEnd = filtered + + self._CoreAdmittance = value + if self._CoreAdmittance is not None: + if self not in self._CoreAdmittance._TransformerEnd: + self._CoreAdmittance._TransformerEnd.append(self) + + CoreAdmittance = property(getCoreAdmittance, setCoreAdmittance) + + def getTransformerEndInfo(self): + """Data for this transformer end. + """ + return self._TransformerEndInfo + + def setTransformerEndInfo(self, value): + if self._TransformerEndInfo is not None: + filtered = [x for x in self.TransformerEndInfo.TransformerEnd if x != self] + self._TransformerEndInfo._TransformerEnd = filtered + + self._TransformerEndInfo = value + if self._TransformerEndInfo is not None: + if self not in self._TransformerEndInfo._TransformerEnd: + self._TransformerEndInfo._TransformerEnd.append(self) + + TransformerEndInfo = property(getTransformerEndInfo, setTransformerEndInfo) + + def getStarImpedance(self): + """(accurate for 2- or 3-winding transformers only) Pi-model impedances of this transformer end. By convention, for a two winding transformer, the full values of the transformer should be entered on the high voltage end (endNumber=1). + """ + return self._StarImpedance + + def setStarImpedance(self, value): + if self._StarImpedance is not None: + filtered = [x for x in self.StarImpedance.TransformerEnd if x != self] + self._StarImpedance._TransformerEnd = filtered + + self._StarImpedance = value + if self._StarImpedance is not None: + if self not in self._StarImpedance._TransformerEnd: + self._StarImpedance._TransformerEnd.append(self) + + StarImpedance = property(getStarImpedance, setStarImpedance) + diff --git a/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerStarImpedance.py b/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerStarImpedance.py new file mode 100755 index 00000000..0511fc7c --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerStarImpedance.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerStarImpedance(IdentifiedObject): + """Transformer star impedance (Pi-model) that accurately reflects impedance for transformers with 2 or 3 windings. For transformers with 4 or more windings, you must use TransformerTank model and related classes. For transmission networks use PowerTransformerEnd impedances (r, r0, x, x0, b, b0, g and g0). + """ + + def __init__(self, TransformerEnd=None, *args, **kw_args): + """Initialises a new 'TransformerStarImpedance' instance. + + @param TransformerEnd: All transformer ends having this star impedance. + """ + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + super(TransformerStarImpedance, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TransformerEnd"] + _many_refs = ["TransformerEnd"] + + def getTransformerEnd(self): + """All transformer ends having this star impedance. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.StarImpedance = None + for y in value: + y._StarImpedance = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.StarImpedance = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.StarImpedance = None + diff --git a/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerTank.py b/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerTank.py new file mode 100755 index 00000000..40022139 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerTank.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerTank(IdentifiedObject): + """An assembly of two or more coupled windings that transform electrical power between voltage levels. These windings are bound on a common core and place in the same tank. Transformer tank can be used to model both single-phase and 3-phase transformers. + """ + + def __init__(self, TransformerTankInfo=None, *args, **kw_args): + """Initialises a new 'TransformerTank' instance. + + @param TransformerTankInfo: Transformer tank data. + """ + self._TransformerTankInfo = None + self.TransformerTankInfo = TransformerTankInfo + + super(TransformerTank, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TransformerTankInfo"] + _many_refs = [] + + def getTransformerTankInfo(self): + """Transformer tank data. + """ + return self._TransformerTankInfo + + def setTransformerTankInfo(self, value): + if self._TransformerTankInfo is not None: + filtered = [x for x in self.TransformerTankInfo.TransformerTanks if x != self] + self._TransformerTankInfo._TransformerTanks = filtered + + self._TransformerTankInfo = value + if self._TransformerTankInfo is not None: + if self not in self._TransformerTankInfo._TransformerTanks: + self._TransformerTankInfo._TransformerTanks.append(self) + + TransformerTankInfo = property(getTransformerTankInfo, setTransformerTankInfo) + diff --git a/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerTankEnd.py b/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerTankEnd.py new file mode 100755 index 00000000..63715d11 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61970/Wires/TransformerTankEnd.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Asset.IEC61970.Wires.TransformerEnd import TransformerEnd + +class TransformerTankEnd(TransformerEnd): + """Transformer tank end represents an individual winding for unbalanced models or for transformer tanks connected into a bank (and bank is modelled with the PowerTransformer). + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'TransformerTankEnd' instance. + + """ + super(TransformerTankEnd, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Asset/IEC61970/Wires/__init__.py b/CIM16/CDPSM/Asset/IEC61970/Wires/__init__.py new file mode 100755 index 00000000..16693c1f --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61970/Wires/__init__.py @@ -0,0 +1,40 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""An extension to the Core and Topology package that models information on the electrical characteristics of Transmission and Distribution networks. This package is used by network applications such as State Estimation, Load Flow and Optimal Power Flow. +""" + +from CIM16.CDPSM.Asset.IEC61970.Wires.PerLengthSequenceImpedance import PerLengthSequenceImpedance +from CIM16.CDPSM.Asset.IEC61970.Wires.ACLineSegment import ACLineSegment +from CIM16.CDPSM.Asset.IEC61970.Wires.TransformerCoreAdmittance import TransformerCoreAdmittance +from CIM16.CDPSM.Asset.IEC61970.Wires.TransformerTank import TransformerTank +from CIM16.CDPSM.Asset.IEC61970.Wires.TransformerTankEnd import TransformerTankEnd +from CIM16.CDPSM.Asset.IEC61970.Wires.TransformerStarImpedance import TransformerStarImpedance +from CIM16.CDPSM.Asset.IEC61970.Wires.PerLengthPhaseImpedance import PerLengthPhaseImpedance +from CIM16.CDPSM.Asset.IEC61970.Wires.TransformerEnd import TransformerEnd + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM/Asset#Wires" +nsPrefix = "cimWires" + + +class WindingConnection(str): + """Values are: Z, A, Yn, Y, Zn, D, I + """ + pass diff --git a/CIM16/CDPSM/Asset/IEC61970/__init__.py b/CIM16/CDPSM/Asset/IEC61970/__init__.py new file mode 100755 index 00000000..16a8c1b6 --- /dev/null +++ b/CIM16/CDPSM/Asset/IEC61970/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The ControlArea package models area specifications which can be used for a variety of purposes. The package as a whole models potentially overlapping control area specifications for the purpose of actual generation control, load forecast area load capture, or powerflow based analysis. +""" + + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM/Asset#IEC61970" +nsPrefix = "cimIEC61970" + diff --git a/CIM16/CDPSM/Asset/__init__.py b/CIM16/CDPSM/Asset/__init__.py new file mode 100755 index 00000000..03e8425d --- /dev/null +++ b/CIM16/CDPSM/Asset/__init__.py @@ -0,0 +1,138 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The IEC 61968 subpackages of the CIM are developed, standardized and maintained by IEC TC57 Working Group 14: interfaces for distribution management (WG14). Currently, normative parts of the model support the needs of information exchange defined in IEC 61968-9 and in IEC 61968-13. +""" + +from CIM16.CDPSM.Asset.Element import Element + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM/Asset" +nsPrefix = "asset" + +packageMap = { + "Element": "CIM16.CDPSM.Asset", + "PerLengthSequenceImpedance": "CIM16.CDPSM.Asset.IEC61970.Wires", + "ACLineSegment": "CIM16.CDPSM.Asset.IEC61970.Wires", + "TransformerCoreAdmittance": "CIM16.CDPSM.Asset.IEC61970.Wires", + "TransformerTank": "CIM16.CDPSM.Asset.IEC61970.Wires", + "TransformerTankEnd": "CIM16.CDPSM.Asset.IEC61970.Wires", + "TransformerStarImpedance": "CIM16.CDPSM.Asset.IEC61970.Wires", + "PerLengthPhaseImpedance": "CIM16.CDPSM.Asset.IEC61970.Wires", + "TransformerEnd": "CIM16.CDPSM.Asset.IEC61970.Wires", + "NameType": "CIM16.CDPSM.Asset.IEC61970.Core", + "IdentifiedObject": "CIM16.CDPSM.Asset.IEC61970.Core", + "Name": "CIM16.CDPSM.Asset.IEC61970.Core", + "ConductorInfo": "CIM16.CDPSM.Asset.IEC61968.AssetModels", + "WireArrangement": "CIM16.CDPSM.Asset.IEC61968.AssetModels", + "WireType": "CIM16.CDPSM.Asset.IEC61968.AssetModels", + "EndDeviceInfo": "CIM16.CDPSM.Asset.IEC61968.AssetModels", + "OverheadConductorInfo": "CIM16.CDPSM.Asset.IEC61968.AssetModels", + "TapChangerInfo": "CIM16.CDPSM.Asset.IEC61968.AssetModels", + "TransformerTankInfo": "CIM16.CDPSM.Asset.IEC61968.AssetModels", + "CableInfo": "CIM16.CDPSM.Asset.IEC61968.AssetModels", + "ConcentricNeutralCableInfo": "CIM16.CDPSM.Asset.IEC61968.AssetModels", + "TapeShieldCableInfo": "CIM16.CDPSM.Asset.IEC61968.AssetModels", + "TransformerEndInfo": "CIM16.CDPSM.Asset.IEC61968.AssetModels", + "PowerTransformerInfo": "CIM16.CDPSM.Asset.IEC61968.AssetModels", + "AssetInfo": "CIM16.CDPSM.Asset.IEC61968.Assets", +} + + +class Resistance(float): + """Resistance (real part of impedance). + """ + pass + +class ResistancePerLength(float): + """Resistance (real part of impedance) per unit of length. + """ + pass + +class Temperature(float): + """Value of temperature in degrees Celsius. + """ + pass + +class PerCent(float): + """Normally 0 - 100 on a defined base + """ + pass + +class Length(float): + """Unit of length. + """ + pass + +class Voltage(float): + """Electrical voltage. + """ + pass + +class CurrentFlow(float): + """Electrical current (positive flow is out of the ConductingEquipment into the ConnectivityNode) + """ + pass + +class ApparentPower(float): + """Product of the RMS value of the voltage and the RMS value of the current + """ + pass + +class Displacement(float): + """Unit of displacement relative a reference position, hence can be negative. + """ + pass + +class AngleDegrees(float): + """Measurement of angle in degrees + """ + pass + +class Frequency(float): + """Cycles per second + """ + pass + +class CIMTime(str): + pass + +class CIMDateTime(str): + pass + +class CIMDuration(str): + pass + +class CIMGYear(str): + pass + +class CIMDate(str): + pass + +class CIMGMonthDay(str): + pass + +class CIMGMonth(str): + pass + +class CIMGDay(str): + pass + +class CIMGYearMonth(str): + pass diff --git a/CIM16/CDPSM/Balanced/Element.py b/CIM16/CDPSM/Balanced/Element.py new file mode 100755 index 00000000..fddaa815 --- /dev/null +++ b/CIM16/CDPSM/Balanced/Element.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class Element(object): + + def __init__(self, UUID=''): + """Initialises a new 'Element' instance. + + @param UUID: + """ + + self.UUID = UUID + + + _attrs = ["UUID"] + _attr_types = {"UUID": str} + _defaults = {"UUID": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Core/IdentifiedObject.py b/CIM16/CDPSM/Balanced/IEC61970/Core/IdentifiedObject.py new file mode 100755 index 00000000..9289c2e9 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Core/IdentifiedObject.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.Element import Element + +class IdentifiedObject(Element): + """This is a root class to provide common identification for all classes needing identification and naming attributes + """ + + def __init__(self, name='', aliasName='', Names=None, *args, **kw_args): + """Initialises a new 'IdentifiedObject' instance. + + @param name: The name is any free human readable and possibly non unique text naming the object. + @param aliasName: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + @param Names: All names of this identified object. + """ + #: The name is any free human readable and possibly non unique text naming the object. + self.name = name + + #: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + self.aliasName = aliasName + + self._Names = [] + self.Names = [] if Names is None else Names + + super(IdentifiedObject, self).__init__(*args, **kw_args) + + _attrs = ["name", "aliasName"] + _attr_types = {"name": str, "aliasName": str} + _defaults = {"name": '', "aliasName": ''} + _enums = {} + _refs = ["Names"] + _many_refs = ["Names"] + + def getNames(self): + """All names of this identified object. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.IdentifiedObject = None + for y in value: + y._IdentifiedObject = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = self + + def removeNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = None + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Core/Name.py b/CIM16/CDPSM/Balanced/IEC61970/Core/Name.py new file mode 100755 index 00000000..1130ff8f --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Core/Name.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.Element import Element + +class Name(Element): + """The Name class provides the means to define any number of human readable names for an object. A name is not to be used for defining inter-object relationships. For inter-object relationships instead use the object identification 'mRID'. + """ + + def __init__(self, name='', IdentifiedObject=None, NameType=None, *args, **kw_args): + """Initialises a new 'Name' instance. + + @param name: Any free text that name the object. + @param IdentifiedObject: Identified object that this name designates. + @param NameType: Type of this name. + """ + #: Any free text that name the object. + self.name = name + + self._IdentifiedObject = None + self.IdentifiedObject = IdentifiedObject + + self._NameType = None + self.NameType = NameType + + super(Name, self).__init__(*args, **kw_args) + + _attrs = ["name"] + _attr_types = {"name": str} + _defaults = {"name": ''} + _enums = {} + _refs = ["IdentifiedObject", "NameType"] + _many_refs = [] + + def getIdentifiedObject(self): + """Identified object that this name designates. + """ + return self._IdentifiedObject + + def setIdentifiedObject(self, value): + if self._IdentifiedObject is not None: + filtered = [x for x in self.IdentifiedObject.Names if x != self] + self._IdentifiedObject._Names = filtered + + self._IdentifiedObject = value + if self._IdentifiedObject is not None: + if self not in self._IdentifiedObject._Names: + self._IdentifiedObject._Names.append(self) + + IdentifiedObject = property(getIdentifiedObject, setIdentifiedObject) + + def getNameType(self): + """Type of this name. + """ + return self._NameType + + def setNameType(self, value): + if self._NameType is not None: + filtered = [x for x in self.NameType.Names if x != self] + self._NameType._Names = filtered + + self._NameType = value + if self._NameType is not None: + if self not in self._NameType._Names: + self._NameType._Names.append(self) + + NameType = property(getNameType, setNameType) + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Core/NameType.py b/CIM16/CDPSM/Balanced/IEC61970/Core/NameType.py new file mode 100755 index 00000000..f18d6202 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Core/NameType.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.Element import Element + +class NameType(Element): + """Type of name. Possible values for attribute 'name' are implementation dependent but standard profiles may specify types. An enterprise may have multiple IT systems each having its own local name for the same object, e.g. a planning system may have different names from an EMS. An object may also have different names within the same IT system, e.g. localName and aliasName as defined in CIM version 14. Their definitions from CIM14 are The localName is a human readable name of the object. It is only used with objects organized in a naming hierarchy. localName: A free text name local to a node in a naming hierarchy similar to a file directory structure. A power system related naming hierarchy may be: Substation, VoltageLevel, Equipment etc. Children of the same parent in such a hierarchy have names that typically are unique among them. aliasName: A free text alternate name typically used in tabular reports where the column width is limited. + """ + + def __init__(self, Names=None, *args, **kw_args): + """Initialises a new 'NameType' instance. + + @param Names: All names of this type. + """ + self._Names = [] + self.Names = [] if Names is None else Names + + super(NameType, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Names"] + _many_refs = ["Names"] + + def getNames(self): + """All names of this type. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.NameType = None + for y in value: + y._NameType = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.NameType = self + + def removeNames(self, *Names): + for obj in Names: + obj.NameType = None + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Core/__init__.py b/CIM16/CDPSM/Balanced/IEC61970/Core/__init__.py new file mode 100755 index 00000000..238d317e --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Core/__init__.py @@ -0,0 +1,35 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""Contains the core PowerSystemResource and ConductingEquipment entities shared by all applications plus common collections of those entities. Not all applications require all the Core entities. This package does not depend on any other package except the Domain package, but most of the other packages have associations and generalizations that depend on it. +""" + +from CIM16.CDPSM.Balanced.IEC61970.Core.NameType import NameType +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject +from CIM16.CDPSM.Balanced.IEC61970.Core.Name import Name + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Balanced#Core" +nsPrefix = "cimCore" + + +class PhaseCode(str): + """Values are: s12N, BN, BC, ABN, s2N, N, ACN, BCN, ABCN, AC, s1N, AN, B, AB, C, A, CN, ABC + """ + pass diff --git a/CIM16/CDPSM/Balanced/IEC61970/Generation/Production/GeneratingUnit.py b/CIM16/CDPSM/Balanced/IEC61970/Generation/Production/GeneratingUnit.py new file mode 100755 index 00000000..7b8ae5d1 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Generation/Production/GeneratingUnit.py @@ -0,0 +1,81 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GeneratingUnit(IdentifiedObject): + """A single or set of synchronous machines for converting mechanical power into alternating-current power. For example, individual machines within a set may be defined for scheduling purposes while a single control signal is derived for the set. In this case there would be a GeneratingUnit for each member of the set and an additional GeneratingUnit corresponding to the set. + """ + + def __init__(self, baseP=0.0, genControlSource="plantControl", ratedNetMaxP=0.0, initialP=0.0, SynchronousMachines=None, *args, **kw_args): + """Initialises a new 'GeneratingUnit' instance. + + @param baseP: For dispatchable units, this value represents the economic active power basepoint, for units that are not dispatchable, this value represents the fixed generation value. The value must be between the operating low and high limits. + @param genControlSource: The source of controls for a generating unit. Values are: "plantControl", "offAGC", "unavailable", "onAGC" + @param ratedNetMaxP: The net rated maximum capacity determined by subtracting the auxiliary power used to operate the internal plant machinery from the rated gross maximum capacity + @param initialP: Default Initial active power which is used to store a powerflow result for the initial active power for this unit in this network configuration + @param SynchronousMachines: A synchronous machine may operate as a generator and as such becomes a member of a generating unit + """ + #: For dispatchable units, this value represents the economic active power basepoint, for units that are not dispatchable, this value represents the fixed generation value. The value must be between the operating low and high limits. + self.baseP = baseP + + #: The source of controls for a generating unit. Values are: "plantControl", "offAGC", "unavailable", "onAGC" + self.genControlSource = genControlSource + + #: The net rated maximum capacity determined by subtracting the auxiliary power used to operate the internal plant machinery from the rated gross maximum capacity + self.ratedNetMaxP = ratedNetMaxP + + #: Default Initial active power which is used to store a powerflow result for the initial active power for this unit in this network configuration + self.initialP = initialP + + self._SynchronousMachines = [] + self.SynchronousMachines = [] if SynchronousMachines is None else SynchronousMachines + + super(GeneratingUnit, self).__init__(*args, **kw_args) + + _attrs = ["baseP", "genControlSource", "ratedNetMaxP", "initialP"] + _attr_types = {"baseP": float, "genControlSource": str, "ratedNetMaxP": float, "initialP": float} + _defaults = {"baseP": 0.0, "genControlSource": "plantControl", "ratedNetMaxP": 0.0, "initialP": 0.0} + _enums = {"genControlSource": "GeneratorControlSource"} + _refs = ["SynchronousMachines"] + _many_refs = ["SynchronousMachines"] + + def getSynchronousMachines(self): + """A synchronous machine may operate as a generator and as such becomes a member of a generating unit + """ + return self._SynchronousMachines + + def setSynchronousMachines(self, value): + for x in self._SynchronousMachines: + x.GeneratingUnit = None + for y in value: + y._GeneratingUnit = self + self._SynchronousMachines = value + + SynchronousMachines = property(getSynchronousMachines, setSynchronousMachines) + + def addSynchronousMachines(self, *SynchronousMachines): + for obj in SynchronousMachines: + obj.GeneratingUnit = self + + def removeSynchronousMachines(self, *SynchronousMachines): + for obj in SynchronousMachines: + obj.GeneratingUnit = None + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Generation/Production/__init__.py b/CIM16/CDPSM/Balanced/IEC61970/Generation/Production/__init__.py new file mode 100755 index 00000000..15257c69 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Generation/Production/__init__.py @@ -0,0 +1,33 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The production package is responsible for classes which describe various kinds of generators. These classes also provide production costing information which is used to economically allocate demand among committed units and calculate reserve quantities. +""" + +from CIM16.CDPSM.Balanced.IEC61970.Generation.Production.GeneratingUnit import GeneratingUnit + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Balanced#Production" +nsPrefix = "cimProduction" + + +class GeneratorControlSource(str): + """Values are: plantControl, offAGC, unavailable, onAGC + """ + pass diff --git a/CIM16/CDPSM/Balanced/IEC61970/Generation/__init__.py b/CIM16/CDPSM/Balanced/IEC61970/Generation/__init__.py new file mode 100755 index 00000000..74d36b1d --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Generation/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package contains packages that have information for Unit Commitment and Economic Dispatch of Hydro and Thermal Generating Units, Load Forecasting, Automatic Generation Control, and Unit Modeling for Dynamic Training Simulator. +""" + + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Balanced#Generation" +nsPrefix = "cimGeneration" + diff --git a/CIM16/CDPSM/Balanced/IEC61970/LoadModel/LoadResponseCharacteristic.py b/CIM16/CDPSM/Balanced/IEC61970/LoadModel/LoadResponseCharacteristic.py new file mode 100755 index 00000000..a2fd9e90 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/LoadModel/LoadResponseCharacteristic.py @@ -0,0 +1,109 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class LoadResponseCharacteristic(IdentifiedObject): + """Models the characteristic response of the load demand due to to changes in system conditions such as voltage and frequency. This is not related to demand response. If LoadResponseCharacteristic.exponentModel is True, the voltage exponents are specified and used as to calculate: Active power component = Pnominal * (Voltage/cim:BaseVoltage.nominalVoltage) ** cim:LoadResponseCharacteristic.pVoltageExponent Reactive power component = Qnominal * (Voltage/cim:BaseVoltage.nominalVoltage)** cim:LoadResponseCharacteristic.qVoltageExponent Where * means 'multiply' and ** is 'raised to power of'. + """ + + def __init__(self, pFrequencyExponent=0.0, pConstantPower=0.0, pVoltageExponent=0.0, exponentModel=False, qFrequencyExponent=0.0, qConstantImpedance=0.0, qConstantPower=0.0, pConstantCurrent=0.0, qVoltageExponent=0.0, pConstantImpedance=0.0, qConstantCurrent=0.0, EnergyConsumer=None, *args, **kw_args): + """Initialises a new 'LoadResponseCharacteristic' instance. + + @param pFrequencyExponent: Exponent of per unit frequency effecting active power + @param pConstantPower: Portion of active power load modeled as constant power. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP. + @param pVoltageExponent: Exponent of per unit voltage effecting real power. This model used only when 'useExponentModel' is true. + @param exponentModel: Indicates the exponential voltage dependency model (pVoltateExponent and qVoltageExponent) is to be used. If false, the coeficient model (consisting of pConstantImpedance, pConstantCurrent, pConstantPower, qConstantImpedance, qConstantCurrent, and qConstantPower) is to be used. + @param qFrequencyExponent: Exponent of per unit frequency effecting reactive power + @param qConstantImpedance: Portion of reactive power load modeled as constant impedance. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP. + @param qConstantPower: Portion of reactive power load modeled as constant power. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP. + @param pConstantCurrent: Portion of active power load modeled as constant current. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP. + @param qVoltageExponent: Exponent of per unit voltage effecting reactive power. This model used only when 'useExponentModel' is true. + @param pConstantImpedance: Portion of active power load modeled as constant impedance. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP. + @param qConstantCurrent: Portion of reactive power load modeled as constant current. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP. + @param EnergyConsumer: The set of loads that have the response characteristics. + """ + #: Exponent of per unit frequency effecting active power + self.pFrequencyExponent = pFrequencyExponent + + #: Portion of active power load modeled as constant power. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP. + self.pConstantPower = pConstantPower + + #: Exponent of per unit voltage effecting real power. This model used only when 'useExponentModel' is true. + self.pVoltageExponent = pVoltageExponent + + #: Indicates the exponential voltage dependency model (pVoltateExponent and qVoltageExponent) is to be used. If false, the coeficient model (consisting of pConstantImpedance, pConstantCurrent, pConstantPower, qConstantImpedance, qConstantCurrent, and qConstantPower) is to be used. + self.exponentModel = exponentModel + + #: Exponent of per unit frequency effecting reactive power + self.qFrequencyExponent = qFrequencyExponent + + #: Portion of reactive power load modeled as constant impedance. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP. + self.qConstantImpedance = qConstantImpedance + + #: Portion of reactive power load modeled as constant power. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP. + self.qConstantPower = qConstantPower + + #: Portion of active power load modeled as constant current. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP. + self.pConstantCurrent = pConstantCurrent + + #: Exponent of per unit voltage effecting reactive power. This model used only when 'useExponentModel' is true. + self.qVoltageExponent = qVoltageExponent + + #: Portion of active power load modeled as constant impedance. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP. + self.pConstantImpedance = pConstantImpedance + + #: Portion of reactive power load modeled as constant current. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP. + self.qConstantCurrent = qConstantCurrent + + self._EnergyConsumer = [] + self.EnergyConsumer = [] if EnergyConsumer is None else EnergyConsumer + + super(LoadResponseCharacteristic, self).__init__(*args, **kw_args) + + _attrs = ["pFrequencyExponent", "pConstantPower", "pVoltageExponent", "exponentModel", "qFrequencyExponent", "qConstantImpedance", "qConstantPower", "pConstantCurrent", "qVoltageExponent", "pConstantImpedance", "qConstantCurrent"] + _attr_types = {"pFrequencyExponent": float, "pConstantPower": float, "pVoltageExponent": float, "exponentModel": bool, "qFrequencyExponent": float, "qConstantImpedance": float, "qConstantPower": float, "pConstantCurrent": float, "qVoltageExponent": float, "pConstantImpedance": float, "qConstantCurrent": float} + _defaults = {"pFrequencyExponent": 0.0, "pConstantPower": 0.0, "pVoltageExponent": 0.0, "exponentModel": False, "qFrequencyExponent": 0.0, "qConstantImpedance": 0.0, "qConstantPower": 0.0, "pConstantCurrent": 0.0, "qVoltageExponent": 0.0, "pConstantImpedance": 0.0, "qConstantCurrent": 0.0} + _enums = {} + _refs = ["EnergyConsumer"] + _many_refs = ["EnergyConsumer"] + + def getEnergyConsumer(self): + """The set of loads that have the response characteristics. + """ + return self._EnergyConsumer + + def setEnergyConsumer(self, value): + for x in self._EnergyConsumer: + x.LoadResponse = None + for y in value: + y._LoadResponse = self + self._EnergyConsumer = value + + EnergyConsumer = property(getEnergyConsumer, setEnergyConsumer) + + def addEnergyConsumer(self, *EnergyConsumer): + for obj in EnergyConsumer: + obj.LoadResponse = self + + def removeEnergyConsumer(self, *EnergyConsumer): + for obj in EnergyConsumer: + obj.LoadResponse = None + diff --git a/CIM16/CDPSM/Balanced/IEC61970/LoadModel/__init__.py b/CIM16/CDPSM/Balanced/IEC61970/LoadModel/__init__.py new file mode 100755 index 00000000..9ee7be64 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/LoadModel/__init__.py @@ -0,0 +1,28 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package is responsible for modeling the energy consumers and the system load as curves and associated curve data. Special circumstances that may affect the load, such as seasons and daytypes, are also included here. This information is used by Load Forecasting and Load Management. +""" + +from CIM16.CDPSM.Balanced.IEC61970.LoadModel.LoadResponseCharacteristic import LoadResponseCharacteristic + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Balanced#LoadModel" +nsPrefix = "cimLoadModel" + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/ACLineSegment.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/ACLineSegment.py new file mode 100755 index 00000000..b498eb1b --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/ACLineSegment.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ACLineSegment(IdentifiedObject): + """A wire or combination of wires, with consistent electrical characteristics, building a single electrical system, used to carry alternating current between points in the power system. For symmetrical, transposed 3ph lines, it is sufficient to use ACLineSegment attributes, which describe sequence impedances and admittances for the entire length of the segment. If per lenght impedance data is available from a library of standard types, impedances and admittances can be calculated in one of the following ways: - calculate electrical parameters from asset data, using associated ConductorInfo, with values then multiplied by Conductor.length to produce a matrix model. - calculate unbalanced electrical parameters from associated PerLengthPhaseImpedance, then multiplied by Conductor.length to produce a matrix model. - calculate transposed electrical parameters from associated PerLengthSequenceImpedance, then multiplied by Conductor.length to produce a sequence model. + """ + + def __init__(self, x0=0.0, bch=0.0, b0ch=0.0, r=0.0, r0=0.0, x=0.0, *args, **kw_args): + """Initialises a new 'ACLineSegment' instance. + + @param x0: Zero sequence series reactance of the entire line section. + @param bch: Positive sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. This value represents the full charging over the full length of the line. + @param b0ch: Zero sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. + @param r: Positive sequence series resistance of the entire line section. + @param r0: Zero sequence series resistance of the entire line section. + @param x: Positive sequence series reactance of the entire line section. + """ + #: Zero sequence series reactance of the entire line section. + self.x0 = x0 + + #: Positive sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. This value represents the full charging over the full length of the line. + self.bch = bch + + #: Zero sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. + self.b0ch = b0ch + + #: Positive sequence series resistance of the entire line section. + self.r = r + + #: Zero sequence series resistance of the entire line section. + self.r0 = r0 + + #: Positive sequence series reactance of the entire line section. + self.x = x + + super(ACLineSegment, self).__init__(*args, **kw_args) + + _attrs = ["x0", "bch", "b0ch", "r", "r0", "x"] + _attr_types = {"x0": float, "bch": float, "b0ch": float, "r": float, "r0": float, "x": float} + _defaults = {"x0": 0.0, "bch": 0.0, "b0ch": 0.0, "r": 0.0, "r0": 0.0, "x": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/DCLineSegment.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/DCLineSegment.py new file mode 100755 index 00000000..36591ce4 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/DCLineSegment.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class DCLineSegment(IdentifiedObject): + """A wire or combination of wires not insulated from one another, with consistent electrical characteristics, used to carry direct current between points in the DC region of the power system. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'DCLineSegment' instance. + + """ + super(DCLineSegment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/EnergyConsumer.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/EnergyConsumer.py new file mode 100755 index 00000000..e5040c28 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/EnergyConsumer.py @@ -0,0 +1,80 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class EnergyConsumer(IdentifiedObject): + """Generic user of energy - a point of consumption on the power system model + """ + + def __init__(self, customerCount=0, pfixedPct=0.0, qfixedPct=0.0, qfixed=0.0, pfixed=0.0, LoadResponse=None, *args, **kw_args): + """Initialises a new 'EnergyConsumer' instance. + + @param customerCount: Number of individual customers represented by this Demand + @param pfixedPct: Fixed active power as per cent of load group fixed active power. Load sign convention is used, i.e. positive sign means flow out from a node. + @param qfixedPct: Fixed reactive power as per cent of load group fixed reactive power. Load sign convention is used, i.e. positive sign means flow out from a node. + @param qfixed: Reactive power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. + @param pfixed: Active power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. + @param LoadResponse: The load response characteristic of this load. + """ + #: Number of individual customers represented by this Demand + self.customerCount = customerCount + + #: Fixed active power as per cent of load group fixed active power. Load sign convention is used, i.e. positive sign means flow out from a node. + self.pfixedPct = pfixedPct + + #: Fixed reactive power as per cent of load group fixed reactive power. Load sign convention is used, i.e. positive sign means flow out from a node. + self.qfixedPct = qfixedPct + + #: Reactive power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. + self.qfixed = qfixed + + #: Active power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. + self.pfixed = pfixed + + self._LoadResponse = None + self.LoadResponse = LoadResponse + + super(EnergyConsumer, self).__init__(*args, **kw_args) + + _attrs = ["customerCount", "pfixedPct", "qfixedPct", "qfixed", "pfixed"] + _attr_types = {"customerCount": int, "pfixedPct": float, "qfixedPct": float, "qfixed": float, "pfixed": float} + _defaults = {"customerCount": 0, "pfixedPct": 0.0, "qfixedPct": 0.0, "qfixed": 0.0, "pfixed": 0.0} + _enums = {} + _refs = ["LoadResponse"] + _many_refs = [] + + def getLoadResponse(self): + """The load response characteristic of this load. + """ + return self._LoadResponse + + def setLoadResponse(self, value): + if self._LoadResponse is not None: + filtered = [x for x in self.LoadResponse.EnergyConsumer if x != self] + self._LoadResponse._EnergyConsumer = filtered + + self._LoadResponse = value + if self._LoadResponse is not None: + if self not in self._LoadResponse._EnergyConsumer: + self._LoadResponse._EnergyConsumer.append(self) + + LoadResponse = property(getLoadResponse, setLoadResponse) + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/EnergySource.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/EnergySource.py new file mode 100755 index 00000000..01353d77 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/EnergySource.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class EnergySource(IdentifiedObject): + """A generic equivalent for an energy supplier on a transmission or distribution voltage level. + """ + + def __init__(self, voltageMagnitude=0.0, x=0.0, r=0.0, nominalVoltage=0.0, voltageAngle=0.0, *args, **kw_args): + """Initialises a new 'EnergySource' instance. + + @param voltageMagnitude: Phase-to-phase open circuit voltage magnitude. + @param x: Positive sequence Thevenin reactance. + @param r: Positive sequence Thevenin resistance. + @param nominalVoltage: Phase-to-phase nominal voltage. + @param voltageAngle: Phase angle of a-phase open circuit. + """ + #: Phase-to-phase open circuit voltage magnitude. + self.voltageMagnitude = voltageMagnitude + + #: Positive sequence Thevenin reactance. + self.x = x + + #: Positive sequence Thevenin resistance. + self.r = r + + #: Phase-to-phase nominal voltage. + self.nominalVoltage = nominalVoltage + + #: Phase angle of a-phase open circuit. + self.voltageAngle = voltageAngle + + super(EnergySource, self).__init__(*args, **kw_args) + + _attrs = ["voltageMagnitude", "x", "r", "nominalVoltage", "voltageAngle"] + _attr_types = {"voltageMagnitude": float, "x": float, "r": float, "nominalVoltage": float, "voltageAngle": float} + _defaults = {"voltageMagnitude": 0.0, "x": 0.0, "r": 0.0, "nominalVoltage": 0.0, "voltageAngle": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChanger.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChanger.py new file mode 100755 index 00000000..8e0d2aff --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChanger.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Wires.TapChanger import TapChanger + +class PhaseTapChanger(TapChanger): + """A PhaseTapChanger controls the phase angle difference across the power transformer and hence the activer power flow through it. A PhaseTapChanger may also impact the voltage magnitude. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'PhaseTapChanger' instance. + + """ + super(PhaseTapChanger, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerAsymetrical.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerAsymetrical.py new file mode 100755 index 00000000..8d425a78 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerAsymetrical.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Wires.PhaseTapChangerNonLinear import PhaseTapChangerNonLinear + +class PhaseTapChangerAsymetrical(PhaseTapChangerNonLinear): + """In a PhaseTapChangerAsymetrical tranformer the difference voltage vector adds to the primary side voltage. The angle between the primary side voltage and the difference voltage is named the winding connection angle. The phase shift, α, depends on both the difference voltage magnitude, ΔU, and the winding connection angle. + """ + + def __init__(self, windingConnectionAngle=0.0, *args, **kw_args): + """Initialises a new 'PhaseTapChangerAsymetrical' instance. + + @param windingConnectionAngle: The phase angle between the in-phase winding and the out-of -phase winding used for creating phase shift. It is only possible to have a symmemtrical transformer if this angle is 90 degrees. + """ + #: The phase angle between the in-phase winding and the out-of -phase winding used for creating phase shift. It is only possible to have a symmemtrical transformer if this angle is 90 degrees. + self.windingConnectionAngle = windingConnectionAngle + + super(PhaseTapChangerAsymetrical, self).__init__(*args, **kw_args) + + _attrs = ["windingConnectionAngle"] + _attr_types = {"windingConnectionAngle": float} + _defaults = {"windingConnectionAngle": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerLinear.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerLinear.py new file mode 100755 index 00000000..ad147f1d --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerLinear.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Wires.PhaseTapChanger import PhaseTapChanger + +class PhaseTapChangerLinear(PhaseTapChanger): + """PhaseTapChangerLinear describes a linear relation between the tap step and the phase angle difference across the transformer. This is a mathematical model that is an approximation of a real phase tap changer. + """ + + def __init__(self, stepPhaseShiftIncrement=0.0, *args, **kw_args): + """Initialises a new 'PhaseTapChangerLinear' instance. + + @param stepPhaseShiftIncrement: Phase shift per step position. A positive value indicates a positive phase shift from the winding where the tap is located to the other winding (for a two-winding transformer). The actual phase shift increment might be more accurately computed from the symmetrical or asymmetrical models or a tap step table lookup if those are available. + """ + #: Phase shift per step position. A positive value indicates a positive phase shift from the winding where the tap is located to the other winding (for a two-winding transformer). The actual phase shift increment might be more accurately computed from the symmetrical or asymmetrical models or a tap step table lookup if those are available. + self.stepPhaseShiftIncrement = stepPhaseShiftIncrement + + super(PhaseTapChangerLinear, self).__init__(*args, **kw_args) + + _attrs = ["stepPhaseShiftIncrement"] + _attr_types = {"stepPhaseShiftIncrement": float} + _defaults = {"stepPhaseShiftIncrement": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerNonLinear.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerNonLinear.py new file mode 100755 index 00000000..5229bad5 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerNonLinear.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Wires.PhaseTapChanger import PhaseTapChanger + +class PhaseTapChangerNonLinear(PhaseTapChanger): + """PhaseTapChangerNonLinear describe the non linear behavior of a phase tap changer. This is a base class for the symmetrical and asymmetrical models. The details of these models can be found in the IEC 61970-301 document. + """ + + def __init__(self, voltageStepIncrement=0.0, *args, **kw_args): + """Initialises a new 'PhaseTapChangerNonLinear' instance. + + @param voltageStepIncrement: The voltage step increment on the out of phase winding. This voltage step on the out of phase winding of the phase shifter. + """ + #: The voltage step increment on the out of phase winding. This voltage step on the out of phase winding of the phase shifter. + self.voltageStepIncrement = voltageStepIncrement + + super(PhaseTapChangerNonLinear, self).__init__(*args, **kw_args) + + _attrs = ["voltageStepIncrement"] + _attr_types = {"voltageStepIncrement": float} + _defaults = {"voltageStepIncrement": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerSymetrical.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerSymetrical.py new file mode 100755 index 00000000..7efbf804 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerSymetrical.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Wires.PhaseTapChangerNonLinear import PhaseTapChangerNonLinear + +class PhaseTapChangerSymetrical(PhaseTapChangerNonLinear): + """In a PhaseTapChangerSymetrical tranformer the secondary side voltage magnitude is the same as at the primary side. The difference voltage magnitude, ΔU, is the base in an equal-sided triangle where the sides corresponds to the primary and secondary voltages. The phase angle difference correpsonds the top angle and can be expressed as follows α = 2arctan(ΔU/2) + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'PhaseTapChangerSymetrical' instance. + + """ + super(PhaseTapChangerSymetrical, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/PowerTransformer.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/PowerTransformer.py new file mode 100755 index 00000000..9a654543 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/PowerTransformer.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PowerTransformer(IdentifiedObject): + """An electrical device consisting of two or more coupled windings, with or without a magnetic core, for introducing mutual coupling between electric circuits. Transformers can be used to control voltage and phase shift (active power flow). A power transformer may be composed of separate transformer tanks that need not be identical. The same power transformer can be modelled in two ways, namely with and without tanks:
  1. The power transformer that uses power transformer ends directly (without tanks) is suitable for balanced three-phase models. This is typical for transmission and sub-transmission network modelling. Such a transformer will require one power transformer end for each physical winding. There must be a one-to-one association between PowerTransformerEnd and Core::Terminal.
  2. The power transformer that uses transformer tanks is suitable for an unbalanced transformer, a balanced transformer within a single tank, or a balanced transformer made up of three tanks. This is typical for distribution network modelling and the only choice when modelling an unbalanced transformer, or a transformer that has more than three windings. Power transformer modelled with tanks will require for each tank, one transformer tank end per physical winding in the tank. There may be one, two, or three phases in the transformer tank end. Examples: 3 phases for 3-phase delta or wye connected windings, 2 for one phase-to-phase winding, and 1 for a phase-to-neutral or phase-to-ground winding. With 1 or 2 phases, more than one transformer tank end may be associated to the same 3-phase Core::Terminal instance, while with 3 phases there should be a one-to-one association.
This power transformer model is flexible in order to support different kinds of data exchange requirements. There are 5 possible ways to combine available classes and their attributes:
  1. Instance parameters - Use the r, x, r0, x0, b, b0, g, and g0 attributes on PowerTransformerEnd and ignore related TransformerStarImpedance, TransformerMeshImpedance, or TransformerCoreAdmittance. This option assumes a star connection of the series impedances. It is suitable for typical transmission, balanced three-phase transformer models, for transformers with 2 or three windings.
  2. Star instance parameters by association - Instead of the r, x, r0, x0, b, b0, g, and g0 attributes, use associations to TransformerStarImpedance and TransformerCoreAdmitance. This option is suitable in same scenarios as option 1, but when catalogue data is available for transformers.
  3. Mesh instance parameters by association: Instead of the r, x, r0, x0, b, b0, g, and g0 attributes, use associations to TransformerMeshImpedance and TransformerCoreAdmittance. This option supports transformers with more than three windings.
  4. Catalog mesh parameters by association - Instead of attributes r, x, r0, x0, b, b0, g, and g0 and associations to TransformerStarImpedance, TransformerMeshImpedance, or TransformerCoreAdmittance, use the association to TransformerEndInfo. The TransformerEnd.endNumber should match the corresponding TransformerEndInfo.endNumber, following the IEC standard convention of numbering from the highest voltage ends to the lowest, starting at 1. This matching supports higher-level use of a catalog, through just one association between TransformerTank and TransformerTankInfo, with simpler exchanges and incremental updates. The associated TransformerEndInfo will have associations to TransformerMeshImpedance and TransformerCoreAdmittance. This option supports unbalanced transformer, with more than three windings and is suitable whenever the transformer test data has been converted to an electrical model.
  5. Catalog test data by association - This is the same as option 4, except TransformerEndInfo will have associations to AssetModels::TransformerTest decendents, instead of to TransformerMeshImpedance and TransformerCoreAdmittance. This option is suitable when the test data is available, and the receiving application is able to interpret the test data.
Every profile should specify which one or more of these options are supported. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'PowerTransformer' instance. + + """ + super(PowerTransformer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/PowerTransformerEnd.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/PowerTransformerEnd.py new file mode 100755 index 00000000..c4ef6cb5 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/PowerTransformerEnd.py @@ -0,0 +1,83 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Wires.TransformerEnd import TransformerEnd + +class PowerTransformerEnd(TransformerEnd): + """A PowerTransformerEnd is associated with each Terminal of a PowerTransformer. The impdedance values r, r0, x, and x0 of a PowerTransformerEnd represents a star equivalentas follows 1) for a two Terminal PowerTransformer the high voltage PowerTransformerEnd has non zero values on r, r0, x, and x0 while the low voltage PowerTransformerEnd has zero values for r, r0, x, and x0. 2) for a three Terminal PowerTransformer the three PowerTransformerEnds represents a star equivalent with each leg in the star represented by r, r0, x, and x0 values. 3) for a PowerTransformer with more than three Terminals the PowerTransformerEnd impedance values cannot be used. Instead use the TransformerMeshImpedance or split the transformer into multiple PowerTransformers. + """ + + def __init__(self, g0=0.0, ratedS=0.0, b0=0.0, r0=0.0, connectionKind="Z", b=0.0, r=0.0, ratedU=0.0, x0=0.0, x=0.0, g=0.0, *args, **kw_args): + """Initialises a new 'PowerTransformerEnd' instance. + + @param g0: Zero sequence magnetizing branch conductance (star-model). + @param ratedS: Normal apparent power rating. + @param b0: Zero sequence magnetizing branch susceptance. + @param r0: Zero sequence series resistance (star-model) of the transformer end. + @param connectionKind: Kind of connection. Values are: "Z", "A", "Yn", "Y", "Zn", "D", "I" + @param b: Magnetizing branch susceptance (B mag). The value can be positive or negative. + @param r: Resistance (star-model) of the transformer end. + @param ratedU: Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings. + @param x0: Zero sequence series reactance of the transformer end. + @param x: Positive sequence series reactance (star-model) of the transformer end. + @param g: Magnetizing branch conductance (G mag). + """ + #: Zero sequence magnetizing branch conductance (star-model). + self.g0 = g0 + + #: Normal apparent power rating. + self.ratedS = ratedS + + #: Zero sequence magnetizing branch susceptance. + self.b0 = b0 + + #: Zero sequence series resistance (star-model) of the transformer end. + self.r0 = r0 + + #: Kind of connection. Values are: "Z", "A", "Yn", "Y", "Zn", "D", "I" + self.connectionKind = connectionKind + + #: Magnetizing branch susceptance (B mag). The value can be positive or negative. + self.b = b + + #: Resistance (star-model) of the transformer end. + self.r = r + + #: Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings. + self.ratedU = ratedU + + #: Zero sequence series reactance of the transformer end. + self.x0 = x0 + + #: Positive sequence series reactance (star-model) of the transformer end. + self.x = x + + #: Magnetizing branch conductance (G mag). + self.g = g + + super(PowerTransformerEnd, self).__init__(*args, **kw_args) + + _attrs = ["g0", "ratedS", "b0", "r0", "connectionKind", "b", "r", "ratedU", "x0", "x", "g"] + _attr_types = {"g0": float, "ratedS": float, "b0": float, "r0": float, "connectionKind": str, "b": float, "r": float, "ratedU": float, "x0": float, "x": float, "g": float} + _defaults = {"g0": 0.0, "ratedS": 0.0, "b0": 0.0, "r0": 0.0, "connectionKind": "Z", "b": 0.0, "r": 0.0, "ratedU": 0.0, "x0": 0.0, "x": 0.0, "g": 0.0} + _enums = {"connectionKind": "WindingConnection"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/ProtectedSwitch.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/ProtectedSwitch.py new file mode 100755 index 00000000..51461d3f --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/ProtectedSwitch.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ProtectedSwitch(IdentifiedObject): + """A ProtectedSwitch is a switching device that can be operated by ProtectionEquipment. + """ + + def __init__(self, breakingCapacity=0.0, *args, **kw_args): + """Initialises a new 'ProtectedSwitch' instance. + + @param breakingCapacity: The maximum fault current a breaking device can break safely under prescribed conditions of use. + """ + #: The maximum fault current a breaking device can break safely under prescribed conditions of use. + self.breakingCapacity = breakingCapacity + + super(ProtectedSwitch, self).__init__(*args, **kw_args) + + _attrs = ["breakingCapacity"] + _attr_types = {"breakingCapacity": float} + _defaults = {"breakingCapacity": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/RatioTapChanger.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/RatioTapChanger.py new file mode 100755 index 00000000..844d7120 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/RatioTapChanger.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Wires.TapChanger import TapChanger + +class RatioTapChanger(TapChanger): + """A tap changer that changes the voltage ratio impacting the voltage magnitude but not the phase angle across the transformer. + """ + + def __init__(self, stepVoltageIncrement=0.0, tculControlMode="reactive", *args, **kw_args): + """Initialises a new 'RatioTapChanger' instance. + + @param stepVoltageIncrement: Tap step increment, in per cent of nominal voltage, per step position. For a symmetrical PhaseTapChanger, the stepVoltageIncrement is used in the formula for calculation of the phase angle. For a symmetrical PhaseTapChanger, the voltage magnitude does not change with tap step. + @param tculControlMode: Specifies the regulation control mode (voltage or reactive) of the RatioTapChanger. Values are: "reactive", "volt" + """ + #: Tap step increment, in per cent of nominal voltage, per step position. For a symmetrical PhaseTapChanger, the stepVoltageIncrement is used in the formula for calculation of the phase angle. For a symmetrical PhaseTapChanger, the voltage magnitude does not change with tap step. + self.stepVoltageIncrement = stepVoltageIncrement + + #: Specifies the regulation control mode (voltage or reactive) of the RatioTapChanger. Values are: "reactive", "volt" + self.tculControlMode = tculControlMode + + super(RatioTapChanger, self).__init__(*args, **kw_args) + + _attrs = ["stepVoltageIncrement", "tculControlMode"] + _attr_types = {"stepVoltageIncrement": float, "tculControlMode": str} + _defaults = {"stepVoltageIncrement": 0.0, "tculControlMode": "reactive"} + _enums = {"tculControlMode": "TransformerControlMode"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/SeriesCompensator.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/SeriesCompensator.py new file mode 100755 index 00000000..b086dd5a --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/SeriesCompensator.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class SeriesCompensator(IdentifiedObject): + """A Series Compensator is a series capacitor or reactor or an AC transmission line without charging susceptance. It is a two terminal device. + """ + + def __init__(self, x=0.0, r=0.0, *args, **kw_args): + """Initialises a new 'SeriesCompensator' instance. + + @param x: Positive sequence reactance. + @param r: Positive sequence resistance. + """ + #: Positive sequence reactance. + self.x = x + + #: Positive sequence resistance. + self.r = r + + super(SeriesCompensator, self).__init__(*args, **kw_args) + + _attrs = ["x", "r"] + _attr_types = {"x": float, "r": float} + _defaults = {"x": 0.0, "r": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/ShuntCompensator.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/ShuntCompensator.py new file mode 100755 index 00000000..f571463a --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/ShuntCompensator.py @@ -0,0 +1,87 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ShuntCompensator(IdentifiedObject): + """A shunt capacitor or reactor or switchable bank of shunt capacitors or reactors. A section of a shunt compensator is an individual capacitor or reactor. A negative value for reactivePerSection indicates that the compensator is a reactor. ShuntCompensator is a single terminal device. Ground is implied. + """ + + def __init__(self, nomQ=0.0, maxU=0.0, g0PerSection=0.0, gPerSection=0.0, minU=0.0, bPerSection=0.0, reactivePerSection=0.0, voltageSensitivity=0.0, nomU=0.0, normalSections=0, b0PerSection=0.0, maximumSections=0, *args, **kw_args): + """Initialises a new 'ShuntCompensator' instance. + + @param nomQ: Nominal reactive power output of the capacitor bank at the nominal voltage. This number should be positive. + @param maxU: The maximum voltage at which the capacitor bank should operate. + @param g0PerSection: Zero sequence shunt (charging) conductance per section + @param gPerSection: Positive sequence shunt (charging) conductance per section + @param minU: The minimum voltage at which the capacitor bank should operate. + @param bPerSection: Positive sequence shunt (charging) susceptance per section + @param reactivePerSection: For a capacitor bank, the size in reactive power of each switchable section at the nominal voltage. + @param voltageSensitivity: Voltage sensitivity required for the device to regulate the bus voltage, in voltage/reactive power. + @param nomU: The nominal voltage at which the nominal reactive power was measured. This should normally be within 10% of the voltage at which the capacitor is connected to the network. + @param normalSections: For a capacitor bank, the normal number of sections switched in. This number should correspond to the nominal reactive power (nomQ). + @param b0PerSection: Zero sequence shunt (charging) susceptance per section + @param maximumSections: For a capacitor bank, the maximum number of sections that may be switched in. + """ + #: Nominal reactive power output of the capacitor bank at the nominal voltage. This number should be positive. + self.nomQ = nomQ + + #: The maximum voltage at which the capacitor bank should operate. + self.maxU = maxU + + #: Zero sequence shunt (charging) conductance per section + self.g0PerSection = g0PerSection + + #: Positive sequence shunt (charging) conductance per section + self.gPerSection = gPerSection + + #: The minimum voltage at which the capacitor bank should operate. + self.minU = minU + + #: Positive sequence shunt (charging) susceptance per section + self.bPerSection = bPerSection + + #: For a capacitor bank, the size in reactive power of each switchable section at the nominal voltage. + self.reactivePerSection = reactivePerSection + + #: Voltage sensitivity required for the device to regulate the bus voltage, in voltage/reactive power. + self.voltageSensitivity = voltageSensitivity + + #: The nominal voltage at which the nominal reactive power was measured. This should normally be within 10% of the voltage at which the capacitor is connected to the network. + self.nomU = nomU + + #: For a capacitor bank, the normal number of sections switched in. This number should correspond to the nominal reactive power (nomQ). + self.normalSections = normalSections + + #: Zero sequence shunt (charging) susceptance per section + self.b0PerSection = b0PerSection + + #: For a capacitor bank, the maximum number of sections that may be switched in. + self.maximumSections = maximumSections + + super(ShuntCompensator, self).__init__(*args, **kw_args) + + _attrs = ["nomQ", "maxU", "g0PerSection", "gPerSection", "minU", "bPerSection", "reactivePerSection", "voltageSensitivity", "nomU", "normalSections", "b0PerSection", "maximumSections"] + _attr_types = {"nomQ": float, "maxU": float, "g0PerSection": float, "gPerSection": float, "minU": float, "bPerSection": float, "reactivePerSection": float, "voltageSensitivity": float, "nomU": float, "normalSections": int, "b0PerSection": float, "maximumSections": int} + _defaults = {"nomQ": 0.0, "maxU": 0.0, "g0PerSection": 0.0, "gPerSection": 0.0, "minU": 0.0, "bPerSection": 0.0, "reactivePerSection": 0.0, "voltageSensitivity": 0.0, "nomU": 0.0, "normalSections": 0, "b0PerSection": 0.0, "maximumSections": 0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/SynchronousMachine.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/SynchronousMachine.py new file mode 100755 index 00000000..625d8685 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/SynchronousMachine.py @@ -0,0 +1,80 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class SynchronousMachine(IdentifiedObject): + """An electromechanical device that operates synchronously with the network. It is a single machine operating either as a generator or synchronous condenser or pump. + """ + + def __init__(self, operatingMode="condenser", maxQ=0.0, baseQ=0.0, minQ=0.0, type="condenser", GeneratingUnit=None, *args, **kw_args): + """Initialises a new 'SynchronousMachine' instance. + + @param operatingMode: Current mode of operation. Values are: "condenser", "generator" + @param maxQ: Maximum reactive power limit. This is the maximum (nameplate) limit for the unit. + @param baseQ: Default base reactive power value. This value represents the initial reactive power that can be used by any application function. + @param minQ: Minimum reactive power limit for the unit. + @param type: Modes that this synchronous machine can operate in. Values are: "condenser", "generator_or_condenser", "generator" + @param GeneratingUnit: A synchronous machine may operate as a generator and as such becomes a member of a generating unit + """ + #: Current mode of operation. Values are: "condenser", "generator" + self.operatingMode = operatingMode + + #: Maximum reactive power limit. This is the maximum (nameplate) limit for the unit. + self.maxQ = maxQ + + #: Default base reactive power value. This value represents the initial reactive power that can be used by any application function. + self.baseQ = baseQ + + #: Minimum reactive power limit for the unit. + self.minQ = minQ + + #: Modes that this synchronous machine can operate in. Values are: "condenser", "generator_or_condenser", "generator" + self.type = type + + self._GeneratingUnit = None + self.GeneratingUnit = GeneratingUnit + + super(SynchronousMachine, self).__init__(*args, **kw_args) + + _attrs = ["operatingMode", "maxQ", "baseQ", "minQ", "type"] + _attr_types = {"operatingMode": str, "maxQ": float, "baseQ": float, "minQ": float, "type": str} + _defaults = {"operatingMode": "condenser", "maxQ": 0.0, "baseQ": 0.0, "minQ": 0.0, "type": "condenser"} + _enums = {"operatingMode": "SynchronousMachineOperatingMode", "type": "SynchronousMachineType"} + _refs = ["GeneratingUnit"] + _many_refs = [] + + def getGeneratingUnit(self): + """A synchronous machine may operate as a generator and as such becomes a member of a generating unit + """ + return self._GeneratingUnit + + def setGeneratingUnit(self, value): + if self._GeneratingUnit is not None: + filtered = [x for x in self.GeneratingUnit.SynchronousMachines if x != self] + self._GeneratingUnit._SynchronousMachines = filtered + + self._GeneratingUnit = value + if self._GeneratingUnit is not None: + if self not in self._GeneratingUnit._SynchronousMachines: + self._GeneratingUnit._SynchronousMachines.append(self) + + GeneratingUnit = property(getGeneratingUnit, setGeneratingUnit) + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/TapChanger.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/TapChanger.py new file mode 100755 index 00000000..af4c9d7a --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/TapChanger.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TapChanger(IdentifiedObject): + """Mechanism for changing transformer winding tap positions. + """ + + def __init__(self, neutralU=0.0, lowStep=0, normalStep=0, neutralStep=0, highStep=0, *args, **kw_args): + """Initialises a new 'TapChanger' instance. + + @param neutralU: Voltage at which the winding operates at the neutral tap setting. + @param lowStep: Lowest possible tap step position, retard from neutral + @param normalStep: The tap step position used in 'normal' network operation for this winding. For a 'Fixed' tap changer indicates the current physical tap setting. + @param neutralStep: The neutral tap step position for this winding. + @param highStep: Highest possible tap step position, advance from neutral + """ + #: Voltage at which the winding operates at the neutral tap setting. + self.neutralU = neutralU + + #: Lowest possible tap step position, retard from neutral + self.lowStep = lowStep + + #: The tap step position used in 'normal' network operation for this winding. For a 'Fixed' tap changer indicates the current physical tap setting. + self.normalStep = normalStep + + #: The neutral tap step position for this winding. + self.neutralStep = neutralStep + + #: Highest possible tap step position, advance from neutral + self.highStep = highStep + + super(TapChanger, self).__init__(*args, **kw_args) + + _attrs = ["neutralU", "lowStep", "normalStep", "neutralStep", "highStep"] + _attr_types = {"neutralU": float, "lowStep": int, "normalStep": int, "neutralStep": int, "highStep": int} + _defaults = {"neutralU": 0.0, "lowStep": 0, "normalStep": 0, "neutralStep": 0, "highStep": 0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerCoreAdmittance.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerCoreAdmittance.py new file mode 100755 index 00000000..b1cdea59 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerCoreAdmittance.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerCoreAdmittance(IdentifiedObject): + + def __init__(self, g0=0.0, g=0.0, b=0.0, b0=0.0, TransformerEnd=None, *args, **kw_args): + """Initialises a new 'TransformerCoreAdmittance' instance. + + @param g0: Zero sequence magnetizing branch conductance. + @param g: Magnetizing branch conductance (G mag). + @param b: Magnetizing branch susceptance (B mag). The value can be positive or negative. + @param b0: Zero sequence magnetizing branch susceptance. + @param TransformerEnd: All transformer ends having this core admittance. + """ + #: Zero sequence magnetizing branch conductance. + self.g0 = g0 + + #: Magnetizing branch conductance (G mag). + self.g = g + + #: Magnetizing branch susceptance (B mag). The value can be positive or negative. + self.b = b + + #: Zero sequence magnetizing branch susceptance. + self.b0 = b0 + + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + super(TransformerCoreAdmittance, self).__init__(*args, **kw_args) + + _attrs = ["g0", "g", "b", "b0"] + _attr_types = {"g0": float, "g": float, "b": float, "b0": float} + _defaults = {"g0": 0.0, "g": 0.0, "b": 0.0, "b0": 0.0} + _enums = {} + _refs = ["TransformerEnd"] + _many_refs = ["TransformerEnd"] + + def getTransformerEnd(self): + """All transformer ends having this core admittance. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.CoreAdmittance = None + for y in value: + y._CoreAdmittance = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.CoreAdmittance = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.CoreAdmittance = None + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerEnd.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerEnd.py new file mode 100755 index 00000000..970ce6c4 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerEnd.py @@ -0,0 +1,139 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerEnd(IdentifiedObject): + """TransformerEnd is a conducting connection point of a power transformer. It corresponds to a physical transformer winding terminal. In earlier CIM versions, the TransformerWinding class served a similar purpose. This successor TransformerEnd class is more flexible and has important differences with TransformerWinding. + """ + + def __init__(self, FromMeshImpedance=None, ToMeshImpedance=None, CoreAdmittance=None, StarImpedance=None, *args, **kw_args): + """Initialises a new 'TransformerEnd' instance. + + @param FromMeshImpedance: All mesh impedances between this 'to' and other 'from' transformer ends. + @param ToMeshImpedance: All mesh impedances between this 'from' and other 'to' transformer ends. + @param CoreAdmittance: Core admittance of this transformer end, representing magnetising current and core losses. The full values of the transformer should be supplied for one transformer end only. + @param StarImpedance: (accurate for 2- or 3-winding transformers only) Pi-model impedances of this transformer end. By convention, for a two winding transformer, the full values of the transformer should be entered on the high voltage end (endNumber=1). + """ + self._FromMeshImpedance = [] + self.FromMeshImpedance = [] if FromMeshImpedance is None else FromMeshImpedance + + self._ToMeshImpedance = [] + self.ToMeshImpedance = [] if ToMeshImpedance is None else ToMeshImpedance + + self._CoreAdmittance = None + self.CoreAdmittance = CoreAdmittance + + self._StarImpedance = None + self.StarImpedance = StarImpedance + + super(TransformerEnd, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["FromMeshImpedance", "ToMeshImpedance", "CoreAdmittance", "StarImpedance"] + _many_refs = ["FromMeshImpedance", "ToMeshImpedance"] + + def getFromMeshImpedance(self): + """All mesh impedances between this 'to' and other 'from' transformer ends. + """ + return self._FromMeshImpedance + + def setFromMeshImpedance(self, value): + for x in self._FromMeshImpedance: + x.FromTransformerEnd = None + for y in value: + y._FromTransformerEnd = self + self._FromMeshImpedance = value + + FromMeshImpedance = property(getFromMeshImpedance, setFromMeshImpedance) + + def addFromMeshImpedance(self, *FromMeshImpedance): + for obj in FromMeshImpedance: + obj.FromTransformerEnd = self + + def removeFromMeshImpedance(self, *FromMeshImpedance): + for obj in FromMeshImpedance: + obj.FromTransformerEnd = None + + def getToMeshImpedance(self): + """All mesh impedances between this 'from' and other 'to' transformer ends. + """ + return self._ToMeshImpedance + + def setToMeshImpedance(self, value): + for p in self._ToMeshImpedance: + filtered = [q for q in p.ToTransformerEnd if q != self] + self._ToMeshImpedance._ToTransformerEnd = filtered + for r in value: + if self not in r._ToTransformerEnd: + r._ToTransformerEnd.append(self) + self._ToMeshImpedance = value + + ToMeshImpedance = property(getToMeshImpedance, setToMeshImpedance) + + def addToMeshImpedance(self, *ToMeshImpedance): + for obj in ToMeshImpedance: + if self not in obj._ToTransformerEnd: + obj._ToTransformerEnd.append(self) + self._ToMeshImpedance.append(obj) + + def removeToMeshImpedance(self, *ToMeshImpedance): + for obj in ToMeshImpedance: + if self in obj._ToTransformerEnd: + obj._ToTransformerEnd.remove(self) + self._ToMeshImpedance.remove(obj) + + def getCoreAdmittance(self): + """Core admittance of this transformer end, representing magnetising current and core losses. The full values of the transformer should be supplied for one transformer end only. + """ + return self._CoreAdmittance + + def setCoreAdmittance(self, value): + if self._CoreAdmittance is not None: + filtered = [x for x in self.CoreAdmittance.TransformerEnd if x != self] + self._CoreAdmittance._TransformerEnd = filtered + + self._CoreAdmittance = value + if self._CoreAdmittance is not None: + if self not in self._CoreAdmittance._TransformerEnd: + self._CoreAdmittance._TransformerEnd.append(self) + + CoreAdmittance = property(getCoreAdmittance, setCoreAdmittance) + + def getStarImpedance(self): + """(accurate for 2- or 3-winding transformers only) Pi-model impedances of this transformer end. By convention, for a two winding transformer, the full values of the transformer should be entered on the high voltage end (endNumber=1). + """ + return self._StarImpedance + + def setStarImpedance(self, value): + if self._StarImpedance is not None: + filtered = [x for x in self.StarImpedance.TransformerEnd if x != self] + self._StarImpedance._TransformerEnd = filtered + + self._StarImpedance = value + if self._StarImpedance is not None: + if self not in self._StarImpedance._TransformerEnd: + self._StarImpedance._TransformerEnd.append(self) + + StarImpedance = property(getStarImpedance, setStarImpedance) + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerMeshImpedance.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerMeshImpedance.py new file mode 100755 index 00000000..ef357660 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerMeshImpedance.py @@ -0,0 +1,108 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerMeshImpedance(IdentifiedObject): + """Transformer mesh impedance (Delta-model) between transformer ends. The typical case is that TransformerMeshImpedance describe the impedance between two TransformerEnds pare wise, i.e. the cardinalities at both TranformerEnd associations are 1. But in cases where two or more TransformerEnds are operated connected together the cardinality at the ToTransfomerEnd role is larger than 1. + """ + + def __init__(self, r=0.0, x=0.0, x0=0.0, r0=0.0, FromTransformerEnd=None, ToTransformerEnd=None, *args, **kw_args): + """Initialises a new 'TransformerMeshImpedance' instance. + + @param r: Resistance between the 'from' and the 'to' end, seen from the 'from' end. + @param x: Reactance between the 'from' and the 'to' end, seen from the 'from' end. + @param x0: Zero-sequence reactance between the 'from' and the 'to' end, seen from the 'from' end. + @param r0: Zero-sequence resistance between the 'from' and the 'to' end, seen from the 'from' end. + @param FromTransformerEnd: From end this mesh impedance is connected to. It determines the voltage reference. + @param ToTransformerEnd: All transformer ends this mesh impedance is connected to. + """ + #: Resistance between the 'from' and the 'to' end, seen from the 'from' end. + self.r = r + + #: Reactance between the 'from' and the 'to' end, seen from the 'from' end. + self.x = x + + #: Zero-sequence reactance between the 'from' and the 'to' end, seen from the 'from' end. + self.x0 = x0 + + #: Zero-sequence resistance between the 'from' and the 'to' end, seen from the 'from' end. + self.r0 = r0 + + self._FromTransformerEnd = None + self.FromTransformerEnd = FromTransformerEnd + + self._ToTransformerEnd = [] + self.ToTransformerEnd = [] if ToTransformerEnd is None else ToTransformerEnd + + super(TransformerMeshImpedance, self).__init__(*args, **kw_args) + + _attrs = ["r", "x", "x0", "r0"] + _attr_types = {"r": float, "x": float, "x0": float, "r0": float} + _defaults = {"r": 0.0, "x": 0.0, "x0": 0.0, "r0": 0.0} + _enums = {} + _refs = ["FromTransformerEnd", "ToTransformerEnd"] + _many_refs = ["ToTransformerEnd"] + + def getFromTransformerEnd(self): + """From end this mesh impedance is connected to. It determines the voltage reference. + """ + return self._FromTransformerEnd + + def setFromTransformerEnd(self, value): + if self._FromTransformerEnd is not None: + filtered = [x for x in self.FromTransformerEnd.FromMeshImpedance if x != self] + self._FromTransformerEnd._FromMeshImpedance = filtered + + self._FromTransformerEnd = value + if self._FromTransformerEnd is not None: + if self not in self._FromTransformerEnd._FromMeshImpedance: + self._FromTransformerEnd._FromMeshImpedance.append(self) + + FromTransformerEnd = property(getFromTransformerEnd, setFromTransformerEnd) + + def getToTransformerEnd(self): + """All transformer ends this mesh impedance is connected to. + """ + return self._ToTransformerEnd + + def setToTransformerEnd(self, value): + for p in self._ToTransformerEnd: + filtered = [q for q in p.ToMeshImpedance if q != self] + self._ToTransformerEnd._ToMeshImpedance = filtered + for r in value: + if self not in r._ToMeshImpedance: + r._ToMeshImpedance.append(self) + self._ToTransformerEnd = value + + ToTransformerEnd = property(getToTransformerEnd, setToTransformerEnd) + + def addToTransformerEnd(self, *ToTransformerEnd): + for obj in ToTransformerEnd: + if self not in obj._ToMeshImpedance: + obj._ToMeshImpedance.append(self) + self._ToTransformerEnd.append(obj) + + def removeToTransformerEnd(self, *ToTransformerEnd): + for obj in ToTransformerEnd: + if self in obj._ToMeshImpedance: + obj._ToMeshImpedance.remove(self) + self._ToTransformerEnd.remove(obj) + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerStarImpedance.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerStarImpedance.py new file mode 100755 index 00000000..fb315cd4 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerStarImpedance.py @@ -0,0 +1,81 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerStarImpedance(IdentifiedObject): + """Transformer star impedance (Pi-model) that accurately reflects impedance for transformers with 2 or 3 windings. For transformers with 4 or more windings, you must use TransformerTank model and related classes. For transmission networks use PowerTransformerEnd impedances (r, r0, x, x0, b, b0, g and g0). + """ + + def __init__(self, x0=0.0, x=0.0, r0=0.0, r=0.0, TransformerEnd=None, *args, **kw_args): + """Initialises a new 'TransformerStarImpedance' instance. + + @param x0: Zero sequence series reactance of the transformer end. + @param x: Positive sequence series reactance of the transformer end. + @param r0: Zero sequence series resistance of the transformer end. + @param r: Resistance of the transformer end. + @param TransformerEnd: All transformer ends having this star impedance. + """ + #: Zero sequence series reactance of the transformer end. + self.x0 = x0 + + #: Positive sequence series reactance of the transformer end. + self.x = x + + #: Zero sequence series resistance of the transformer end. + self.r0 = r0 + + #: Resistance of the transformer end. + self.r = r + + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + super(TransformerStarImpedance, self).__init__(*args, **kw_args) + + _attrs = ["x0", "x", "r0", "r"] + _attr_types = {"x0": float, "x": float, "r0": float, "r": float} + _defaults = {"x0": 0.0, "x": 0.0, "r0": 0.0, "r": 0.0} + _enums = {} + _refs = ["TransformerEnd"] + _many_refs = ["TransformerEnd"] + + def getTransformerEnd(self): + """All transformer ends having this star impedance. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.StarImpedance = None + for y in value: + y._StarImpedance = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.StarImpedance = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.StarImpedance = None + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerTankEnd.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerTankEnd.py new file mode 100755 index 00000000..13242d73 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/TransformerTankEnd.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Balanced.IEC61970.Wires.TransformerEnd import TransformerEnd + +class TransformerTankEnd(TransformerEnd): + """Transformer tank end represents an individual winding for unbalanced models or for transformer tanks connected into a bank (and bank is modelled with the PowerTransformer). + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'TransformerTankEnd' instance. + + """ + super(TransformerTankEnd, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Balanced/IEC61970/Wires/__init__.py b/CIM16/CDPSM/Balanced/IEC61970/Wires/__init__.py new file mode 100755 index 00000000..d2a3cda1 --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/Wires/__init__.py @@ -0,0 +1,84 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""An extension to the Core and Topology package that models information on the electrical characteristics of Transmission and Distribution networks. This package is used by network applications such as State Estimation, Load Flow and Optimal Power Flow. +""" + +from CIM16.CDPSM.Balanced.IEC61970.Wires.PhaseTapChangerLinear import PhaseTapChangerLinear +from CIM16.CDPSM.Balanced.IEC61970.Wires.EnergyConsumer import EnergyConsumer +from CIM16.CDPSM.Balanced.IEC61970.Wires.ACLineSegment import ACLineSegment +from CIM16.CDPSM.Balanced.IEC61970.Wires.TransformerCoreAdmittance import TransformerCoreAdmittance +from CIM16.CDPSM.Balanced.IEC61970.Wires.SynchronousMachine import SynchronousMachine +from CIM16.CDPSM.Balanced.IEC61970.Wires.PowerTransformerEnd import PowerTransformerEnd +from CIM16.CDPSM.Balanced.IEC61970.Wires.PhaseTapChangerAsymetrical import PhaseTapChangerAsymetrical +from CIM16.CDPSM.Balanced.IEC61970.Wires.TransformerMeshImpedance import TransformerMeshImpedance +from CIM16.CDPSM.Balanced.IEC61970.Wires.ProtectedSwitch import ProtectedSwitch +from CIM16.CDPSM.Balanced.IEC61970.Wires.PhaseTapChangerNonLinear import PhaseTapChangerNonLinear +from CIM16.CDPSM.Balanced.IEC61970.Wires.RatioTapChanger import RatioTapChanger +from CIM16.CDPSM.Balanced.IEC61970.Wires.SeriesCompensator import SeriesCompensator +from CIM16.CDPSM.Balanced.IEC61970.Wires.PhaseTapChanger import PhaseTapChanger +from CIM16.CDPSM.Balanced.IEC61970.Wires.TransformerTankEnd import TransformerTankEnd +from CIM16.CDPSM.Balanced.IEC61970.Wires.DCLineSegment import DCLineSegment +from CIM16.CDPSM.Balanced.IEC61970.Wires.TapChanger import TapChanger +from CIM16.CDPSM.Balanced.IEC61970.Wires.PhaseTapChangerSymetrical import PhaseTapChangerSymetrical +from CIM16.CDPSM.Balanced.IEC61970.Wires.TransformerStarImpedance import TransformerStarImpedance +from CIM16.CDPSM.Balanced.IEC61970.Wires.PowerTransformer import PowerTransformer +from CIM16.CDPSM.Balanced.IEC61970.Wires.TransformerEnd import TransformerEnd +from CIM16.CDPSM.Balanced.IEC61970.Wires.EnergySource import EnergySource +from CIM16.CDPSM.Balanced.IEC61970.Wires.ShuntCompensator import ShuntCompensator + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Balanced#Wires" +nsPrefix = "cimWires" + + +class WindingType(str): + """Values are: tertiary, primary, secondary, quaternary + """ + pass + +class SynchronousMachineType(str): + """Values are: condenser, generator_or_condenser, generator + """ + pass + +class PhaseTapChangerKind(str): + """Values are: unknown, asymmetrical, symmetrical + """ + pass + +class SynchronousMachineOperatingMode(str): + """Values are: condenser, generator + """ + pass + +class TransformerControlMode(str): + """Values are: reactive, volt + """ + pass + +class WindingConnection(str): + """Values are: Z, A, Yn, Y, Zn, D, I + """ + pass + +class TapChangerKind(str): + """Values are: voltageAndPhaseControl, phaseControl, fixed, voltageControl + """ + pass diff --git a/CIM16/CDPSM/Balanced/IEC61970/__init__.py b/CIM16/CDPSM/Balanced/IEC61970/__init__.py new file mode 100755 index 00000000..2e5554cc --- /dev/null +++ b/CIM16/CDPSM/Balanced/IEC61970/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The ControlArea package models area specifications which can be used for a variety of purposes. The package as a whole models potentially overlapping control area specifications for the purpose of actual generation control, load forecast area load capture, or powerflow based analysis. +""" + + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Balanced#IEC61970" +nsPrefix = "cimIEC61970" + diff --git a/CIM16/CDPSM/Balanced/__init__.py b/CIM16/CDPSM/Balanced/__init__.py new file mode 100755 index 00000000..bb438f4c --- /dev/null +++ b/CIM16/CDPSM/Balanced/__init__.py @@ -0,0 +1,151 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The IEC 61968 subpackages of the CIM are developed, standardized and maintained by IEC TC57 Working Group 14: interfaces for distribution management (WG14). Currently, normative parts of the model support the needs of information exchange defined in IEC 61968-9 and in IEC 61968-13. +""" + +from CIM16.CDPSM.Balanced.Element import Element + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Balanced" +nsPrefix = "balanced" + +packageMap = { + "Element": "CIM16.CDPSM.Balanced", + "PhaseTapChangerLinear": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "EnergyConsumer": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "ACLineSegment": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "TransformerCoreAdmittance": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "SynchronousMachine": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "PowerTransformerEnd": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "PhaseTapChangerAsymetrical": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "TransformerMeshImpedance": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "ProtectedSwitch": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "PhaseTapChangerNonLinear": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "RatioTapChanger": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "SeriesCompensator": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "PhaseTapChanger": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "TransformerTankEnd": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "DCLineSegment": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "TapChanger": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "PhaseTapChangerSymetrical": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "TransformerStarImpedance": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "PowerTransformer": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "TransformerEnd": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "EnergySource": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "ShuntCompensator": "CIM16.CDPSM.Balanced.IEC61970.Wires", + "LoadResponseCharacteristic": "CIM16.CDPSM.Balanced.IEC61970.LoadModel", + "GeneratingUnit": "CIM16.CDPSM.Balanced.IEC61970.Generation.Production", + "NameType": "CIM16.CDPSM.Balanced.IEC61970.Core", + "IdentifiedObject": "CIM16.CDPSM.Balanced.IEC61970.Core", + "Name": "CIM16.CDPSM.Balanced.IEC61970.Core", +} + + +class Resistance(float): + """Resistance (real part of impedance). + """ + pass + +class Reactance(float): + """Reactance (imaginary part of impedance), at rated frequency. + """ + pass + +class PerCent(float): + """Normally 0 - 100 on a defined base + """ + pass + +class Voltage(float): + """Electrical voltage. + """ + pass + +class Conductance(float): + """Factor by which voltage must be multiplied to give corresponding power lost from a circuit. Real part of admittance. + """ + pass + +class AngleDegrees(float): + """Measurement of angle in degrees + """ + pass + +class VoltagePerReactivePower(float): + """Voltage variation with reactive power + """ + pass + +class AngleRadians(float): + """Phase angle in radians + """ + pass + +class ActivePower(float): + """Product of RMS value of the voltage and the RMS value of the in-phase component of the current + """ + pass + +class ApparentPower(float): + """Product of the RMS value of the voltage and the RMS value of the current + """ + pass + +class CurrentFlow(float): + """Electrical current (positive flow is out of the ConductingEquipment into the ConnectivityNode) + """ + pass + +class Susceptance(float): + """Imaginary part of admittance. + """ + pass + +class ReactivePower(float): + """Product of RMS value of the voltage and the RMS value of the quadrature component of the current. + """ + pass + +class CIMTime(str): + pass + +class CIMDateTime(str): + pass + +class CIMDuration(str): + pass + +class CIMGYear(str): + pass + +class CIMDate(str): + pass + +class CIMGMonthDay(str): + pass + +class CIMGMonth(str): + pass + +class CIMGDay(str): + pass + +class CIMGYearMonth(str): + pass diff --git a/CIM16/CDPSM/Connectivity/Element.py b/CIM16/CDPSM/Connectivity/Element.py new file mode 100755 index 00000000..fddaa815 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/Element.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class Element(object): + + def __init__(self, UUID=''): + """Initialises a new 'Element' instance. + + @param UUID: + """ + + self.UUID = UUID + + + _attrs = ["UUID"] + _attr_types = {"UUID": str} + _defaults = {"UUID": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/BaseVoltage.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/BaseVoltage.py new file mode 100755 index 00000000..02061a23 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/BaseVoltage.py @@ -0,0 +1,95 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class BaseVoltage(IdentifiedObject): + """Defines a nominal base voltage which is referenced in the system. + """ + + def __init__(self, nominalVoltage=0.0, ConductingEquipment=None, VoltageLevel=None, *args, **kw_args): + """Initialises a new 'BaseVoltage' instance. + + @param nominalVoltage: The PowerSystemResource's base voltage. + @param ConductingEquipment: Use association to ConductingEquipment only when there is no VoltageLevel container used. + @param VoltageLevel: The VoltageLevels having this BaseVoltage. + """ + #: The PowerSystemResource's base voltage. + self.nominalVoltage = nominalVoltage + + self._ConductingEquipment = [] + self.ConductingEquipment = [] if ConductingEquipment is None else ConductingEquipment + + self._VoltageLevel = [] + self.VoltageLevel = [] if VoltageLevel is None else VoltageLevel + + super(BaseVoltage, self).__init__(*args, **kw_args) + + _attrs = ["nominalVoltage"] + _attr_types = {"nominalVoltage": float} + _defaults = {"nominalVoltage": 0.0} + _enums = {} + _refs = ["ConductingEquipment", "VoltageLevel"] + _many_refs = ["ConductingEquipment", "VoltageLevel"] + + def getConductingEquipment(self): + """Use association to ConductingEquipment only when there is no VoltageLevel container used. + """ + return self._ConductingEquipment + + def setConductingEquipment(self, value): + for x in self._ConductingEquipment: + x.BaseVoltage = None + for y in value: + y._BaseVoltage = self + self._ConductingEquipment = value + + ConductingEquipment = property(getConductingEquipment, setConductingEquipment) + + def addConductingEquipment(self, *ConductingEquipment): + for obj in ConductingEquipment: + obj.BaseVoltage = self + + def removeConductingEquipment(self, *ConductingEquipment): + for obj in ConductingEquipment: + obj.BaseVoltage = None + + def getVoltageLevel(self): + """The VoltageLevels having this BaseVoltage. + """ + return self._VoltageLevel + + def setVoltageLevel(self, value): + for x in self._VoltageLevel: + x.BaseVoltage = None + for y in value: + y._BaseVoltage = self + self._VoltageLevel = value + + VoltageLevel = property(getVoltageLevel, setVoltageLevel) + + def addVoltageLevel(self, *VoltageLevel): + for obj in VoltageLevel: + obj.BaseVoltage = self + + def removeVoltageLevel(self, *VoltageLevel): + for obj in VoltageLevel: + obj.BaseVoltage = None + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/Bay.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/Bay.py new file mode 100755 index 00000000..75a0a964 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/Bay.py @@ -0,0 +1,81 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class Bay(EquipmentContainer): + """A collection of power system resources (within a given substation) including conducting equipment, protection relays, measurements, and telemetry. + """ + + def __init__(self, VoltageLevel=None, Substation=None, *args, **kw_args): + """Initialises a new 'Bay' instance. + + @param VoltageLevel: The association is used in the naming hierarchy. + @param Substation: The association is used in the naming hierarchy. + """ + self._VoltageLevel = None + self.VoltageLevel = VoltageLevel + + self._Substation = None + self.Substation = Substation + + super(Bay, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["VoltageLevel", "Substation"] + _many_refs = [] + + def getVoltageLevel(self): + """The association is used in the naming hierarchy. + """ + return self._VoltageLevel + + def setVoltageLevel(self, value): + if self._VoltageLevel is not None: + filtered = [x for x in self.VoltageLevel.Bays if x != self] + self._VoltageLevel._Bays = filtered + + self._VoltageLevel = value + if self._VoltageLevel is not None: + if self not in self._VoltageLevel._Bays: + self._VoltageLevel._Bays.append(self) + + VoltageLevel = property(getVoltageLevel, setVoltageLevel) + + def getSubstation(self): + """The association is used in the naming hierarchy. + """ + return self._Substation + + def setSubstation(self, value): + if self._Substation is not None: + filtered = [x for x in self.Substation.Bays if x != self] + self._Substation._Bays = filtered + + self._Substation = value + if self._Substation is not None: + if self not in self._Substation._Bays: + self._Substation._Bays.append(self) + + Substation = property(getSubstation, setSubstation) + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/ConductingEquipment.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/ConductingEquipment.py new file mode 100755 index 00000000..abceed64 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/ConductingEquipment.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.Equipment import Equipment + +class ConductingEquipment(Equipment): + """The parts of the power system that are designed to carry current or that are conductively connected therewith. ConductingEquipment is contained within an EquipmentContainer that may be a Substation, or a VoltageLevel or a Bay within a Substation. + """ + + def __init__(self, Terminals=None, *args, **kw_args): + """Initialises a new 'ConductingEquipment' instance. + + @param Terminals: ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + """ + self._Terminals = [] + self.Terminals = [] if Terminals is None else Terminals + + super(ConductingEquipment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Terminals"] + _many_refs = ["Terminals"] + + def getTerminals(self): + """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + """ + return self._Terminals + + def setTerminals(self, value): + for x in self._Terminals: + x.ConductingEquipment = None + for y in value: + y._ConductingEquipment = self + self._Terminals = value + + Terminals = property(getTerminals, setTerminals) + + def addTerminals(self, *Terminals): + for obj in Terminals: + obj.ConductingEquipment = self + + def removeTerminals(self, *Terminals): + for obj in Terminals: + obj.ConductingEquipment = None + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/ConnectivityNode.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/ConnectivityNode.py new file mode 100755 index 00000000..3938d35c --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/ConnectivityNode.py @@ -0,0 +1,86 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ConnectivityNode(IdentifiedObject): + """Connectivity nodes are points where terminals of conducting equipment are connected together with zero impedance. + """ + + def __init__(self, ConnectivityNodeContainer=None, Terminals=None, *args, **kw_args): + """Initialises a new 'ConnectivityNode' instance. + + @param ConnectivityNodeContainer: Container of this connectivity node. + @param Terminals: Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + """ + self._ConnectivityNodeContainer = None + self.ConnectivityNodeContainer = ConnectivityNodeContainer + + self._Terminals = [] + self.Terminals = [] if Terminals is None else Terminals + + super(ConnectivityNode, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ConnectivityNodeContainer", "Terminals"] + _many_refs = ["Terminals"] + + def getConnectivityNodeContainer(self): + """Container of this connectivity node. + """ + return self._ConnectivityNodeContainer + + def setConnectivityNodeContainer(self, value): + if self._ConnectivityNodeContainer is not None: + filtered = [x for x in self.ConnectivityNodeContainer.ConnectivityNodes if x != self] + self._ConnectivityNodeContainer._ConnectivityNodes = filtered + + self._ConnectivityNodeContainer = value + if self._ConnectivityNodeContainer is not None: + if self not in self._ConnectivityNodeContainer._ConnectivityNodes: + self._ConnectivityNodeContainer._ConnectivityNodes.append(self) + + ConnectivityNodeContainer = property(getConnectivityNodeContainer, setConnectivityNodeContainer) + + def getTerminals(self): + """Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + """ + return self._Terminals + + def setTerminals(self, value): + for x in self._Terminals: + x.ConnectivityNode = None + for y in value: + y._ConnectivityNode = self + self._Terminals = value + + Terminals = property(getTerminals, setTerminals) + + def addTerminals(self, *Terminals): + for obj in Terminals: + obj.ConnectivityNode = self + + def removeTerminals(self, *Terminals): + for obj in Terminals: + obj.ConnectivityNode = None + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/ConnectivityNodeContainer.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/ConnectivityNodeContainer.py new file mode 100755 index 00000000..6c6698d3 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/ConnectivityNodeContainer.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class ConnectivityNodeContainer(PowerSystemResource): + """A base class for all objects that may contain ConnectivityNodes or TopologicalNodes. + """ + + def __init__(self, ConnectivityNodes=None, *args, **kw_args): + """Initialises a new 'ConnectivityNodeContainer' instance. + + @param ConnectivityNodes: Connectivity nodes contained by this container. + """ + self._ConnectivityNodes = [] + self.ConnectivityNodes = [] if ConnectivityNodes is None else ConnectivityNodes + + super(ConnectivityNodeContainer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ConnectivityNodes"] + _many_refs = ["ConnectivityNodes"] + + def getConnectivityNodes(self): + """Connectivity nodes contained by this container. + """ + return self._ConnectivityNodes + + def setConnectivityNodes(self, value): + for x in self._ConnectivityNodes: + x.ConnectivityNodeContainer = None + for y in value: + y._ConnectivityNodeContainer = self + self._ConnectivityNodes = value + + ConnectivityNodes = property(getConnectivityNodes, setConnectivityNodes) + + def addConnectivityNodes(self, *ConnectivityNodes): + for obj in ConnectivityNodes: + obj.ConnectivityNodeContainer = self + + def removeConnectivityNodes(self, *ConnectivityNodes): + for obj in ConnectivityNodes: + obj.ConnectivityNodeContainer = None + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/Equipment.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/Equipment.py new file mode 100755 index 00000000..3fa1d235 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/Equipment.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class Equipment(PowerSystemResource): + """The parts of a power system that are physical devices, electronic or mechanical + """ + + def __init__(self, EquipmentContainer=None, *args, **kw_args): + """Initialises a new 'Equipment' instance. + + @param EquipmentContainer: The association is used in the naming hierarchy. + """ + self._EquipmentContainer = None + self.EquipmentContainer = EquipmentContainer + + super(Equipment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["EquipmentContainer"] + _many_refs = [] + + def getEquipmentContainer(self): + """The association is used in the naming hierarchy. + """ + return self._EquipmentContainer + + def setEquipmentContainer(self, value): + if self._EquipmentContainer is not None: + filtered = [x for x in self.EquipmentContainer.Equipments if x != self] + self._EquipmentContainer._Equipments = filtered + + self._EquipmentContainer = value + if self._EquipmentContainer is not None: + if self not in self._EquipmentContainer._Equipments: + self._EquipmentContainer._Equipments.append(self) + + EquipmentContainer = property(getEquipmentContainer, setEquipmentContainer) + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/EquipmentContainer.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/EquipmentContainer.py new file mode 100755 index 00000000..de8da3e9 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/EquipmentContainer.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConnectivityNodeContainer import ConnectivityNodeContainer + +class EquipmentContainer(ConnectivityNodeContainer): + """A modeling construct to provide a root class for containing equipment. + """ + + def __init__(self, Equipments=None, *args, **kw_args): + """Initialises a new 'EquipmentContainer' instance. + + @param Equipments: The association is used in the naming hierarchy. + """ + self._Equipments = [] + self.Equipments = [] if Equipments is None else Equipments + + super(EquipmentContainer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Equipments"] + _many_refs = ["Equipments"] + + def getEquipments(self): + """The association is used in the naming hierarchy. + """ + return self._Equipments + + def setEquipments(self, value): + for x in self._Equipments: + x.EquipmentContainer = None + for y in value: + y._EquipmentContainer = self + self._Equipments = value + + Equipments = property(getEquipments, setEquipments) + + def addEquipments(self, *Equipments): + for obj in Equipments: + obj.EquipmentContainer = self + + def removeEquipments(self, *Equipments): + for obj in Equipments: + obj.EquipmentContainer = None + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/GeographicalRegion.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/GeographicalRegion.py new file mode 100755 index 00000000..3e52ccdf --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/GeographicalRegion.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GeographicalRegion(IdentifiedObject): + """A geographical region of a power system network model. + """ + + def __init__(self, Regions=None, *args, **kw_args): + """Initialises a new 'GeographicalRegion' instance. + + @param Regions: The association is used in the naming hierarchy. + """ + self._Regions = [] + self.Regions = [] if Regions is None else Regions + + super(GeographicalRegion, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Regions"] + _many_refs = ["Regions"] + + def getRegions(self): + """The association is used in the naming hierarchy. + """ + return self._Regions + + def setRegions(self, value): + for x in self._Regions: + x.Region = None + for y in value: + y._Region = self + self._Regions = value + + Regions = property(getRegions, setRegions) + + def addRegions(self, *Regions): + for obj in Regions: + obj.Region = self + + def removeRegions(self, *Regions): + for obj in Regions: + obj.Region = None + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/IdentifiedObject.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/IdentifiedObject.py new file mode 100755 index 00000000..dc3d24e1 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/IdentifiedObject.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.Element import Element + +class IdentifiedObject(Element): + """This is a root class to provide common identification for all classes needing identification and naming attributes + """ + + def __init__(self, name='', aliasName='', Names=None, *args, **kw_args): + """Initialises a new 'IdentifiedObject' instance. + + @param name: The name is any free human readable and possibly non unique text naming the object. + @param aliasName: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + @param Names: All names of this identified object. + """ + #: The name is any free human readable and possibly non unique text naming the object. + self.name = name + + #: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + self.aliasName = aliasName + + self._Names = [] + self.Names = [] if Names is None else Names + + super(IdentifiedObject, self).__init__(*args, **kw_args) + + _attrs = ["name", "aliasName"] + _attr_types = {"name": str, "aliasName": str} + _defaults = {"name": '', "aliasName": ''} + _enums = {} + _refs = ["Names"] + _many_refs = ["Names"] + + def getNames(self): + """All names of this identified object. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.IdentifiedObject = None + for y in value: + y._IdentifiedObject = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = self + + def removeNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = None + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/Name.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/Name.py new file mode 100755 index 00000000..97e58780 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/Name.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.Element import Element + +class Name(Element): + """The Name class provides the means to define any number of human readable names for an object. A name is not to be used for defining inter-object relationships. For inter-object relationships instead use the object identification 'mRID'. + """ + + def __init__(self, name='', IdentifiedObject=None, NameType=None, *args, **kw_args): + """Initialises a new 'Name' instance. + + @param name: Any free text that name the object. + @param IdentifiedObject: Identified object that this name designates. + @param NameType: Type of this name. + """ + #: Any free text that name the object. + self.name = name + + self._IdentifiedObject = None + self.IdentifiedObject = IdentifiedObject + + self._NameType = None + self.NameType = NameType + + super(Name, self).__init__(*args, **kw_args) + + _attrs = ["name"] + _attr_types = {"name": str} + _defaults = {"name": ''} + _enums = {} + _refs = ["IdentifiedObject", "NameType"] + _many_refs = [] + + def getIdentifiedObject(self): + """Identified object that this name designates. + """ + return self._IdentifiedObject + + def setIdentifiedObject(self, value): + if self._IdentifiedObject is not None: + filtered = [x for x in self.IdentifiedObject.Names if x != self] + self._IdentifiedObject._Names = filtered + + self._IdentifiedObject = value + if self._IdentifiedObject is not None: + if self not in self._IdentifiedObject._Names: + self._IdentifiedObject._Names.append(self) + + IdentifiedObject = property(getIdentifiedObject, setIdentifiedObject) + + def getNameType(self): + """Type of this name. + """ + return self._NameType + + def setNameType(self, value): + if self._NameType is not None: + filtered = [x for x in self.NameType.Names if x != self] + self._NameType._Names = filtered + + self._NameType = value + if self._NameType is not None: + if self not in self._NameType._Names: + self._NameType._Names.append(self) + + NameType = property(getNameType, setNameType) + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/NameType.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/NameType.py new file mode 100755 index 00000000..9043908a --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/NameType.py @@ -0,0 +1,94 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.Element import Element + +class NameType(Element): + """Type of name. Possible values for attribute 'name' are implementation dependent but standard profiles may specify types. An enterprise may have multiple IT systems each having its own local name for the same object, e.g. a planning system may have different names from an EMS. An object may also have different names within the same IT system, e.g. localName and aliasName as defined in CIM version 14. Their definitions from CIM14 are The localName is a human readable name of the object. It is only used with objects organized in a naming hierarchy. localName: A free text name local to a node in a naming hierarchy similar to a file directory structure. A power system related naming hierarchy may be: Substation, VoltageLevel, Equipment etc. Children of the same parent in such a hierarchy have names that typically are unique among them. aliasName: A free text alternate name typically used in tabular reports where the column width is limited. + """ + + def __init__(self, name='', description='', NameTypeAuthority=None, Names=None, *args, **kw_args): + """Initialises a new 'NameType' instance. + + @param name: Name of the name type. + @param description: Description of the name type. + @param NameTypeAuthority: Authority responsible for managing names of this type. + @param Names: All names of this type. + """ + #: Name of the name type. + self.name = name + + #: Description of the name type. + self.description = description + + self._NameTypeAuthority = None + self.NameTypeAuthority = NameTypeAuthority + + self._Names = [] + self.Names = [] if Names is None else Names + + super(NameType, self).__init__(*args, **kw_args) + + _attrs = ["name", "description"] + _attr_types = {"name": str, "description": str} + _defaults = {"name": '', "description": ''} + _enums = {} + _refs = ["NameTypeAuthority", "Names"] + _many_refs = ["Names"] + + def getNameTypeAuthority(self): + """Authority responsible for managing names of this type. + """ + return self._NameTypeAuthority + + def setNameTypeAuthority(self, value): + if self._NameTypeAuthority is not None: + filtered = [x for x in self.NameTypeAuthority.NameTypes if x != self] + self._NameTypeAuthority._NameTypes = filtered + + self._NameTypeAuthority = value + if self._NameTypeAuthority is not None: + if self not in self._NameTypeAuthority._NameTypes: + self._NameTypeAuthority._NameTypes.append(self) + + NameTypeAuthority = property(getNameTypeAuthority, setNameTypeAuthority) + + def getNames(self): + """All names of this type. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.NameType = None + for y in value: + y._NameType = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.NameType = self + + def removeNames(self, *Names): + for obj in Names: + obj.NameType = None + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/NameTypeAuthority.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/NameTypeAuthority.py new file mode 100755 index 00000000..c3d167cf --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/NameTypeAuthority.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.Element import Element + +class NameTypeAuthority(Element): + """Authority responsible for creation and management of names of a given type; typically an organization or an enterprise system. + """ + + def __init__(self, name='', description='', NameTypes=None, *args, **kw_args): + """Initialises a new 'NameTypeAuthority' instance. + + @param name: Name of the name type authority. + @param description: Description of the name type authority. + @param NameTypes: All name types managed by this authority. + """ + #: Name of the name type authority. + self.name = name + + #: Description of the name type authority. + self.description = description + + self._NameTypes = [] + self.NameTypes = [] if NameTypes is None else NameTypes + + super(NameTypeAuthority, self).__init__(*args, **kw_args) + + _attrs = ["name", "description"] + _attr_types = {"name": str, "description": str} + _defaults = {"name": '', "description": ''} + _enums = {} + _refs = ["NameTypes"] + _many_refs = ["NameTypes"] + + def getNameTypes(self): + """All name types managed by this authority. + """ + return self._NameTypes + + def setNameTypes(self, value): + for x in self._NameTypes: + x.NameTypeAuthority = None + for y in value: + y._NameTypeAuthority = self + self._NameTypes = value + + NameTypes = property(getNameTypes, setNameTypes) + + def addNameTypes(self, *NameTypes): + for obj in NameTypes: + obj.NameTypeAuthority = self + + def removeNameTypes(self, *NameTypes): + for obj in NameTypes: + obj.NameTypeAuthority = None + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/PSRType.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/PSRType.py new file mode 100755 index 00000000..d92b80cf --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/PSRType.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PSRType(IdentifiedObject): + """Classifying instances of the same class, e.g. overhead and underground ACLineSegments. This classification mechanism is intended to provide flexibility outside the scope of this standard, i.e. provide customisation that is non standard. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'PSRType' instance. + + """ + super(PSRType, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/PowerSystemResource.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/PowerSystemResource.py new file mode 100755 index 00000000..a372de56 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/PowerSystemResource.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PowerSystemResource(IdentifiedObject): + """A power system resource can be an item of equipment such as a Switch, an EquipmentContainer containing many individual items of equipment such as a Substation, or an organisational entity such as Company or SubControlArea. This provides for the nesting of collections of PowerSystemResources within other PowerSystemResources. For example, a Switch could be a member of a Substation and a Substation could be a member of a division of a Company. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'PowerSystemResource' instance. + + """ + super(PowerSystemResource, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/SubGeographicalRegion.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/SubGeographicalRegion.py new file mode 100755 index 00000000..f1df3ef2 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/SubGeographicalRegion.py @@ -0,0 +1,112 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class SubGeographicalRegion(IdentifiedObject): + """A subset of a geographical region of a power system network model. + """ + + def __init__(self, Lines=None, Substations=None, Region=None, *args, **kw_args): + """Initialises a new 'SubGeographicalRegion' instance. + + @param Lines: A Line can be contained by a SubGeographical Region. + @param Substations: The association is used in the naming hierarchy. + @param Region: The association is used in the naming hierarchy. + """ + self._Lines = [] + self.Lines = [] if Lines is None else Lines + + self._Substations = [] + self.Substations = [] if Substations is None else Substations + + self._Region = None + self.Region = Region + + super(SubGeographicalRegion, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Lines", "Substations", "Region"] + _many_refs = ["Lines", "Substations"] + + def getLines(self): + """A Line can be contained by a SubGeographical Region. + """ + return self._Lines + + def setLines(self, value): + for x in self._Lines: + x.Region = None + for y in value: + y._Region = self + self._Lines = value + + Lines = property(getLines, setLines) + + def addLines(self, *Lines): + for obj in Lines: + obj.Region = self + + def removeLines(self, *Lines): + for obj in Lines: + obj.Region = None + + def getSubstations(self): + """The association is used in the naming hierarchy. + """ + return self._Substations + + def setSubstations(self, value): + for x in self._Substations: + x.Region = None + for y in value: + y._Region = self + self._Substations = value + + Substations = property(getSubstations, setSubstations) + + def addSubstations(self, *Substations): + for obj in Substations: + obj.Region = self + + def removeSubstations(self, *Substations): + for obj in Substations: + obj.Region = None + + def getRegion(self): + """The association is used in the naming hierarchy. + """ + return self._Region + + def setRegion(self, value): + if self._Region is not None: + filtered = [x for x in self.Region.Regions if x != self] + self._Region._Regions = filtered + + self._Region = value + if self._Region is not None: + if self not in self._Region._Regions: + self._Region._Regions.append(self) + + Region = property(getRegion, setRegion) + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/Substation.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/Substation.py new file mode 100755 index 00000000..f4f6a409 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/Substation.py @@ -0,0 +1,112 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class Substation(EquipmentContainer): + """A collection of equipment for purposes other than generation or utilization, through which electric energy in bulk is passed for the purposes of switching or modifying its characteristics. + """ + + def __init__(self, Region=None, VoltageLevels=None, Bays=None, *args, **kw_args): + """Initialises a new 'Substation' instance. + + @param Region: The association is used in the naming hierarchy. + @param VoltageLevels: The association is used in the naming hierarchy. + @param Bays: The association is used in the naming hierarchy. + """ + self._Region = None + self.Region = Region + + self._VoltageLevels = [] + self.VoltageLevels = [] if VoltageLevels is None else VoltageLevels + + self._Bays = [] + self.Bays = [] if Bays is None else Bays + + super(Substation, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Region", "VoltageLevels", "Bays"] + _many_refs = ["VoltageLevels", "Bays"] + + def getRegion(self): + """The association is used in the naming hierarchy. + """ + return self._Region + + def setRegion(self, value): + if self._Region is not None: + filtered = [x for x in self.Region.Substations if x != self] + self._Region._Substations = filtered + + self._Region = value + if self._Region is not None: + if self not in self._Region._Substations: + self._Region._Substations.append(self) + + Region = property(getRegion, setRegion) + + def getVoltageLevels(self): + """The association is used in the naming hierarchy. + """ + return self._VoltageLevels + + def setVoltageLevels(self, value): + for x in self._VoltageLevels: + x.Substation = None + for y in value: + y._Substation = self + self._VoltageLevels = value + + VoltageLevels = property(getVoltageLevels, setVoltageLevels) + + def addVoltageLevels(self, *VoltageLevels): + for obj in VoltageLevels: + obj.Substation = self + + def removeVoltageLevels(self, *VoltageLevels): + for obj in VoltageLevels: + obj.Substation = None + + def getBays(self): + """The association is used in the naming hierarchy. + """ + return self._Bays + + def setBays(self, value): + for x in self._Bays: + x.Substation = None + for y in value: + y._Substation = self + self._Bays = value + + Bays = property(getBays, setBays) + + def addBays(self, *Bays): + for obj in Bays: + obj.Substation = self + + def removeBays(self, *Bays): + for obj in Bays: + obj.Substation = None + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/Terminal.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/Terminal.py new file mode 100755 index 00000000..db87f773 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/Terminal.py @@ -0,0 +1,111 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Terminal(IdentifiedObject): + """An electrical connection point to a piece of conducting equipment. Terminals are connected at physical connection points called 'connectivity nodes'. + """ + + def __init__(self, phases="s12N", ConnectivityNode=None, TransformerEnd=None, ConductingEquipment=None, *args, **kw_args): + """Initialises a new 'Terminal' instance. + + @param phases: Represents the normal network phasing condition. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param ConnectivityNode: Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + @param TransformerEnd: All transformer ends connected at this external terminal. + @param ConductingEquipment: ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + """ + #: Represents the normal network phasing condition. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.phases = phases + + self._ConnectivityNode = None + self.ConnectivityNode = ConnectivityNode + + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + self._ConductingEquipment = None + self.ConductingEquipment = ConductingEquipment + + super(Terminal, self).__init__(*args, **kw_args) + + _attrs = ["phases"] + _attr_types = {"phases": str} + _defaults = {"phases": "s12N"} + _enums = {"phases": "PhaseCode"} + _refs = ["ConnectivityNode", "TransformerEnd", "ConductingEquipment"] + _many_refs = ["TransformerEnd"] + + def getConnectivityNode(self): + """Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + """ + return self._ConnectivityNode + + def setConnectivityNode(self, value): + if self._ConnectivityNode is not None: + filtered = [x for x in self.ConnectivityNode.Terminals if x != self] + self._ConnectivityNode._Terminals = filtered + + self._ConnectivityNode = value + if self._ConnectivityNode is not None: + if self not in self._ConnectivityNode._Terminals: + self._ConnectivityNode._Terminals.append(self) + + ConnectivityNode = property(getConnectivityNode, setConnectivityNode) + + def getTransformerEnd(self): + """All transformer ends connected at this external terminal. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.Terminal = None + for y in value: + y._Terminal = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.Terminal = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.Terminal = None + + def getConductingEquipment(self): + """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + """ + return self._ConductingEquipment + + def setConductingEquipment(self, value): + if self._ConductingEquipment is not None: + filtered = [x for x in self.ConductingEquipment.Terminals if x != self] + self._ConductingEquipment._Terminals = filtered + + self._ConductingEquipment = value + if self._ConductingEquipment is not None: + if self not in self._ConductingEquipment._Terminals: + self._ConductingEquipment._Terminals.append(self) + + ConductingEquipment = property(getConductingEquipment, setConductingEquipment) + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/VoltageLevel.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/VoltageLevel.py new file mode 100755 index 00000000..44e5d28c --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/VoltageLevel.py @@ -0,0 +1,115 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class VoltageLevel(EquipmentContainer): + """A collection of equipment at one common system voltage forming a switchgear. The equipment typically consist of breakers, busbars, instrumentation, control, regulation and protection devices as well as assemblies of all these. + """ + + def __init__(self, lowVoltageLimit=0.0, highVoltageLimit=0.0, Bays=None, BaseVoltage=None, Substation=None, *args, **kw_args): + """Initialises a new 'VoltageLevel' instance. + + @param lowVoltageLimit: The bus bar's low voltage limit + @param highVoltageLimit: The bus bar's high voltage limit + @param Bays: The association is used in the naming hierarchy. + @param BaseVoltage: The base voltage used for all equipment within the VoltageLevel. + @param Substation: The association is used in the naming hierarchy. + """ + #: The bus bar's low voltage limit + self.lowVoltageLimit = lowVoltageLimit + + #: The bus bar's high voltage limit + self.highVoltageLimit = highVoltageLimit + + self._Bays = [] + self.Bays = [] if Bays is None else Bays + + self._BaseVoltage = None + self.BaseVoltage = BaseVoltage + + self._Substation = None + self.Substation = Substation + + super(VoltageLevel, self).__init__(*args, **kw_args) + + _attrs = ["lowVoltageLimit", "highVoltageLimit"] + _attr_types = {"lowVoltageLimit": float, "highVoltageLimit": float} + _defaults = {"lowVoltageLimit": 0.0, "highVoltageLimit": 0.0} + _enums = {} + _refs = ["Bays", "BaseVoltage", "Substation"] + _many_refs = ["Bays"] + + def getBays(self): + """The association is used in the naming hierarchy. + """ + return self._Bays + + def setBays(self, value): + for x in self._Bays: + x.VoltageLevel = None + for y in value: + y._VoltageLevel = self + self._Bays = value + + Bays = property(getBays, setBays) + + def addBays(self, *Bays): + for obj in Bays: + obj.VoltageLevel = self + + def removeBays(self, *Bays): + for obj in Bays: + obj.VoltageLevel = None + + def getBaseVoltage(self): + """The base voltage used for all equipment within the VoltageLevel. + """ + return self._BaseVoltage + + def setBaseVoltage(self, value): + if self._BaseVoltage is not None: + filtered = [x for x in self.BaseVoltage.VoltageLevel if x != self] + self._BaseVoltage._VoltageLevel = filtered + + self._BaseVoltage = value + if self._BaseVoltage is not None: + if self not in self._BaseVoltage._VoltageLevel: + self._BaseVoltage._VoltageLevel.append(self) + + BaseVoltage = property(getBaseVoltage, setBaseVoltage) + + def getSubstation(self): + """The association is used in the naming hierarchy. + """ + return self._Substation + + def setSubstation(self, value): + if self._Substation is not None: + filtered = [x for x in self.Substation.VoltageLevels if x != self] + self._Substation._VoltageLevels = filtered + + self._Substation = value + if self._Substation is not None: + if self not in self._Substation._VoltageLevels: + self._Substation._VoltageLevels.append(self) + + Substation = property(getSubstation, setSubstation) + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Core/__init__.py b/CIM16/CDPSM/Connectivity/IEC61970/Core/__init__.py new file mode 100755 index 00000000..67b1476a --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Core/__init__.py @@ -0,0 +1,50 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""Contains the core PowerSystemResource and ConductingEquipment entities shared by all applications plus common collections of those entities. Not all applications require all the Core entities. This package does not depend on any other package except the Domain package, but most of the other packages have associations and generalizations that depend on it. +""" + +from CIM16.CDPSM.Connectivity.IEC61970.Core.Terminal import Terminal +from CIM16.CDPSM.Connectivity.IEC61970.Core.Bay import Bay +from CIM16.CDPSM.Connectivity.IEC61970.Core.NameTypeAuthority import NameTypeAuthority +from CIM16.CDPSM.Connectivity.IEC61970.Core.VoltageLevel import VoltageLevel +from CIM16.CDPSM.Connectivity.IEC61970.Core.SubGeographicalRegion import SubGeographicalRegion +from CIM16.CDPSM.Connectivity.IEC61970.Core.PSRType import PSRType +from CIM16.CDPSM.Connectivity.IEC61970.Core.EquipmentContainer import EquipmentContainer +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment +from CIM16.CDPSM.Connectivity.IEC61970.Core.GeographicalRegion import GeographicalRegion +from CIM16.CDPSM.Connectivity.IEC61970.Core.NameType import NameType +from CIM16.CDPSM.Connectivity.IEC61970.Core.Equipment import Equipment +from CIM16.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConnectivityNodeContainer import ConnectivityNodeContainer +from CIM16.CDPSM.Connectivity.IEC61970.Core.Substation import Substation +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConnectivityNode import ConnectivityNode +from CIM16.CDPSM.Connectivity.IEC61970.Core.Name import Name +from CIM16.CDPSM.Connectivity.IEC61970.Core.BaseVoltage import BaseVoltage +from CIM16.CDPSM.Connectivity.IEC61970.Core.PowerSystemResource import PowerSystemResource + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Connectivity#Core" +nsPrefix = "cimCore" + + +class PhaseCode(str): + """Values are: s12N, BN, BC, ABN, s2N, N, ACN, BCN, ABCN, AC, s1N, AN, B, AB, C, A, CN, ABC + """ + pass diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/ACLineSegment.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/ACLineSegment.py new file mode 100755 index 00000000..2e23976d --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/ACLineSegment.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Conductor import Conductor + +class ACLineSegment(Conductor): + """A wire or combination of wires, with consistent electrical characteristics, building a single electrical system, used to carry alternating current between points in the power system. For symmetrical, transposed 3ph lines, it is sufficient to use ACLineSegment attributes, which describe sequence impedances and admittances for the entire length of the segment. If per lenght impedance data is available from a library of standard types, impedances and admittances can be calculated in one of the following ways: - calculate electrical parameters from asset data, using associated ConductorInfo, with values then multiplied by Conductor.length to produce a matrix model. - calculate unbalanced electrical parameters from associated PerLengthPhaseImpedance, then multiplied by Conductor.length to produce a matrix model. - calculate transposed electrical parameters from associated PerLengthSequenceImpedance, then multiplied by Conductor.length to produce a sequence model. + """ + + def __init__(self, BaseVoltage=None, *args, **kw_args): + """Initialises a new 'ACLineSegment' instance. + + @param BaseVoltage: Use association to ConductingEquipment only when there is no VoltageLevel container used. + """ + self._BaseVoltage = None + self.BaseVoltage = BaseVoltage + + super(ACLineSegment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["BaseVoltage"] + _many_refs = [] + + def getBaseVoltage(self): + """Use association to ConductingEquipment only when there is no VoltageLevel container used. + """ + return self._BaseVoltage + + def setBaseVoltage(self, value): + if self._BaseVoltage is not None: + filtered = [x for x in self.BaseVoltage.ConductingEquipment if x != self] + self._BaseVoltage._ConductingEquipment = filtered + + self._BaseVoltage = value + if self._BaseVoltage is not None: + if self not in self._BaseVoltage._ConductingEquipment: + self._BaseVoltage._ConductingEquipment.append(self) + + BaseVoltage = property(getBaseVoltage, setBaseVoltage) + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/Breaker.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Breaker.py new file mode 100755 index 00000000..73950453 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Breaker.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch + +class Breaker(Switch): + """A mechanical switching device capable of making, carrying, and breaking currents under normal circuit conditions and also making, carrying for a specified time, and breaking currents under specified abnormal circuit conditions e.g. those of short circuit. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Breaker' instance. + + """ + super(Breaker, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/BusbarSection.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/BusbarSection.py new file mode 100755 index 00000000..2c4f4b5c --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/BusbarSection.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class BusbarSection(ConductingEquipment): + """A conductor, or group of conductors, with negligible impedance, that serve to connect other conducting equipment within a single substation. Voltage measurements are typically obtained from VoltageTransformers that are connected to busbar sections. A bus bar section may have many physical terminals but for analysis is modelled with exactly one logical terminal. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'BusbarSection' instance. + + """ + super(BusbarSection, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/Conductor.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Conductor.py new file mode 100755 index 00000000..a29a3a9a --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Conductor.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Conductor(ConductingEquipment): + """Combination of conducting material with consistent electrical characteristics, building a single electrical system, used to carry current between points in the power system. + """ + + def __init__(self, length=0.0, *args, **kw_args): + """Initialises a new 'Conductor' instance. + + @param length: Segment length for calculating line section capabilities + """ + #: Segment length for calculating line section capabilities + self.length = length + + super(Conductor, self).__init__(*args, **kw_args) + + _attrs = ["length"] + _attr_types = {"length": float} + _defaults = {"length": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/DCLineSegment.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/DCLineSegment.py new file mode 100755 index 00000000..2d6e878c --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/DCLineSegment.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Conductor import Conductor + +class DCLineSegment(Conductor): + """A wire or combination of wires not insulated from one another, with consistent electrical characteristics, used to carry direct current between points in the DC region of the power system. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'DCLineSegment' instance. + + """ + super(DCLineSegment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/Disconnector.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Disconnector.py new file mode 100755 index 00000000..57481c86 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Disconnector.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch + +class Disconnector(Switch): + """A manually operated or motor operated mechanical switching device used for changing the connections in a circuit, or for isolating a circuit or equipment from a source of power. It is required to open or close circuits when negligible current is broken or made. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Disconnector' instance. + + """ + super(Disconnector, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/EnergyConsumer.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/EnergyConsumer.py new file mode 100755 index 00000000..04318024 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/EnergyConsumer.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class EnergyConsumer(ConductingEquipment): + """Generic user of energy - a point of consumption on the power system model + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'EnergyConsumer' instance. + + """ + super(EnergyConsumer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/EnergySource.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/EnergySource.py new file mode 100755 index 00000000..3350b5c3 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/EnergySource.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class EnergySource(ConductingEquipment): + """A generic equivalent for an energy supplier on a transmission or distribution voltage level. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'EnergySource' instance. + + """ + super(EnergySource, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/Fuse.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Fuse.py new file mode 100755 index 00000000..f354cbb3 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Fuse.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch + +class Fuse(Switch): + """An overcurrent protective device with a circuit opening fusible part that is heated and severed by the passage of overcurrent through it. A fuse is considered a switching device because it breaks current. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Fuse' instance. + + """ + super(Fuse, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/Ground.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Ground.py new file mode 100755 index 00000000..bd677b5a --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Ground.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Ground(ConductingEquipment): + """A common point for connecting grounded conducting equipment such as shunt capacitors. The power system model can have more than one ground. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Ground' instance. + + """ + super(Ground, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/GroundDisconnector.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/GroundDisconnector.py new file mode 100755 index 00000000..33329fa8 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/GroundDisconnector.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch + +class GroundDisconnector(Switch): + """A manually operated or motor operated mechanical switching device used for isolating a circuit or equipment from Ground. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'GroundDisconnector' instance. + + """ + super(GroundDisconnector, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/Jumper.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Jumper.py new file mode 100755 index 00000000..5c3b4a3e --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Jumper.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch + +class Jumper(Switch): + """A short section of conductor with negligible impedance which can be manually removed and replaced if the circuit is de-energized. Note that zero-impedance branches can be modelled by an ACLineSegment with a zero impedance ConductorType + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Jumper' instance. + + """ + super(Jumper, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/Junction.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Junction.py new file mode 100755 index 00000000..be8e077f --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Junction.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Junction(ConductingEquipment): + """A point where one or more conducting equipments are connected with zero resistance. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Junction' instance. + + """ + super(Junction, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/Line.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Line.py new file mode 100755 index 00000000..73c5b253 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Line.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class Line(EquipmentContainer): + """Contains equipment beyond a substation belonging to a power transmission line. + """ + + def __init__(self, Region=None, *args, **kw_args): + """Initialises a new 'Line' instance. + + @param Region: A Line can be contained by a SubGeographical Region. + """ + self._Region = None + self.Region = Region + + super(Line, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Region"] + _many_refs = [] + + def getRegion(self): + """A Line can be contained by a SubGeographical Region. + """ + return self._Region + + def setRegion(self, value): + if self._Region is not None: + filtered = [x for x in self.Region.Lines if x != self] + self._Region._Lines = filtered + + self._Region = value + if self._Region is not None: + if self not in self._Region._Lines: + self._Region._Lines.append(self) + + Region = property(getRegion, setRegion) + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/LoadBreakSwitch.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/LoadBreakSwitch.py new file mode 100755 index 00000000..6eb94597 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/LoadBreakSwitch.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch + +class LoadBreakSwitch(Switch): + """A mechanical switching device capable of making, carrying, and breaking currents under normal operating conditions. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'LoadBreakSwitch' instance. + + """ + super(LoadBreakSwitch, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/PowerTransformer.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/PowerTransformer.py new file mode 100755 index 00000000..a56f6a4c --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/PowerTransformer.py @@ -0,0 +1,91 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class PowerTransformer(ConductingEquipment): + """An electrical device consisting of two or more coupled windings, with or without a magnetic core, for introducing mutual coupling between electric circuits. Transformers can be used to control voltage and phase shift (active power flow). A power transformer may be composed of separate transformer tanks that need not be identical. The same power transformer can be modelled in two ways, namely with and without tanks:
  1. The power transformer that uses power transformer ends directly (without tanks) is suitable for balanced three-phase models. This is typical for transmission and sub-transmission network modelling. Such a transformer will require one power transformer end for each physical winding. There must be a one-to-one association between PowerTransformerEnd and Core::Terminal.
  2. The power transformer that uses transformer tanks is suitable for an unbalanced transformer, a balanced transformer within a single tank, or a balanced transformer made up of three tanks. This is typical for distribution network modelling and the only choice when modelling an unbalanced transformer, or a transformer that has more than three windings. Power transformer modelled with tanks will require for each tank, one transformer tank end per physical winding in the tank. There may be one, two, or three phases in the transformer tank end. Examples: 3 phases for 3-phase delta or wye connected windings, 2 for one phase-to-phase winding, and 1 for a phase-to-neutral or phase-to-ground winding. With 1 or 2 phases, more than one transformer tank end may be associated to the same 3-phase Core::Terminal instance, while with 3 phases there should be a one-to-one association.
This power transformer model is flexible in order to support different kinds of data exchange requirements. There are 5 possible ways to combine available classes and their attributes:
  1. Instance parameters - Use the r, x, r0, x0, b, b0, g, and g0 attributes on PowerTransformerEnd and ignore related TransformerStarImpedance, TransformerMeshImpedance, or TransformerCoreAdmittance. This option assumes a star connection of the series impedances. It is suitable for typical transmission, balanced three-phase transformer models, for transformers with 2 or three windings.
  2. Star instance parameters by association - Instead of the r, x, r0, x0, b, b0, g, and g0 attributes, use associations to TransformerStarImpedance and TransformerCoreAdmitance. This option is suitable in same scenarios as option 1, but when catalogue data is available for transformers.
  3. Mesh instance parameters by association: Instead of the r, x, r0, x0, b, b0, g, and g0 attributes, use associations to TransformerMeshImpedance and TransformerCoreAdmittance. This option supports transformers with more than three windings.
  4. Catalog mesh parameters by association - Instead of attributes r, x, r0, x0, b, b0, g, and g0 and associations to TransformerStarImpedance, TransformerMeshImpedance, or TransformerCoreAdmittance, use the association to TransformerEndInfo. The TransformerEnd.endNumber should match the corresponding TransformerEndInfo.endNumber, following the IEC standard convention of numbering from the highest voltage ends to the lowest, starting at 1. This matching supports higher-level use of a catalog, through just one association between TransformerTank and TransformerTankInfo, with simpler exchanges and incremental updates. The associated TransformerEndInfo will have associations to TransformerMeshImpedance and TransformerCoreAdmittance. This option supports unbalanced transformer, with more than three windings and is suitable whenever the transformer test data has been converted to an electrical model.
  5. Catalog test data by association - This is the same as option 4, except TransformerEndInfo will have associations to AssetModels::TransformerTest decendents, instead of to TransformerMeshImpedance and TransformerCoreAdmittance. This option is suitable when the test data is available, and the receiving application is able to interpret the test data.
Every profile should specify which one or more of these options are supported. + """ + + def __init__(self, TransformerTanks=None, PowerTransformerEnd=None, *args, **kw_args): + """Initialises a new 'PowerTransformer' instance. + + @param TransformerTanks: All transformers that belong to this bank. + @param PowerTransformerEnd: + """ + self._TransformerTanks = [] + self.TransformerTanks = [] if TransformerTanks is None else TransformerTanks + + self._PowerTransformerEnd = [] + self.PowerTransformerEnd = [] if PowerTransformerEnd is None else PowerTransformerEnd + + super(PowerTransformer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TransformerTanks", "PowerTransformerEnd"] + _many_refs = ["TransformerTanks", "PowerTransformerEnd"] + + def getTransformerTanks(self): + """All transformers that belong to this bank. + """ + return self._TransformerTanks + + def setTransformerTanks(self, value): + for x in self._TransformerTanks: + x.PowerTransformer = None + for y in value: + y._PowerTransformer = self + self._TransformerTanks = value + + TransformerTanks = property(getTransformerTanks, setTransformerTanks) + + def addTransformerTanks(self, *TransformerTanks): + for obj in TransformerTanks: + obj.PowerTransformer = self + + def removeTransformerTanks(self, *TransformerTanks): + for obj in TransformerTanks: + obj.PowerTransformer = None + + def getPowerTransformerEnd(self): + """ + """ + return self._PowerTransformerEnd + + def setPowerTransformerEnd(self, value): + for x in self._PowerTransformerEnd: + x.PowerTransformer = None + for y in value: + y._PowerTransformer = self + self._PowerTransformerEnd = value + + PowerTransformerEnd = property(getPowerTransformerEnd, setPowerTransformerEnd) + + def addPowerTransformerEnd(self, *PowerTransformerEnd): + for obj in PowerTransformerEnd: + obj.PowerTransformer = self + + def removePowerTransformerEnd(self, *PowerTransformerEnd): + for obj in PowerTransformerEnd: + obj.PowerTransformer = None + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/PowerTransformerEnd.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/PowerTransformerEnd.py new file mode 100755 index 00000000..9b0635ef --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/PowerTransformerEnd.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Wires.TransformerEnd import TransformerEnd + +class PowerTransformerEnd(TransformerEnd): + """A PowerTransformerEnd is associated with each Terminal of a PowerTransformer. The impdedance values r, r0, x, and x0 of a PowerTransformerEnd represents a star equivalentas follows 1) for a two Terminal PowerTransformer the high voltage PowerTransformerEnd has non zero values on r, r0, x, and x0 while the low voltage PowerTransformerEnd has zero values for r, r0, x, and x0. 2) for a three Terminal PowerTransformer the three PowerTransformerEnds represents a star equivalent with each leg in the star represented by r, r0, x, and x0 values. 3) for a PowerTransformer with more than three Terminals the PowerTransformerEnd impedance values cannot be used. Instead use the TransformerMeshImpedance or split the transformer into multiple PowerTransformers. + """ + + def __init__(self, PowerTransformer=None, *args, **kw_args): + """Initialises a new 'PowerTransformerEnd' instance. + + @param PowerTransformer: + """ + self._PowerTransformer = None + self.PowerTransformer = PowerTransformer + + super(PowerTransformerEnd, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["PowerTransformer"] + _many_refs = [] + + def getPowerTransformer(self): + + return self._PowerTransformer + + def setPowerTransformer(self, value): + if self._PowerTransformer is not None: + filtered = [x for x in self.PowerTransformer.PowerTransformerEnd if x != self] + self._PowerTransformer._PowerTransformerEnd = filtered + + self._PowerTransformer = value + if self._PowerTransformer is not None: + if self not in self._PowerTransformer._PowerTransformerEnd: + self._PowerTransformer._PowerTransformerEnd.append(self) + + PowerTransformer = property(getPowerTransformer, setPowerTransformer) + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/Sectionaliser.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Sectionaliser.py new file mode 100755 index 00000000..08319a38 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Sectionaliser.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch + +class Sectionaliser(Switch): + """Automatic switch that will lock open to isolate a faulted section. It may, or may not, have load breaking capability. Its primary purpose is to provide fault sectionalising at locations where the fault current is either too high, or too low, for proper coordination of fuses. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Sectionaliser' instance. + + """ + super(Sectionaliser, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/SeriesCompensator.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/SeriesCompensator.py new file mode 100755 index 00000000..19eff3c3 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/SeriesCompensator.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class SeriesCompensator(ConductingEquipment): + """A Series Compensator is a series capacitor or reactor or an AC transmission line without charging susceptance. It is a two terminal device. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'SeriesCompensator' instance. + + """ + super(SeriesCompensator, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/ShuntCompensator.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/ShuntCompensator.py new file mode 100755 index 00000000..995178ec --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/ShuntCompensator.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class ShuntCompensator(ConductingEquipment): + """A shunt capacitor or reactor or switchable bank of shunt capacitors or reactors. A section of a shunt compensator is an individual capacitor or reactor. A negative value for reactivePerSection indicates that the compensator is a reactor. ShuntCompensator is a single terminal device. Ground is implied. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'ShuntCompensator' instance. + + """ + super(ShuntCompensator, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/Switch.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Switch.py new file mode 100755 index 00000000..ba738f7e --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/Switch.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Switch(ConductingEquipment): + """A generic device designed to close, or open, or both, one or more electric circuits. + """ + + def __init__(self, normalOpen=False, *args, **kw_args): + """Initialises a new 'Switch' instance. + + @param normalOpen: The attribute is used in cases when no Measurement for the status value is present. If the Switch has a status measurment the Discrete.normalValue is expected to match with the Switch.normalOpen. + """ + #: The attribute is used in cases when no Measurement for the status value is present. If the Switch has a status measurment the Discrete.normalValue is expected to match with the Switch.normalOpen. + self.normalOpen = normalOpen + + super(Switch, self).__init__(*args, **kw_args) + + _attrs = ["normalOpen"] + _attr_types = {"normalOpen": bool} + _defaults = {"normalOpen": False} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/SynchronousMachine.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/SynchronousMachine.py new file mode 100755 index 00000000..3b350d70 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/SynchronousMachine.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class SynchronousMachine(ConductingEquipment): + """An electromechanical device that operates synchronously with the network. It is a single machine operating either as a generator or synchronous condenser or pump. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'SynchronousMachine' instance. + + """ + super(SynchronousMachine, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/TransformerEnd.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/TransformerEnd.py new file mode 100755 index 00000000..ffe3cb17 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/TransformerEnd.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerEnd(IdentifiedObject): + """TransformerEnd is a conducting connection point of a power transformer. It corresponds to a physical transformer winding terminal. In earlier CIM versions, the TransformerWinding class served a similar purpose. This successor TransformerEnd class is more flexible and has important differences with TransformerWinding. + """ + + def __init__(self, Terminal=None, *args, **kw_args): + """Initialises a new 'TransformerEnd' instance. + + @param Terminal: External terminal of the power transformer to which this end belongs. + """ + self._Terminal = None + self.Terminal = Terminal + + super(TransformerEnd, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Terminal"] + _many_refs = [] + + def getTerminal(self): + """External terminal of the power transformer to which this end belongs. + """ + return self._Terminal + + def setTerminal(self, value): + if self._Terminal is not None: + filtered = [x for x in self.Terminal.TransformerEnd if x != self] + self._Terminal._TransformerEnd = filtered + + self._Terminal = value + if self._Terminal is not None: + if self not in self._Terminal._TransformerEnd: + self._Terminal._TransformerEnd.append(self) + + Terminal = property(getTerminal, setTerminal) + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/TransformerTank.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/TransformerTank.py new file mode 100755 index 00000000..cb82b7ae --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/TransformerTank.py @@ -0,0 +1,86 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.Equipment import Equipment + +class TransformerTank(Equipment): + """An assembly of two or more coupled windings that transform electrical power between voltage levels. These windings are bound on a common core and place in the same tank. Transformer tank can be used to model both single-phase and 3-phase transformers. + """ + + def __init__(self, PowerTransformer=None, TransformerTankEnds=None, *args, **kw_args): + """Initialises a new 'TransformerTank' instance. + + @param PowerTransformer: Bank this transformer belongs to. + @param TransformerTankEnds: All windings of this transformer. + """ + self._PowerTransformer = None + self.PowerTransformer = PowerTransformer + + self._TransformerTankEnds = [] + self.TransformerTankEnds = [] if TransformerTankEnds is None else TransformerTankEnds + + super(TransformerTank, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["PowerTransformer", "TransformerTankEnds"] + _many_refs = ["TransformerTankEnds"] + + def getPowerTransformer(self): + """Bank this transformer belongs to. + """ + return self._PowerTransformer + + def setPowerTransformer(self, value): + if self._PowerTransformer is not None: + filtered = [x for x in self.PowerTransformer.TransformerTanks if x != self] + self._PowerTransformer._TransformerTanks = filtered + + self._PowerTransformer = value + if self._PowerTransformer is not None: + if self not in self._PowerTransformer._TransformerTanks: + self._PowerTransformer._TransformerTanks.append(self) + + PowerTransformer = property(getPowerTransformer, setPowerTransformer) + + def getTransformerTankEnds(self): + """All windings of this transformer. + """ + return self._TransformerTankEnds + + def setTransformerTankEnds(self, value): + for x in self._TransformerTankEnds: + x.TransformerTank = None + for y in value: + y._TransformerTank = self + self._TransformerTankEnds = value + + TransformerTankEnds = property(getTransformerTankEnds, setTransformerTankEnds) + + def addTransformerTankEnds(self, *TransformerTankEnds): + for obj in TransformerTankEnds: + obj.TransformerTank = self + + def removeTransformerTankEnds(self, *TransformerTankEnds): + for obj in TransformerTankEnds: + obj.TransformerTank = None + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/TransformerTankEnd.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/TransformerTankEnd.py new file mode 100755 index 00000000..03a09d8a --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/TransformerTankEnd.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Wires.TransformerEnd import TransformerEnd + +class TransformerTankEnd(TransformerEnd): + """Transformer tank end represents an individual winding for unbalanced models or for transformer tanks connected into a bank (and bank is modelled with the PowerTransformer). + """ + + def __init__(self, phases="s12N", TransformerTank=None, *args, **kw_args): + """Initialises a new 'TransformerTankEnd' instance. + + @param phases: Describes the phases carried by a conducting equipment. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param TransformerTank: Transformer this winding belongs to. + """ + #: Describes the phases carried by a conducting equipment. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.phases = phases + + self._TransformerTank = None + self.TransformerTank = TransformerTank + + super(TransformerTankEnd, self).__init__(*args, **kw_args) + + _attrs = ["phases"] + _attr_types = {"phases": str} + _defaults = {"phases": "s12N"} + _enums = {"phases": "PhaseCode"} + _refs = ["TransformerTank"] + _many_refs = [] + + def getTransformerTank(self): + """Transformer this winding belongs to. + """ + return self._TransformerTank + + def setTransformerTank(self, value): + if self._TransformerTank is not None: + filtered = [x for x in self.TransformerTank.TransformerTankEnds if x != self] + self._TransformerTank._TransformerTankEnds = filtered + + self._TransformerTank = value + if self._TransformerTank is not None: + if self not in self._TransformerTank._TransformerTankEnds: + self._TransformerTank._TransformerTankEnds.append(self) + + TransformerTank = property(getTransformerTank, setTransformerTank) + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/Wires/__init__.py b/CIM16/CDPSM/Connectivity/IEC61970/Wires/__init__.py new file mode 100755 index 00000000..5fb572e7 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/Wires/__init__.py @@ -0,0 +1,52 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""An extension to the Core and Topology package that models information on the electrical characteristics of Transmission and Distribution networks. This package is used by network applications such as State Estimation, Load Flow and Optimal Power Flow. +""" + +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Fuse import Fuse +from CIM16.CDPSM.Connectivity.IEC61970.Wires.EnergyConsumer import EnergyConsumer +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Disconnector import Disconnector +from CIM16.CDPSM.Connectivity.IEC61970.Wires.ACLineSegment import ACLineSegment +from CIM16.CDPSM.Connectivity.IEC61970.Wires.SynchronousMachine import SynchronousMachine +from CIM16.CDPSM.Connectivity.IEC61970.Wires.BusbarSection import BusbarSection +from CIM16.CDPSM.Connectivity.IEC61970.Wires.LoadBreakSwitch import LoadBreakSwitch +from CIM16.CDPSM.Connectivity.IEC61970.Wires.TransformerTank import TransformerTank +from CIM16.CDPSM.Connectivity.IEC61970.Wires.GroundDisconnector import GroundDisconnector +from CIM16.CDPSM.Connectivity.IEC61970.Wires.PowerTransformerEnd import PowerTransformerEnd +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Junction import Junction +from CIM16.CDPSM.Connectivity.IEC61970.Wires.SeriesCompensator import SeriesCompensator +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Breaker import Breaker +from CIM16.CDPSM.Connectivity.IEC61970.Wires.TransformerTankEnd import TransformerTankEnd +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Sectionaliser import Sectionaliser +from CIM16.CDPSM.Connectivity.IEC61970.Wires.DCLineSegment import DCLineSegment +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Line import Line +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Conductor import Conductor +from CIM16.CDPSM.Connectivity.IEC61970.Wires.PowerTransformer import PowerTransformer +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Ground import Ground +from CIM16.CDPSM.Connectivity.IEC61970.Wires.TransformerEnd import TransformerEnd +from CIM16.CDPSM.Connectivity.IEC61970.Wires.ShuntCompensator import ShuntCompensator +from CIM16.CDPSM.Connectivity.IEC61970.Wires.EnergySource import EnergySource +from CIM16.CDPSM.Connectivity.IEC61970.Wires.Jumper import Jumper + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Connectivity#Wires" +nsPrefix = "cimWires" + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/WiresPhaseModel/ShuntCompensatorPhase.py b/CIM16/CDPSM/Connectivity/IEC61970/WiresPhaseModel/ShuntCompensatorPhase.py new file mode 100755 index 00000000..eefc990b --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/WiresPhaseModel/ShuntCompensatorPhase.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class ShuntCompensatorPhase(PowerSystemResource): + """Single phase of a multi-phase shunt compensator when its attributes might be different per phase. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'ShuntCompensatorPhase' instance. + + """ + super(ShuntCompensatorPhase, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/WiresPhaseModel/SwitchPhase.py b/CIM16/CDPSM/Connectivity/IEC61970/WiresPhaseModel/SwitchPhase.py new file mode 100755 index 00000000..e22c5057 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/WiresPhaseModel/SwitchPhase.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Connectivity.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class SwitchPhase(PowerSystemResource): + """Single phase of a multi-phase switch when its attributes might be different per phase. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'SwitchPhase' instance. + + """ + super(SwitchPhase, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Connectivity/IEC61970/WiresPhaseModel/__init__.py b/CIM16/CDPSM/Connectivity/IEC61970/WiresPhaseModel/__init__.py new file mode 100755 index 00000000..c2902c27 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/WiresPhaseModel/__init__.py @@ -0,0 +1,32 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +from CIM16.CDPSM.Connectivity.IEC61970.WiresPhaseModel.ShuntCompensatorPhase import ShuntCompensatorPhase +from CIM16.CDPSM.Connectivity.IEC61970.WiresPhaseModel.SwitchPhase import SwitchPhase + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Connectivity#WiresPhaseModel" +nsPrefix = "cimWiresPhaseModel" + + +class SinglePhaseKind(str): + """Values are: C, N, s1, B, s2, A + """ + pass diff --git a/CIM16/CDPSM/Connectivity/IEC61970/__init__.py b/CIM16/CDPSM/Connectivity/IEC61970/__init__.py new file mode 100755 index 00000000..66bcc935 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/IEC61970/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The ControlArea package models area specifications which can be used for a variety of purposes. The package as a whole models potentially overlapping control area specifications for the purpose of actual generation control, load forecast area load capture, or powerflow based analysis. +""" + + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Connectivity#IEC61970" +nsPrefix = "cimIEC61970" + diff --git a/CIM16/CDPSM/Connectivity/__init__.py b/CIM16/CDPSM/Connectivity/__init__.py new file mode 100755 index 00000000..79dc5dc4 --- /dev/null +++ b/CIM16/CDPSM/Connectivity/__init__.py @@ -0,0 +1,114 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The IEC 61968 subpackages of the CIM are developed, standardized and maintained by IEC TC57 Working Group 14: interfaces for distribution management (WG14). Currently, normative parts of the model support the needs of information exchange defined in IEC 61968-9 and in IEC 61968-13. +""" + +from CIM16.CDPSM.Connectivity.Element import Element + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Connectivity" +nsPrefix = "conn" + +packageMap = { + "Element": "CIM16.CDPSM.Connectivity", + "Fuse": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "EnergyConsumer": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "Switch": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "Disconnector": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "ACLineSegment": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "SynchronousMachine": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "BusbarSection": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "LoadBreakSwitch": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "TransformerTank": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "GroundDisconnector": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "PowerTransformerEnd": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "Junction": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "SeriesCompensator": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "Breaker": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "TransformerTankEnd": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "Sectionaliser": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "DCLineSegment": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "Line": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "Conductor": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "PowerTransformer": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "Ground": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "TransformerEnd": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "ShuntCompensator": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "EnergySource": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "Jumper": "CIM16.CDPSM.Connectivity.IEC61970.Wires", + "ShuntCompensatorPhase": "CIM16.CDPSM.Connectivity.IEC61970.WiresPhaseModel", + "SwitchPhase": "CIM16.CDPSM.Connectivity.IEC61970.WiresPhaseModel", + "Terminal": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "Bay": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "NameTypeAuthority": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "VoltageLevel": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "SubGeographicalRegion": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "PSRType": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "EquipmentContainer": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "ConductingEquipment": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "GeographicalRegion": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "NameType": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "Equipment": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "IdentifiedObject": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "ConnectivityNodeContainer": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "Substation": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "ConnectivityNode": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "Name": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "BaseVoltage": "CIM16.CDPSM.Connectivity.IEC61970.Core", + "PowerSystemResource": "CIM16.CDPSM.Connectivity.IEC61970.Core", +} + + +class Length(float): + """Unit of length. + """ + pass + +class Voltage(float): + """Electrical voltage. + """ + pass + +class CIMTime(str): + pass + +class CIMDateTime(str): + pass + +class CIMDuration(str): + pass + +class CIMGYear(str): + pass + +class CIMDate(str): + pass + +class CIMGMonthDay(str): + pass + +class CIMGMonth(str): + pass + +class CIMGDay(str): + pass + +class CIMGYearMonth(str): + pass diff --git a/CIM16/CDPSM/Geographical/Element.py b/CIM16/CDPSM/Geographical/Element.py new file mode 100755 index 00000000..fddaa815 --- /dev/null +++ b/CIM16/CDPSM/Geographical/Element.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class Element(object): + + def __init__(self, UUID=''): + """Initialises a new 'Element' instance. + + @param UUID: + """ + + self.UUID = UUID + + + _attrs = ["UUID"] + _attr_types = {"UUID": str} + _defaults = {"UUID": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61968/Common/CoordinateSystem.py b/CIM16/CDPSM/Geographical/IEC61968/Common/CoordinateSystem.py new file mode 100755 index 00000000..d5a02d6e --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61968/Common/CoordinateSystem.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class CoordinateSystem(IdentifiedObject): + """Coordinate reference system. + """ + + def __init__(self, crsUrn='', Location=None, *args, **kw_args): + """Initialises a new 'CoordinateSystem' instance. + + @param crsUrn: A Uniform Resource Name (URN) for the coordinate reference system (crs) used to define 'Location.PositionPoints'. An example would be the European Petroleum Survey Group (EPSG) code for a coordinate reference system, defined in URN under the Open Geospatial Consortium (OGC) namespace as: urn:ogc :def:uom:EPSG::XXXX, where XXXX is an EPSG code (a full list of codes can be found at the EPSG Registry website http://www.epsg-registry.org/). To define the coordinate system as being WGS84 (latitude, longitude) using an EPSG OGC, this attribute would be urn:ogc:def:uom:EPSG::4236. A profile should limit this code to a set of allowed URNs agreed to by all sending and receiving parties. + @param Location: All locations described with position points in this coordinate system. + """ + #: A Uniform Resource Name (URN) for the coordinate reference system (crs) used to define 'Location.PositionPoints'. An example would be the European Petroleum Survey Group (EPSG) code for a coordinate reference system, defined in URN under the Open Geospatial Consortium (OGC) namespace as: urn:ogc :def:uom:EPSG::XXXX, where XXXX is an EPSG code (a full list of codes can be found at the EPSG Registry website http://www.epsg-registry.org/). To define the coordinate system as being WGS84 (latitude, longitude) using an EPSG OGC, this attribute would be urn:ogc:def:uom:EPSG::4236. A profile should limit this code to a set of allowed URNs agreed to by all sending and receiving parties. + self.crsUrn = crsUrn + + self._Location = [] + self.Location = [] if Location is None else Location + + super(CoordinateSystem, self).__init__(*args, **kw_args) + + _attrs = ["crsUrn"] + _attr_types = {"crsUrn": str} + _defaults = {"crsUrn": ''} + _enums = {} + _refs = ["Location"] + _many_refs = ["Location"] + + def getLocation(self): + """All locations described with position points in this coordinate system. + """ + return self._Location + + def setLocation(self, value): + for x in self._Location: + x.CoordinateSystem = None + for y in value: + y._CoordinateSystem = self + self._Location = value + + Location = property(getLocation, setLocation) + + def addLocation(self, *Location): + for obj in Location: + obj.CoordinateSystem = self + + def removeLocation(self, *Location): + for obj in Location: + obj.CoordinateSystem = None + diff --git a/CIM16/CDPSM/Geographical/IEC61968/Common/Location.py b/CIM16/CDPSM/Geographical/IEC61968/Common/Location.py new file mode 100755 index 00000000..0da744a9 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61968/Common/Location.py @@ -0,0 +1,112 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Location(IdentifiedObject): + """The place, scene, or point of something where someone or something has been, is, and/or will be at a given moment in time. It can be defined with one or more postition points (coordinates) in a given coordinate system. + """ + + def __init__(self, PowerSystemResources=None, PositionPoints=None, CoordinateSystem=None, *args, **kw_args): + """Initialises a new 'Location' instance. + + @param PowerSystemResources: All power system resources at this location. + @param PositionPoints: Sequence of position points describing this location, expressed in coordinate system 'Location.CoordinateSystem'. + @param CoordinateSystem: Coordinate system used to describe position points of this location. + """ + self._PowerSystemResources = [] + self.PowerSystemResources = [] if PowerSystemResources is None else PowerSystemResources + + self._PositionPoints = [] + self.PositionPoints = [] if PositionPoints is None else PositionPoints + + self._CoordinateSystem = None + self.CoordinateSystem = CoordinateSystem + + super(Location, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["PowerSystemResources", "PositionPoints", "CoordinateSystem"] + _many_refs = ["PowerSystemResources", "PositionPoints"] + + def getPowerSystemResources(self): + """All power system resources at this location. + """ + return self._PowerSystemResources + + def setPowerSystemResources(self, value): + for x in self._PowerSystemResources: + x.Location = None + for y in value: + y._Location = self + self._PowerSystemResources = value + + PowerSystemResources = property(getPowerSystemResources, setPowerSystemResources) + + def addPowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + obj.Location = self + + def removePowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + obj.Location = None + + def getPositionPoints(self): + """Sequence of position points describing this location, expressed in coordinate system 'Location.CoordinateSystem'. + """ + return self._PositionPoints + + def setPositionPoints(self, value): + for x in self._PositionPoints: + x.Location = None + for y in value: + y._Location = self + self._PositionPoints = value + + PositionPoints = property(getPositionPoints, setPositionPoints) + + def addPositionPoints(self, *PositionPoints): + for obj in PositionPoints: + obj.Location = self + + def removePositionPoints(self, *PositionPoints): + for obj in PositionPoints: + obj.Location = None + + def getCoordinateSystem(self): + """Coordinate system used to describe position points of this location. + """ + return self._CoordinateSystem + + def setCoordinateSystem(self, value): + if self._CoordinateSystem is not None: + filtered = [x for x in self.CoordinateSystem.Location if x != self] + self._CoordinateSystem._Location = filtered + + self._CoordinateSystem = value + if self._CoordinateSystem is not None: + if self not in self._CoordinateSystem._Location: + self._CoordinateSystem._Location.append(self) + + CoordinateSystem = property(getCoordinateSystem, setCoordinateSystem) + diff --git a/CIM16/CDPSM/Geographical/IEC61968/Common/PositionPoint.py b/CIM16/CDPSM/Geographical/IEC61968/Common/PositionPoint.py new file mode 100755 index 00000000..714b0531 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61968/Common/PositionPoint.py @@ -0,0 +1,76 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.Element import Element + +class PositionPoint(Element): + """Set of spatial coordinates that determine a point, defined in coordinate system specified in 'Location.CoordinateSystem'. Use a single position point instance to desribe a point-oriented location. Use a sequence of position points to describe a line-oriented object (physical location of non-point oriented objects like cables or lines), or area of an object (like a substation or a geographical zone - in this case, have first and last position point with the same values). + """ + + def __init__(self, xPosition='', zPosition='', sequenceNumber=0, yPosition='', Location=None, *args, **kw_args): + """Initialises a new 'PositionPoint' instance. + + @param xPosition: X axis position. + @param zPosition: (if applicable) Z axis position. + @param sequenceNumber: Zero-relative sequence number of this point within a series of points. + @param yPosition: Y axis position. + @param Location: Location described by this position point. + """ + #: X axis position. + self.xPosition = xPosition + + #: (if applicable) Z axis position. + self.zPosition = zPosition + + #: Zero-relative sequence number of this point within a series of points. + self.sequenceNumber = sequenceNumber + + #: Y axis position. + self.yPosition = yPosition + + self._Location = None + self.Location = Location + + super(PositionPoint, self).__init__(*args, **kw_args) + + _attrs = ["xPosition", "zPosition", "sequenceNumber", "yPosition"] + _attr_types = {"xPosition": str, "zPosition": str, "sequenceNumber": int, "yPosition": str} + _defaults = {"xPosition": '', "zPosition": '', "sequenceNumber": 0, "yPosition": ''} + _enums = {} + _refs = ["Location"] + _many_refs = [] + + def getLocation(self): + """Location described by this position point. + """ + return self._Location + + def setLocation(self, value): + if self._Location is not None: + filtered = [x for x in self.Location.PositionPoints if x != self] + self._Location._PositionPoints = filtered + + self._Location = value + if self._Location is not None: + if self not in self._Location._PositionPoints: + self._Location._PositionPoints.append(self) + + Location = property(getLocation, setLocation) + diff --git a/CIM16/CDPSM/Geographical/IEC61968/Common/__init__.py b/CIM16/CDPSM/Geographical/IEC61968/Common/__init__.py new file mode 100755 index 00000000..0165fdc5 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61968/Common/__init__.py @@ -0,0 +1,30 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package contains the information classes that support distribution management in general. +""" + +from CIM16.CDPSM.Geographical.IEC61968.Common.Location import Location +from CIM16.CDPSM.Geographical.IEC61968.Common.CoordinateSystem import CoordinateSystem +from CIM16.CDPSM.Geographical.IEC61968.Common.PositionPoint import PositionPoint + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Geographical#Common" +nsPrefix = "cimCommon" + diff --git a/CIM16/CDPSM/Geographical/IEC61968/__init__.py b/CIM16/CDPSM/Geographical/IEC61968/__init__.py new file mode 100755 index 00000000..bbf12394 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61968/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package is an extension of the Metering package and contains the information classes that support specialised applications such as prepayment metering. These classes are generally associated with the collection and control of revenue from the customer for a delivered service. +""" + + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Geographical#IEC61968" +nsPrefix = "cimIEC61968" + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Core/ConductingEquipment.py b/CIM16/CDPSM/Geographical/IEC61970/Core/ConductingEquipment.py new file mode 100755 index 00000000..ff271903 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Core/ConductingEquipment.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.Equipment import Equipment + +class ConductingEquipment(Equipment): + """The parts of the power system that are designed to carry current or that are conductively connected therewith. ConductingEquipment is contained within an EquipmentContainer that may be a Substation, or a VoltageLevel or a Bay within a Substation. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'ConductingEquipment' instance. + + """ + super(ConductingEquipment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Core/Equipment.py b/CIM16/CDPSM/Geographical/IEC61970/Core/Equipment.py new file mode 100755 index 00000000..f86bda9b --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Core/Equipment.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class Equipment(PowerSystemResource): + """The parts of a power system that are physical devices, electronic or mechanical + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Equipment' instance. + + """ + super(Equipment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Core/IdentifiedObject.py b/CIM16/CDPSM/Geographical/IEC61970/Core/IdentifiedObject.py new file mode 100755 index 00000000..8bb5c330 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Core/IdentifiedObject.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.Element import Element + +class IdentifiedObject(Element): + """This is a root class to provide common identification for all classes needing identification and naming attributes + """ + + def __init__(self, aliasName='', name='', Names=None, *args, **kw_args): + """Initialises a new 'IdentifiedObject' instance. + + @param aliasName: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + @param name: The name is any free human readable and possibly non unique text naming the object. + @param Names: All names of this identified object. + """ + #: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + self.aliasName = aliasName + + #: The name is any free human readable and possibly non unique text naming the object. + self.name = name + + self._Names = [] + self.Names = [] if Names is None else Names + + super(IdentifiedObject, self).__init__(*args, **kw_args) + + _attrs = ["aliasName", "name"] + _attr_types = {"aliasName": str, "name": str} + _defaults = {"aliasName": '', "name": ''} + _enums = {} + _refs = ["Names"] + _many_refs = ["Names"] + + def getNames(self): + """All names of this identified object. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.IdentifiedObject = None + for y in value: + y._IdentifiedObject = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = self + + def removeNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = None + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Core/Name.py b/CIM16/CDPSM/Geographical/IEC61970/Core/Name.py new file mode 100755 index 00000000..62c4b682 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Core/Name.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.Element import Element + +class Name(Element): + """The Name class provides the means to define any number of human readable names for an object. A name is not to be used for defining inter-object relationships. For inter-object relationships instead use the object identification 'mRID'. + """ + + def __init__(self, name='', NameType=None, IdentifiedObject=None, *args, **kw_args): + """Initialises a new 'Name' instance. + + @param name: Any free text that name the object. + @param NameType: Type of this name. + @param IdentifiedObject: Identified object that this name designates. + """ + #: Any free text that name the object. + self.name = name + + self._NameType = None + self.NameType = NameType + + self._IdentifiedObject = None + self.IdentifiedObject = IdentifiedObject + + super(Name, self).__init__(*args, **kw_args) + + _attrs = ["name"] + _attr_types = {"name": str} + _defaults = {"name": ''} + _enums = {} + _refs = ["NameType", "IdentifiedObject"] + _many_refs = [] + + def getNameType(self): + """Type of this name. + """ + return self._NameType + + def setNameType(self, value): + if self._NameType is not None: + filtered = [x for x in self.NameType.Names if x != self] + self._NameType._Names = filtered + + self._NameType = value + if self._NameType is not None: + if self not in self._NameType._Names: + self._NameType._Names.append(self) + + NameType = property(getNameType, setNameType) + + def getIdentifiedObject(self): + """Identified object that this name designates. + """ + return self._IdentifiedObject + + def setIdentifiedObject(self, value): + if self._IdentifiedObject is not None: + filtered = [x for x in self.IdentifiedObject.Names if x != self] + self._IdentifiedObject._Names = filtered + + self._IdentifiedObject = value + if self._IdentifiedObject is not None: + if self not in self._IdentifiedObject._Names: + self._IdentifiedObject._Names.append(self) + + IdentifiedObject = property(getIdentifiedObject, setIdentifiedObject) + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Core/NameType.py b/CIM16/CDPSM/Geographical/IEC61970/Core/NameType.py new file mode 100755 index 00000000..b5fd2a86 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Core/NameType.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.Element import Element + +class NameType(Element): + """Type of name. Possible values for attribute 'name' are implementation dependent but standard profiles may specify types. An enterprise may have multiple IT systems each having its own local name for the same object, e.g. a planning system may have different names from an EMS. An object may also have different names within the same IT system, e.g. localName and aliasName as defined in CIM version 14. Their definitions from CIM14 are The localName is a human readable name of the object. It is only used with objects organized in a naming hierarchy. localName: A free text name local to a node in a naming hierarchy similar to a file directory structure. A power system related naming hierarchy may be: Substation, VoltageLevel, Equipment etc. Children of the same parent in such a hierarchy have names that typically are unique among them. aliasName: A free text alternate name typically used in tabular reports where the column width is limited. + """ + + def __init__(self, Names=None, *args, **kw_args): + """Initialises a new 'NameType' instance. + + @param Names: All names of this type. + """ + self._Names = [] + self.Names = [] if Names is None else Names + + super(NameType, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Names"] + _many_refs = ["Names"] + + def getNames(self): + """All names of this type. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.NameType = None + for y in value: + y._NameType = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.NameType = self + + def removeNames(self, *Names): + for obj in Names: + obj.NameType = None + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Core/PowerSystemResource.py b/CIM16/CDPSM/Geographical/IEC61970/Core/PowerSystemResource.py new file mode 100755 index 00000000..517fa1ef --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Core/PowerSystemResource.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PowerSystemResource(IdentifiedObject): + """A power system resource can be an item of equipment such as a Switch, an EquipmentContainer containing many individual items of equipment such as a Substation, or an organisational entity such as Company or SubControlArea. This provides for the nesting of collections of PowerSystemResources within other PowerSystemResources. For example, a Switch could be a member of a Substation and a Substation could be a member of a division of a Company. + """ + + def __init__(self, Location=None, *args, **kw_args): + """Initialises a new 'PowerSystemResource' instance. + + @param Location: Location of this power system resource. + """ + self._Location = None + self.Location = Location + + super(PowerSystemResource, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Location"] + _many_refs = [] + + def getLocation(self): + """Location of this power system resource. + """ + return self._Location + + def setLocation(self, value): + if self._Location is not None: + filtered = [x for x in self.Location.PowerSystemResources if x != self] + self._Location._PowerSystemResources = filtered + + self._Location = value + if self._Location is not None: + if self not in self._Location._PowerSystemResources: + self._Location._PowerSystemResources.append(self) + + Location = property(getLocation, setLocation) + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Core/__init__.py b/CIM16/CDPSM/Geographical/IEC61970/Core/__init__.py new file mode 100755 index 00000000..d3598bae --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Core/__init__.py @@ -0,0 +1,33 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""Contains the core PowerSystemResource and ConductingEquipment entities shared by all applications plus common collections of those entities. Not all applications require all the Core entities. This package does not depend on any other package except the Domain package, but most of the other packages have associations and generalizations that depend on it. +""" + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment +from CIM16.CDPSM.Geographical.IEC61970.Core.NameType import NameType +from CIM16.CDPSM.Geographical.IEC61970.Core.Equipment import Equipment +from CIM16.CDPSM.Geographical.IEC61970.Core.IdentifiedObject import IdentifiedObject +from CIM16.CDPSM.Geographical.IEC61970.Core.Name import Name +from CIM16.CDPSM.Geographical.IEC61970.Core.PowerSystemResource import PowerSystemResource + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Geographical#Core" +nsPrefix = "cimCore" + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/ACLineSegment.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/ACLineSegment.py new file mode 100755 index 00000000..7b601485 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/ACLineSegment.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class ACLineSegment(ConductingEquipment): + """A wire or combination of wires, with consistent electrical characteristics, building a single electrical system, used to carry alternating current between points in the power system. For symmetrical, transposed 3ph lines, it is sufficient to use ACLineSegment attributes, which describe sequence impedances and admittances for the entire length of the segment. If per lenght impedance data is available from a library of standard types, impedances and admittances can be calculated in one of the following ways: - calculate electrical parameters from asset data, using associated ConductorInfo, with values then multiplied by Conductor.length to produce a matrix model. - calculate unbalanced electrical parameters from associated PerLengthPhaseImpedance, then multiplied by Conductor.length to produce a matrix model. - calculate transposed electrical parameters from associated PerLengthSequenceImpedance, then multiplied by Conductor.length to produce a sequence model. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'ACLineSegment' instance. + + """ + super(ACLineSegment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/Breaker.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/Breaker.py new file mode 100755 index 00000000..ee04fa62 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/Breaker.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Breaker(ConductingEquipment): + """A mechanical switching device capable of making, carrying, and breaking currents under normal circuit conditions and also making, carrying for a specified time, and breaking currents under specified abnormal circuit conditions e.g. those of short circuit. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Breaker' instance. + + """ + super(Breaker, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/BusbarSection.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/BusbarSection.py new file mode 100755 index 00000000..30b7de36 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/BusbarSection.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class BusbarSection(ConductingEquipment): + """A conductor, or group of conductors, with negligible impedance, that serve to connect other conducting equipment within a single substation. Voltage measurements are typically obtained from VoltageTransformers that are connected to busbar sections. A bus bar section may have many physical terminals but for analysis is modelled with exactly one logical terminal. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'BusbarSection' instance. + + """ + super(BusbarSection, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/DCLineSegment.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/DCLineSegment.py new file mode 100755 index 00000000..cf8f0acb --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/DCLineSegment.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class DCLineSegment(ConductingEquipment): + """A wire or combination of wires not insulated from one another, with consistent electrical characteristics, used to carry direct current between points in the DC region of the power system. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'DCLineSegment' instance. + + """ + super(DCLineSegment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/Disconnector.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/Disconnector.py new file mode 100755 index 00000000..cef27d77 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/Disconnector.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Disconnector(ConductingEquipment): + """A manually operated or motor operated mechanical switching device used for changing the connections in a circuit, or for isolating a circuit or equipment from a source of power. It is required to open or close circuits when negligible current is broken or made. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Disconnector' instance. + + """ + super(Disconnector, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/EnergyConsumer.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/EnergyConsumer.py new file mode 100755 index 00000000..e4370101 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/EnergyConsumer.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class EnergyConsumer(ConductingEquipment): + """Generic user of energy - a point of consumption on the power system model + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'EnergyConsumer' instance. + + """ + super(EnergyConsumer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/EnergySource.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/EnergySource.py new file mode 100755 index 00000000..c4fcd2b3 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/EnergySource.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class EnergySource(ConductingEquipment): + """A generic equivalent for an energy supplier on a transmission or distribution voltage level. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'EnergySource' instance. + + """ + super(EnergySource, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/Fuse.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/Fuse.py new file mode 100755 index 00000000..e161bf1c --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/Fuse.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Fuse(ConductingEquipment): + """An overcurrent protective device with a circuit opening fusible part that is heated and severed by the passage of overcurrent through it. A fuse is considered a switching device because it breaks current. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Fuse' instance. + + """ + super(Fuse, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/GroundDisconnector.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/GroundDisconnector.py new file mode 100755 index 00000000..eb5cbbe4 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/GroundDisconnector.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class GroundDisconnector(ConductingEquipment): + """A manually operated or motor operated mechanical switching device used for isolating a circuit or equipment from Ground. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'GroundDisconnector' instance. + + """ + super(GroundDisconnector, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/Jumper.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/Jumper.py new file mode 100755 index 00000000..db34c995 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/Jumper.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Jumper(ConductingEquipment): + """A short section of conductor with negligible impedance which can be manually removed and replaced if the circuit is de-energized. Note that zero-impedance branches can be modelled by an ACLineSegment with a zero impedance ConductorType + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Jumper' instance. + + """ + super(Jumper, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/Junction.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/Junction.py new file mode 100755 index 00000000..3e5ebe70 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/Junction.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Junction(ConductingEquipment): + """A point where one or more conducting equipments are connected with zero resistance. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Junction' instance. + + """ + super(Junction, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/Line.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/Line.py new file mode 100755 index 00000000..dfb8c561 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/Line.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class Line(PowerSystemResource): + """Contains equipment beyond a substation belonging to a power transmission line. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Line' instance. + + """ + super(Line, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/LoadBreakSwitch.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/LoadBreakSwitch.py new file mode 100755 index 00000000..f2ffb57b --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/LoadBreakSwitch.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class LoadBreakSwitch(ConductingEquipment): + """A mechanical switching device capable of making, carrying, and breaking currents under normal operating conditions. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'LoadBreakSwitch' instance. + + """ + super(LoadBreakSwitch, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/PowerTransformer.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/PowerTransformer.py new file mode 100755 index 00000000..abdb13de --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/PowerTransformer.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class PowerTransformer(ConductingEquipment): + """An electrical device consisting of two or more coupled windings, with or without a magnetic core, for introducing mutual coupling between electric circuits. Transformers can be used to control voltage and phase shift (active power flow). A power transformer may be composed of separate transformer tanks that need not be identical. The same power transformer can be modelled in two ways, namely with and without tanks:
  1. The power transformer that uses power transformer ends directly (without tanks) is suitable for balanced three-phase models. This is typical for transmission and sub-transmission network modelling. Such a transformer will require one power transformer end for each physical winding. There must be a one-to-one association between PowerTransformerEnd and Core::Terminal.
  2. The power transformer that uses transformer tanks is suitable for an unbalanced transformer, a balanced transformer within a single tank, or a balanced transformer made up of three tanks. This is typical for distribution network modelling and the only choice when modelling an unbalanced transformer, or a transformer that has more than three windings. Power transformer modelled with tanks will require for each tank, one transformer tank end per physical winding in the tank. There may be one, two, or three phases in the transformer tank end. Examples: 3 phases for 3-phase delta or wye connected windings, 2 for one phase-to-phase winding, and 1 for a phase-to-neutral or phase-to-ground winding. With 1 or 2 phases, more than one transformer tank end may be associated to the same 3-phase Core::Terminal instance, while with 3 phases there should be a one-to-one association.
This power transformer model is flexible in order to support different kinds of data exchange requirements. There are 5 possible ways to combine available classes and their attributes:
  1. Instance parameters - Use the r, x, r0, x0, b, b0, g, and g0 attributes on PowerTransformerEnd and ignore related TransformerStarImpedance, TransformerMeshImpedance, or TransformerCoreAdmittance. This option assumes a star connection of the series impedances. It is suitable for typical transmission, balanced three-phase transformer models, for transformers with 2 or three windings.
  2. Star instance parameters by association - Instead of the r, x, r0, x0, b, b0, g, and g0 attributes, use associations to TransformerStarImpedance and TransformerCoreAdmitance. This option is suitable in same scenarios as option 1, but when catalogue data is available for transformers.
  3. Mesh instance parameters by association: Instead of the r, x, r0, x0, b, b0, g, and g0 attributes, use associations to TransformerMeshImpedance and TransformerCoreAdmittance. This option supports transformers with more than three windings.
  4. Catalog mesh parameters by association - Instead of attributes r, x, r0, x0, b, b0, g, and g0 and associations to TransformerStarImpedance, TransformerMeshImpedance, or TransformerCoreAdmittance, use the association to TransformerEndInfo. The TransformerEnd.endNumber should match the corresponding TransformerEndInfo.endNumber, following the IEC standard convention of numbering from the highest voltage ends to the lowest, starting at 1. This matching supports higher-level use of a catalog, through just one association between TransformerTank and TransformerTankInfo, with simpler exchanges and incremental updates. The associated TransformerEndInfo will have associations to TransformerMeshImpedance and TransformerCoreAdmittance. This option supports unbalanced transformer, with more than three windings and is suitable whenever the transformer test data has been converted to an electrical model.
  5. Catalog test data by association - This is the same as option 4, except TransformerEndInfo will have associations to AssetModels::TransformerTest decendents, instead of to TransformerMeshImpedance and TransformerCoreAdmittance. This option is suitable when the test data is available, and the receiving application is able to interpret the test data.
Every profile should specify which one or more of these options are supported. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'PowerTransformer' instance. + + """ + super(PowerTransformer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/SeriesCompensator.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/SeriesCompensator.py new file mode 100755 index 00000000..3291f2b9 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/SeriesCompensator.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class SeriesCompensator(ConductingEquipment): + """A Series Compensator is a series capacitor or reactor or an AC transmission line without charging susceptance. It is a two terminal device. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'SeriesCompensator' instance. + + """ + super(SeriesCompensator, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/ShuntCompensator.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/ShuntCompensator.py new file mode 100755 index 00000000..87ab667c --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/ShuntCompensator.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class ShuntCompensator(ConductingEquipment): + """A shunt capacitor or reactor or switchable bank of shunt capacitors or reactors. A section of a shunt compensator is an individual capacitor or reactor. A negative value for reactivePerSection indicates that the compensator is a reactor. ShuntCompensator is a single terminal device. Ground is implied. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'ShuntCompensator' instance. + + """ + super(ShuntCompensator, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/SynchronousMachine.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/SynchronousMachine.py new file mode 100755 index 00000000..333e1ee1 --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/SynchronousMachine.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.CDPSM.Geographical.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class SynchronousMachine(ConductingEquipment): + """An electromechanical device that operates synchronously with the network. It is a single machine operating either as a generator or synchronous condenser or pump. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'SynchronousMachine' instance. + + """ + super(SynchronousMachine, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/CDPSM/Geographical/IEC61970/Wires/__init__.py b/CIM16/CDPSM/Geographical/IEC61970/Wires/__init__.py new file mode 100755 index 00000000..83c9765e --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/Wires/__init__.py @@ -0,0 +1,44 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""An extension to the Core and Topology package that models information on the electrical characteristics of Transmission and Distribution networks. This package is used by network applications such as State Estimation, Load Flow and Optimal Power Flow. +""" + +from CIM16.CDPSM.Geographical.IEC61970.Wires.Fuse import Fuse +from CIM16.CDPSM.Geographical.IEC61970.Wires.EnergyConsumer import EnergyConsumer +from CIM16.CDPSM.Geographical.IEC61970.Wires.Disconnector import Disconnector +from CIM16.CDPSM.Geographical.IEC61970.Wires.ACLineSegment import ACLineSegment +from CIM16.CDPSM.Geographical.IEC61970.Wires.SynchronousMachine import SynchronousMachine +from CIM16.CDPSM.Geographical.IEC61970.Wires.BusbarSection import BusbarSection +from CIM16.CDPSM.Geographical.IEC61970.Wires.LoadBreakSwitch import LoadBreakSwitch +from CIM16.CDPSM.Geographical.IEC61970.Wires.GroundDisconnector import GroundDisconnector +from CIM16.CDPSM.Geographical.IEC61970.Wires.SeriesCompensator import SeriesCompensator +from CIM16.CDPSM.Geographical.IEC61970.Wires.Junction import Junction +from CIM16.CDPSM.Geographical.IEC61970.Wires.Breaker import Breaker +from CIM16.CDPSM.Geographical.IEC61970.Wires.DCLineSegment import DCLineSegment +from CIM16.CDPSM.Geographical.IEC61970.Wires.Line import Line +from CIM16.CDPSM.Geographical.IEC61970.Wires.PowerTransformer import PowerTransformer +from CIM16.CDPSM.Geographical.IEC61970.Wires.EnergySource import EnergySource +from CIM16.CDPSM.Geographical.IEC61970.Wires.ShuntCompensator import ShuntCompensator +from CIM16.CDPSM.Geographical.IEC61970.Wires.Jumper import Jumper + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Geographical#Wires" +nsPrefix = "cimWires" + diff --git a/CIM16/CDPSM/Geographical/IEC61970/__init__.py b/CIM16/CDPSM/Geographical/IEC61970/__init__.py new file mode 100755 index 00000000..7005c34c --- /dev/null +++ b/CIM16/CDPSM/Geographical/IEC61970/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The ControlArea package models area specifications which can be used for a variety of purposes. The package as a whole models potentially overlapping control area specifications for the purpose of actual generation control, load forecast area load capture, or powerflow based analysis. +""" + + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Geographical#IEC61970" +nsPrefix = "cimIEC61970" + diff --git a/CIM16/CDPSM/Geographical/__init__.py b/CIM16/CDPSM/Geographical/__init__.py new file mode 100755 index 00000000..a545c81b --- /dev/null +++ b/CIM16/CDPSM/Geographical/__init__.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The IEC 61968 subpackages of the CIM are developed, standardized and maintained by IEC TC57 Working Group 14: interfaces for distribution management (WG14). Currently, normative parts of the model support the needs of information exchange defined in IEC 61968-9 and in IEC 61968-13. +""" + +from CIM16.CDPSM.Geographical.Element import Element + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Geographical" +nsPrefix = "geo" + +packageMap = { + "Element": "CIM16.CDPSM.Geographical", + "Fuse": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "EnergyConsumer": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "Disconnector": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "ACLineSegment": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "SynchronousMachine": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "BusbarSection": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "LoadBreakSwitch": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "GroundDisconnector": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "SeriesCompensator": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "Junction": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "Breaker": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "DCLineSegment": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "Line": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "PowerTransformer": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "EnergySource": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "ShuntCompensator": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "Jumper": "CIM16.CDPSM.Geographical.IEC61970.Wires", + "ConductingEquipment": "CIM16.CDPSM.Geographical.IEC61970.Core", + "NameType": "CIM16.CDPSM.Geographical.IEC61970.Core", + "Equipment": "CIM16.CDPSM.Geographical.IEC61970.Core", + "IdentifiedObject": "CIM16.CDPSM.Geographical.IEC61970.Core", + "Name": "CIM16.CDPSM.Geographical.IEC61970.Core", + "PowerSystemResource": "CIM16.CDPSM.Geographical.IEC61970.Core", + "Location": "CIM16.CDPSM.Geographical.IEC61968.Common", + "CoordinateSystem": "CIM16.CDPSM.Geographical.IEC61968.Common", + "PositionPoint": "CIM16.CDPSM.Geographical.IEC61968.Common", +} + + +class CIMTime(str): + pass + +class CIMDateTime(str): + pass + +class CIMDuration(str): + pass + +class CIMGYear(str): + pass + +class CIMDate(str): + pass + +class CIMGMonthDay(str): + pass + +class CIMGMonth(str): + pass + +class CIMGDay(str): + pass + +class CIMGYearMonth(str): + pass diff --git a/CIM16/CDPSM/__init__.py b/CIM16/CDPSM/__init__.py new file mode 100755 index 00000000..837845af --- /dev/null +++ b/CIM16/CDPSM/__init__.py @@ -0,0 +1,25 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM" +nsPrefix = "cdosm" + diff --git a/CIM16/CombinedVersion.py b/CIM16/CombinedVersion.py new file mode 100755 index 00000000..73c946ca --- /dev/null +++ b/CIM16/CombinedVersion.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class CombinedVersion(Element): + """The combined version denotes the versions of the subpackages that have been combined into the total CIIMmodel. This is a convenience instead of having to look at each subpackage.The combined version denotes the versions of the subpackages that have been combined into the total CIIMmodel. This is a convenience instead of having to look at each subpackage. + """ + + def __init__(self, date='', version='', *args, **kw_args): + """Initialises a new 'CombinedVersion' instance. + + @param date: Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. + @param version: Form is IEC61970CIMXXvYY_IEC61968CIMXXvYY_combined where XX is the major CIM package version and the YY is the minor version, and different packages could have different major and minor versions. For example IEC61970CIM13v18_IEC61968CIM10v16_combined. Additional packages might be added in the future. + """ + #: Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. + self.date = date + + #: Form is IEC61970CIMXXvYY_IEC61968CIMXXvYY_combined where XX is the major CIM package version and the YY is the minor version, and different packages could have different major and minor versions. For example IEC61970CIM13v18_IEC61968CIM10v16_combined. Additional packages might be added in the future. + self.version = version + + super(CombinedVersion, self).__init__(*args, **kw_args) + + _attrs = ["date", "version"] + _attr_types = {"date": str, "version": str} + _defaults = {"date": '', "version": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/Element.py b/CIM16/Element.py new file mode 100755 index 00000000..fddaa815 --- /dev/null +++ b/CIM16/Element.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class Element(object): + + def __init__(self, UUID=''): + """Initialises a new 'Element' instance. + + @param UUID: + """ + + self.UUID = UUID + + + _attrs = ["UUID"] + _attr_types = {"UUID": str} + _defaults = {"UUID": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/AssetModels/CableInfo.py b/CIM16/IEC61968/AssetModels/CableInfo.py new file mode 100755 index 00000000..9d11c7f4 --- /dev/null +++ b/CIM16/IEC61968/AssetModels/CableInfo.py @@ -0,0 +1,99 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.AssetModels.ConductorInfo import ConductorInfo + +class CableInfo(ConductorInfo): + """Cable data.Cable data. + """ + + def __init__(self, outerJacketKind="pvc", sheathAsNeutral=False, isStrandFill=False, nominalTemperature=0.0, constructionKind="sector", diameterOverJacket=0.0, diameterOverInsulation=0.0, diameterOverScreen=0.0, shieldMaterial="lead", diameterOverCore=0.0, DuctBankInfo=None, *args, **kw_args): + """Initialises a new 'CableInfo' instance. + + @param outerJacketKind: Kind of outer jacket of this cable. Values are: "pvc", "linearLowDensityPolyethylene", "none", "insulating", "other", "polyethylene", "semiconducting" + @param sheathAsNeutral: True if sheath / shield is used as a neutral (i.e., bonded). + @param isStrandFill: True if wire strands are extruded in a way to fill the voids in the cable. + @param nominalTemperature: Maximum nominal design operating temperature. + @param constructionKind: Kind of construction of this cable. Values are: "sector", "other", "solid", "compacted", "stranded", "segmental", "compressed" + @param diameterOverJacket: Diameter over the outermost jacketing layer. + @param diameterOverInsulation: Diameter over the insulating layer, excluding outer screen. + @param diameterOverScreen: Diameter over the outer screen; should be the shield's inside diameter.. + @param shieldMaterial: Material of the shield. Values are: "lead", "aluminum", "other", "copper", "steel" + @param diameterOverCore: Diameter over the core, including any semi-con screen; should be the insulating layer's inside diameter. + @param DuctBankInfo: + """ + #: Kind of outer jacket of this cable. Values are: "pvc", "linearLowDensityPolyethylene", "none", "insulating", "other", "polyethylene", "semiconducting" + self.outerJacketKind = outerJacketKind + + #: True if sheath / shield is used as a neutral (i.e., bonded). + self.sheathAsNeutral = sheathAsNeutral + + #: True if wire strands are extruded in a way to fill the voids in the cable. + self.isStrandFill = isStrandFill + + #: Maximum nominal design operating temperature. + self.nominalTemperature = nominalTemperature + + #: Kind of construction of this cable. Values are: "sector", "other", "solid", "compacted", "stranded", "segmental", "compressed" + self.constructionKind = constructionKind + + #: Diameter over the outermost jacketing layer. + self.diameterOverJacket = diameterOverJacket + + #: Diameter over the insulating layer, excluding outer screen. + self.diameterOverInsulation = diameterOverInsulation + + #: Diameter over the outer screen; should be the shield's inside diameter.. + self.diameterOverScreen = diameterOverScreen + + #: Material of the shield. Values are: "lead", "aluminum", "other", "copper", "steel" + self.shieldMaterial = shieldMaterial + + #: Diameter over the core, including any semi-con screen; should be the insulating layer's inside diameter. + self.diameterOverCore = diameterOverCore + + self._DuctBankInfo = None + self.DuctBankInfo = DuctBankInfo + + super(CableInfo, self).__init__(*args, **kw_args) + + _attrs = ["outerJacketKind", "sheathAsNeutral", "isStrandFill", "nominalTemperature", "constructionKind", "diameterOverJacket", "diameterOverInsulation", "diameterOverScreen", "shieldMaterial", "diameterOverCore"] + _attr_types = {"outerJacketKind": str, "sheathAsNeutral": bool, "isStrandFill": bool, "nominalTemperature": float, "constructionKind": str, "diameterOverJacket": float, "diameterOverInsulation": float, "diameterOverScreen": float, "shieldMaterial": str, "diameterOverCore": float} + _defaults = {"outerJacketKind": "pvc", "sheathAsNeutral": False, "isStrandFill": False, "nominalTemperature": 0.0, "constructionKind": "sector", "diameterOverJacket": 0.0, "diameterOverInsulation": 0.0, "diameterOverScreen": 0.0, "shieldMaterial": "lead", "diameterOverCore": 0.0} + _enums = {"outerJacketKind": "CableOuterJacketKind", "constructionKind": "CableConstructionKind", "shieldMaterial": "CableShieldMaterialKind"} + _refs = ["DuctBankInfo"] + _many_refs = [] + + def getDuctBankInfo(self): + + return self._DuctBankInfo + + def setDuctBankInfo(self, value): + if self._DuctBankInfo is not None: + filtered = [x for x in self.DuctBankInfo.CableInfos if x != self] + self._DuctBankInfo._CableInfos = filtered + + self._DuctBankInfo = value + if self._DuctBankInfo is not None: + if self not in self._DuctBankInfo._CableInfos: + self._DuctBankInfo._CableInfos.append(self) + + DuctBankInfo = property(getDuctBankInfo, setDuctBankInfo) + diff --git a/CIM16/IEC61968/AssetModels/ConcentricNeutralCableInfo.py b/CIM16/IEC61968/AssetModels/ConcentricNeutralCableInfo.py new file mode 100755 index 00000000..207021c5 --- /dev/null +++ b/CIM16/IEC61968/AssetModels/ConcentricNeutralCableInfo.py @@ -0,0 +1,68 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.AssetModels.CableInfo import CableInfo + +class ConcentricNeutralCableInfo(CableInfo): + """Concentric neutral cable data.Concentric neutral cable data. + """ + + def __init__(self, neutralStrandCount=0, diameterOverNeutral=0.0, WireType=None, *args, **kw_args): + """Initialises a new 'ConcentricNeutralCableInfo' instance. + + @param neutralStrandCount: Number of concentric neutral strands. + @param diameterOverNeutral: Diameter over the concentric neutral strands. + @param WireType: Wire type used for this concentric neutral cable. + """ + #: Number of concentric neutral strands. + self.neutralStrandCount = neutralStrandCount + + #: Diameter over the concentric neutral strands. + self.diameterOverNeutral = diameterOverNeutral + + self._WireType = None + self.WireType = WireType + + super(ConcentricNeutralCableInfo, self).__init__(*args, **kw_args) + + _attrs = ["neutralStrandCount", "diameterOverNeutral"] + _attr_types = {"neutralStrandCount": int, "diameterOverNeutral": float} + _defaults = {"neutralStrandCount": 0, "diameterOverNeutral": 0.0} + _enums = {} + _refs = ["WireType"] + _many_refs = [] + + def getWireType(self): + """Wire type used for this concentric neutral cable. + """ + return self._WireType + + def setWireType(self, value): + if self._WireType is not None: + filtered = [x for x in self.WireType.ConcentricNeutralCableInfos if x != self] + self._WireType._ConcentricNeutralCableInfos = filtered + + self._WireType = value + if self._WireType is not None: + if self not in self._WireType._ConcentricNeutralCableInfos: + self._WireType._ConcentricNeutralCableInfos.append(self) + + WireType = property(getWireType, setWireType) + diff --git a/CIM16/IEC61968/AssetModels/ConductorInfo.py b/CIM16/IEC61968/AssetModels/ConductorInfo.py new file mode 100755 index 00000000..18cd0511 --- /dev/null +++ b/CIM16/IEC61968/AssetModels/ConductorInfo.py @@ -0,0 +1,111 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class ConductorInfo(AssetInfo): + """Conductor data.Conductor data. + """ + + def __init__(self, insulated=False, usage="secondary", insulationMaterial="treeRetardantCrosslinkedPolyethylene", phaseCount=0, insulationThickness=0.0, WireArrangements=None, LineSegments=None, *args, **kw_args): + """Initialises a new 'ConductorInfo' instance. + + @param insulated: True if conductor is insulated. + @param usage: Usage of this conductor. Values are: "secondary", "other", "distribution", "transmission" + @param insulationMaterial: (if insulated conductor) Material used for insulation. Values are: "treeRetardantCrosslinkedPolyethylene", "butyl", "highPressureFluidFilled", "other", "varnishedCambricCloth", "siliconRubber", "beltedPilc", "crosslinkedPolyethylene", "oilPaper", "lowCapacitanceRubber", "asbestosAndVarnishedCambric", "treeResistantHighMolecularWeightPolyethylene", "unbeltedPilc", "ozoneResistantRubber", "ethylenePropyleneRubber", "highMolecularWeightPolyethylene", "varnishedDacronGlass", "rubber" + @param phaseCount: Number of phases (including neutral) to be retained. Any wires beyond this number should be reduced into the earth return. + @param insulationThickness: (if insulated conductor) Thickness of the insulation. + @param WireArrangements: All wire arrangements (single wires) that make this conductor. + @param LineSegments: All line segments described by this conductor data. + """ + #: True if conductor is insulated. + self.insulated = insulated + + #: Usage of this conductor. Values are: "secondary", "other", "distribution", "transmission" + self.usage = usage + + #: (if insulated conductor) Material used for insulation. Values are: "treeRetardantCrosslinkedPolyethylene", "butyl", "highPressureFluidFilled", "other", "varnishedCambricCloth", "siliconRubber", "beltedPilc", "crosslinkedPolyethylene", "oilPaper", "lowCapacitanceRubber", "asbestosAndVarnishedCambric", "treeResistantHighMolecularWeightPolyethylene", "unbeltedPilc", "ozoneResistantRubber", "ethylenePropyleneRubber", "highMolecularWeightPolyethylene", "varnishedDacronGlass", "rubber" + self.insulationMaterial = insulationMaterial + + #: Number of phases (including neutral) to be retained. Any wires beyond this number should be reduced into the earth return. + self.phaseCount = phaseCount + + #: (if insulated conductor) Thickness of the insulation. + self.insulationThickness = insulationThickness + + self._WireArrangements = [] + self.WireArrangements = [] if WireArrangements is None else WireArrangements + + self._LineSegments = [] + self.LineSegments = [] if LineSegments is None else LineSegments + + super(ConductorInfo, self).__init__(*args, **kw_args) + + _attrs = ["insulated", "usage", "insulationMaterial", "phaseCount", "insulationThickness"] + _attr_types = {"insulated": bool, "usage": str, "insulationMaterial": str, "phaseCount": int, "insulationThickness": float} + _defaults = {"insulated": False, "usage": "secondary", "insulationMaterial": "treeRetardantCrosslinkedPolyethylene", "phaseCount": 0, "insulationThickness": 0.0} + _enums = {"usage": "ConductorUsageKind", "insulationMaterial": "ConductorInsulationKind"} + _refs = ["WireArrangements", "LineSegments"] + _many_refs = ["WireArrangements", "LineSegments"] + + def getWireArrangements(self): + """All wire arrangements (single wires) that make this conductor. + """ + return self._WireArrangements + + def setWireArrangements(self, value): + for x in self._WireArrangements: + x.ConductorInfo = None + for y in value: + y._ConductorInfo = self + self._WireArrangements = value + + WireArrangements = property(getWireArrangements, setWireArrangements) + + def addWireArrangements(self, *WireArrangements): + for obj in WireArrangements: + obj.ConductorInfo = self + + def removeWireArrangements(self, *WireArrangements): + for obj in WireArrangements: + obj.ConductorInfo = None + + def getLineSegments(self): + """All line segments described by this conductor data. + """ + return self._LineSegments + + def setLineSegments(self, value): + for x in self._LineSegments: + x.ConductorInfo = None + for y in value: + y._ConductorInfo = self + self._LineSegments = value + + LineSegments = property(getLineSegments, setLineSegments) + + def addLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.ConductorInfo = self + + def removeLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.ConductorInfo = None + diff --git a/CIM16/IEC61968/AssetModels/EndDeviceInfo.py b/CIM16/IEC61968/AssetModels/EndDeviceInfo.py new file mode 100755 index 00000000..d4423702 --- /dev/null +++ b/CIM16/IEC61968/AssetModels/EndDeviceInfo.py @@ -0,0 +1,77 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class EndDeviceInfo(AssetInfo): + """End device data.End device data. + """ + + def __init__(self, phaseCount=0, ratedCurrent=0.0, ratedVoltage=0.0, EndDevices=None, *args, **kw_args): + """Initialises a new 'EndDeviceInfo' instance. + + @param phaseCount: Number of potential phases the end device supports, typically 0, 1 or 3. + @param ratedCurrent: Rated current. + @param ratedVoltage: Rated voltage. + @param EndDevices: All end devices described with this data. + """ + #: Number of potential phases the end device supports, typically 0, 1 or 3. + self.phaseCount = phaseCount + + #: Rated current. + self.ratedCurrent = ratedCurrent + + #: Rated voltage. + self.ratedVoltage = ratedVoltage + + self._EndDevices = [] + self.EndDevices = [] if EndDevices is None else EndDevices + + super(EndDeviceInfo, self).__init__(*args, **kw_args) + + _attrs = ["phaseCount", "ratedCurrent", "ratedVoltage"] + _attr_types = {"phaseCount": int, "ratedCurrent": float, "ratedVoltage": float} + _defaults = {"phaseCount": 0, "ratedCurrent": 0.0, "ratedVoltage": 0.0} + _enums = {} + _refs = ["EndDevices"] + _many_refs = ["EndDevices"] + + def getEndDevices(self): + """All end devices described with this data. + """ + return self._EndDevices + + def setEndDevices(self, value): + for x in self._EndDevices: + x.EndDeviceInfo = None + for y in value: + y._EndDeviceInfo = self + self._EndDevices = value + + EndDevices = property(getEndDevices, setEndDevices) + + def addEndDevices(self, *EndDevices): + for obj in EndDevices: + obj.EndDeviceInfo = self + + def removeEndDevices(self, *EndDevices): + for obj in EndDevices: + obj.EndDeviceInfo = None + diff --git a/CIM16/IEC61968/AssetModels/NoLoadTest.py b/CIM16/IEC61968/AssetModels/NoLoadTest.py new file mode 100755 index 00000000..776c122a --- /dev/null +++ b/CIM16/IEC61968/AssetModels/NoLoadTest.py @@ -0,0 +1,80 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.AssetModels.TransformerTest import TransformerTest + +class NoLoadTest(TransformerTest): + """No-load test results determine core admittance parameters. They include exciting current and core loss measurements from applying voltage to one winding. The excitation may be positive sequence or zero sequence. The test may be repeated at different voltages to measure saturation.No-load test results determine core admittance parameters. They include exciting current and core loss measurements from applying voltage to one winding. The excitation may be positive sequence or zero sequence. The test may be repeated at different voltages to measure saturation. + """ + + def __init__(self, excitingCurrent=0.0, lossZero=0.0, excitingCurrentZero=0.0, energisedEndVoltage=0.0, loss=0.0, EnergisedEnd=None, *args, **kw_args): + """Initialises a new 'NoLoadTest' instance. + + @param excitingCurrent: Exciting current measured from a positive-sequence or single-phase excitation test. + @param lossZero: Losses measured from a zero-sequence excitation test. + @param excitingCurrentZero: Exciting current measured from a zero-sequence open-circuit excitation test. + @param energisedEndVoltage: Voltage applied to the winding (end) during test. + @param loss: Losses measured from a positive-sequence or single-phase excitation test. + @param EnergisedEnd: Transformer end that current is applied to in this no-load test. + """ + #: Exciting current measured from a positive-sequence or single-phase excitation test. + self.excitingCurrent = excitingCurrent + + #: Losses measured from a zero-sequence excitation test. + self.lossZero = lossZero + + #: Exciting current measured from a zero-sequence open-circuit excitation test. + self.excitingCurrentZero = excitingCurrentZero + + #: Voltage applied to the winding (end) during test. + self.energisedEndVoltage = energisedEndVoltage + + #: Losses measured from a positive-sequence or single-phase excitation test. + self.loss = loss + + self._EnergisedEnd = None + self.EnergisedEnd = EnergisedEnd + + super(NoLoadTest, self).__init__(*args, **kw_args) + + _attrs = ["excitingCurrent", "lossZero", "excitingCurrentZero", "energisedEndVoltage", "loss"] + _attr_types = {"excitingCurrent": float, "lossZero": float, "excitingCurrentZero": float, "energisedEndVoltage": float, "loss": float} + _defaults = {"excitingCurrent": 0.0, "lossZero": 0.0, "excitingCurrentZero": 0.0, "energisedEndVoltage": 0.0, "loss": 0.0} + _enums = {} + _refs = ["EnergisedEnd"] + _many_refs = [] + + def getEnergisedEnd(self): + """Transformer end that current is applied to in this no-load test. + """ + return self._EnergisedEnd + + def setEnergisedEnd(self, value): + if self._EnergisedEnd is not None: + filtered = [x for x in self.EnergisedEnd.EnergisedEndNoLoadTest if x != self] + self._EnergisedEnd._EnergisedEndNoLoadTest = filtered + + self._EnergisedEnd = value + if self._EnergisedEnd is not None: + if self not in self._EnergisedEnd._EnergisedEndNoLoadTest: + self._EnergisedEnd._EnergisedEndNoLoadTest.append(self) + + EnergisedEnd = property(getEnergisedEnd, setEnergisedEnd) + diff --git a/CIM16/IEC61968/AssetModels/OpenCircuitTest.py b/CIM16/IEC61968/AssetModels/OpenCircuitTest.py new file mode 100755 index 00000000..6a54a711 --- /dev/null +++ b/CIM16/IEC61968/AssetModels/OpenCircuitTest.py @@ -0,0 +1,101 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.AssetModels.TransformerTest import TransformerTest + +class OpenCircuitTest(TransformerTest): + """Open-circuit test results verify winding turn ratios and phase shifts. They include induced voltage and phase shift measurements on open-circuit windings, with voltage applied to the energised end. For three-phase windings, the excitation can be positive sequence (the default) or zero sequence.Open-circuit test results verify winding turn ratios and phase shifts. They include induced voltage and phase shift measurements on open-circuit windings, with voltage applied to the energised end. For three-phase windings, the excitation can be positive sequence (the default) or zero sequence. + """ + + def __init__(self, energisedEndStep=0, openEndVoltage=0.0, openEndStep=0, energisedEndVoltage=0.0, phaseShift=0.0, OpenEnd=None, EnergisedEnd=None, *args, **kw_args): + """Initialises a new 'OpenCircuitTest' instance. + + @param energisedEndStep: Tap step number for the energised end of the test pair. + @param openEndVoltage: Voltage measured at the open-circuited end, with the energised end set to rated voltage and all other ends open. + @param openEndStep: Tap step number for the open end of the test pair. + @param energisedEndVoltage: Voltage applied to the winding (end) during test. + @param phaseShift: Phase shift measured at the open end with the energised end set to rated voltage and all other ends open. + @param OpenEnd: Transformer end measured for induced voltage and angle in this open-circuit test. + @param EnergisedEnd: Transformer end that current is applied to in this open-circuit test. + """ + #: Tap step number for the energised end of the test pair. + self.energisedEndStep = energisedEndStep + + #: Voltage measured at the open-circuited end, with the energised end set to rated voltage and all other ends open. + self.openEndVoltage = openEndVoltage + + #: Tap step number for the open end of the test pair. + self.openEndStep = openEndStep + + #: Voltage applied to the winding (end) during test. + self.energisedEndVoltage = energisedEndVoltage + + #: Phase shift measured at the open end with the energised end set to rated voltage and all other ends open. + self.phaseShift = phaseShift + + self._OpenEnd = None + self.OpenEnd = OpenEnd + + self._EnergisedEnd = None + self.EnergisedEnd = EnergisedEnd + + super(OpenCircuitTest, self).__init__(*args, **kw_args) + + _attrs = ["energisedEndStep", "openEndVoltage", "openEndStep", "energisedEndVoltage", "phaseShift"] + _attr_types = {"energisedEndStep": int, "openEndVoltage": float, "openEndStep": int, "energisedEndVoltage": float, "phaseShift": float} + _defaults = {"energisedEndStep": 0, "openEndVoltage": 0.0, "openEndStep": 0, "energisedEndVoltage": 0.0, "phaseShift": 0.0} + _enums = {} + _refs = ["OpenEnd", "EnergisedEnd"] + _many_refs = [] + + def getOpenEnd(self): + """Transformer end measured for induced voltage and angle in this open-circuit test. + """ + return self._OpenEnd + + def setOpenEnd(self, value): + if self._OpenEnd is not None: + filtered = [x for x in self.OpenEnd.OpenEndOpenCircuitTests if x != self] + self._OpenEnd._OpenEndOpenCircuitTests = filtered + + self._OpenEnd = value + if self._OpenEnd is not None: + if self not in self._OpenEnd._OpenEndOpenCircuitTests: + self._OpenEnd._OpenEndOpenCircuitTests.append(self) + + OpenEnd = property(getOpenEnd, setOpenEnd) + + def getEnergisedEnd(self): + """Transformer end that current is applied to in this open-circuit test. + """ + return self._EnergisedEnd + + def setEnergisedEnd(self, value): + if self._EnergisedEnd is not None: + filtered = [x for x in self.EnergisedEnd.EnergisedEndOpenCircuitTests if x != self] + self._EnergisedEnd._EnergisedEndOpenCircuitTests = filtered + + self._EnergisedEnd = value + if self._EnergisedEnd is not None: + if self not in self._EnergisedEnd._EnergisedEndOpenCircuitTests: + self._EnergisedEnd._EnergisedEndOpenCircuitTests.append(self) + + EnergisedEnd = property(getEnergisedEnd, setEnergisedEnd) + diff --git a/CIM16/IEC61968/AssetModels/OverheadConductorInfo.py b/CIM16/IEC61968/AssetModels/OverheadConductorInfo.py new file mode 100755 index 00000000..2b53edd2 --- /dev/null +++ b/CIM16/IEC61968/AssetModels/OverheadConductorInfo.py @@ -0,0 +1,71 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.AssetModels.ConductorInfo import ConductorInfo + +class OverheadConductorInfo(ConductorInfo): + """Overhead conductor data.Overhead conductor data. + """ + + def __init__(self, neutralInsulationThickness=0.0, phaseConductorSpacing=0.0, phaseConductorCount=0, MountingPoint=None, *args, **kw_args): + """Initialises a new 'OverheadConductorInfo' instance. + + @param neutralInsulationThickness: (if applicable) Insulation thickness of the neutral conductor. + @param phaseConductorSpacing: Distance between conductor strands in a symmetrical bundle. + @param phaseConductorCount: Number of conductor strands in the symmetrical bundle (1-12). + @param MountingPoint: + """ + #: (if applicable) Insulation thickness of the neutral conductor. + self.neutralInsulationThickness = neutralInsulationThickness + + #: Distance between conductor strands in a symmetrical bundle. + self.phaseConductorSpacing = phaseConductorSpacing + + #: Number of conductor strands in the symmetrical bundle (1-12). + self.phaseConductorCount = phaseConductorCount + + self._MountingPoint = None + self.MountingPoint = MountingPoint + + super(OverheadConductorInfo, self).__init__(*args, **kw_args) + + _attrs = ["neutralInsulationThickness", "phaseConductorSpacing", "phaseConductorCount"] + _attr_types = {"neutralInsulationThickness": float, "phaseConductorSpacing": float, "phaseConductorCount": int} + _defaults = {"neutralInsulationThickness": 0.0, "phaseConductorSpacing": 0.0, "phaseConductorCount": 0} + _enums = {} + _refs = ["MountingPoint"] + _many_refs = [] + + def getMountingPoint(self): + + return self._MountingPoint + + def setMountingPoint(self, value): + if self._MountingPoint is not None: + filtered = [x for x in self.MountingPoint.OverheadConductors if x != self] + self._MountingPoint._OverheadConductors = filtered + + self._MountingPoint = value + if self._MountingPoint is not None: + if self not in self._MountingPoint._OverheadConductors: + self._MountingPoint._OverheadConductors.append(self) + + MountingPoint = property(getMountingPoint, setMountingPoint) + diff --git a/CIM16/IEC61968/AssetModels/PowerTransformerInfo.py b/CIM16/IEC61968/AssetModels/PowerTransformerInfo.py new file mode 100755 index 00000000..f29858ab --- /dev/null +++ b/CIM16/IEC61968/AssetModels/PowerTransformerInfo.py @@ -0,0 +1,91 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class PowerTransformerInfo(AssetInfo): + """Set of power transformer data, from an equipment library.Set of power transformer data, from an equipment library. + """ + + def __init__(self, TransformerTankInfo=None, PowerTransformers=None, *args, **kw_args): + """Initialises a new 'PowerTransformerInfo' instance. + + @param TransformerTankInfo: Data for all the tanks described by this power transformer data. + @param PowerTransformers: All power transformers that can be described with this power transformer data. + """ + self._TransformerTankInfo = [] + self.TransformerTankInfo = [] if TransformerTankInfo is None else TransformerTankInfo + + self._PowerTransformers = [] + self.PowerTransformers = [] if PowerTransformers is None else PowerTransformers + + super(PowerTransformerInfo, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TransformerTankInfo", "PowerTransformers"] + _many_refs = ["TransformerTankInfo", "PowerTransformers"] + + def getTransformerTankInfo(self): + """Data for all the tanks described by this power transformer data. + """ + return self._TransformerTankInfo + + def setTransformerTankInfo(self, value): + for x in self._TransformerTankInfo: + x.PowerTransformerInfo = None + for y in value: + y._PowerTransformerInfo = self + self._TransformerTankInfo = value + + TransformerTankInfo = property(getTransformerTankInfo, setTransformerTankInfo) + + def addTransformerTankInfo(self, *TransformerTankInfo): + for obj in TransformerTankInfo: + obj.PowerTransformerInfo = self + + def removeTransformerTankInfo(self, *TransformerTankInfo): + for obj in TransformerTankInfo: + obj.PowerTransformerInfo = None + + def getPowerTransformers(self): + """All power transformers that can be described with this power transformer data. + """ + return self._PowerTransformers + + def setPowerTransformers(self, value): + for x in self._PowerTransformers: + x.PowerTransformerInfo = None + for y in value: + y._PowerTransformerInfo = self + self._PowerTransformers = value + + PowerTransformers = property(getPowerTransformers, setPowerTransformers) + + def addPowerTransformers(self, *PowerTransformers): + for obj in PowerTransformers: + obj.PowerTransformerInfo = self + + def removePowerTransformers(self, *PowerTransformers): + for obj in PowerTransformers: + obj.PowerTransformerInfo = None + diff --git a/CIM16/IEC61968/AssetModels/ShortCircuitTest.py b/CIM16/IEC61968/AssetModels/ShortCircuitTest.py new file mode 100755 index 00000000..bbb89bb9 --- /dev/null +++ b/CIM16/IEC61968/AssetModels/ShortCircuitTest.py @@ -0,0 +1,116 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.AssetModels.TransformerTest import TransformerTest + +class ShortCircuitTest(TransformerTest): + """Short-circuit test results determine mesh impedance parameters. They include load losses and leakage impedances. For three-phase windings, the excitation can be positive sequence (the default) or zero sequence. There must be at least one grounded winding.Short-circuit test results determine mesh impedance parameters. They include load losses and leakage impedances. For three-phase windings, the excitation can be positive sequence (the default) or zero sequence. There must be at least one grounded winding. + """ + + def __init__(self, lossZero=0.0, leakageImpedance=0.0, loss=0.0, groundedEndStep=0, leakageImpedanceZero=0.0, energisedEndStep=0, GroundedEnds=None, EnergisedEnd=None, *args, **kw_args): + """Initialises a new 'ShortCircuitTest' instance. + + @param lossZero: Load losses from a zero-sequence short-circuit test. + @param leakageImpedance: Leakage impedance measured from a positive-sequence or single-phase short-circuit test. + @param loss: Load losses from a positive-sequence or single-phase short-circuit test. + @param groundedEndStep: Tap step number for the grounded end of the test pair. + @param leakageImpedanceZero: Leakage impedance measured from a zero-sequence short-circuit test. + @param energisedEndStep: Tap step number for the energised end of the test pair. + @param GroundedEnds: All ends short-circuited in this short-circuit test. + @param EnergisedEnd: Transformer end that voltage is applied to in this short-circuit test. The test voltage is chosen to induce rated current in the energised end. + """ + #: Load losses from a zero-sequence short-circuit test. + self.lossZero = lossZero + + #: Leakage impedance measured from a positive-sequence or single-phase short-circuit test. + self.leakageImpedance = leakageImpedance + + #: Load losses from a positive-sequence or single-phase short-circuit test. + self.loss = loss + + #: Tap step number for the grounded end of the test pair. + self.groundedEndStep = groundedEndStep + + #: Leakage impedance measured from a zero-sequence short-circuit test. + self.leakageImpedanceZero = leakageImpedanceZero + + #: Tap step number for the energised end of the test pair. + self.energisedEndStep = energisedEndStep + + self._GroundedEnds = [] + self.GroundedEnds = [] if GroundedEnds is None else GroundedEnds + + self._EnergisedEnd = None + self.EnergisedEnd = EnergisedEnd + + super(ShortCircuitTest, self).__init__(*args, **kw_args) + + _attrs = ["lossZero", "leakageImpedance", "loss", "groundedEndStep", "leakageImpedanceZero", "energisedEndStep"] + _attr_types = {"lossZero": float, "leakageImpedance": float, "loss": float, "groundedEndStep": int, "leakageImpedanceZero": float, "energisedEndStep": int} + _defaults = {"lossZero": 0.0, "leakageImpedance": 0.0, "loss": 0.0, "groundedEndStep": 0, "leakageImpedanceZero": 0.0, "energisedEndStep": 0} + _enums = {} + _refs = ["GroundedEnds", "EnergisedEnd"] + _many_refs = ["GroundedEnds"] + + def getGroundedEnds(self): + """All ends short-circuited in this short-circuit test. + """ + return self._GroundedEnds + + def setGroundedEnds(self, value): + for p in self._GroundedEnds: + filtered = [q for q in p.GroundedEndShortCircuitTests if q != self] + self._GroundedEnds._GroundedEndShortCircuitTests = filtered + for r in value: + if self not in r._GroundedEndShortCircuitTests: + r._GroundedEndShortCircuitTests.append(self) + self._GroundedEnds = value + + GroundedEnds = property(getGroundedEnds, setGroundedEnds) + + def addGroundedEnds(self, *GroundedEnds): + for obj in GroundedEnds: + if self not in obj._GroundedEndShortCircuitTests: + obj._GroundedEndShortCircuitTests.append(self) + self._GroundedEnds.append(obj) + + def removeGroundedEnds(self, *GroundedEnds): + for obj in GroundedEnds: + if self in obj._GroundedEndShortCircuitTests: + obj._GroundedEndShortCircuitTests.remove(self) + self._GroundedEnds.remove(obj) + + def getEnergisedEnd(self): + """Transformer end that voltage is applied to in this short-circuit test. The test voltage is chosen to induce rated current in the energised end. + """ + return self._EnergisedEnd + + def setEnergisedEnd(self, value): + if self._EnergisedEnd is not None: + filtered = [x for x in self.EnergisedEnd.EnergisedEndShortCircuitTests if x != self] + self._EnergisedEnd._EnergisedEndShortCircuitTests = filtered + + self._EnergisedEnd = value + if self._EnergisedEnd is not None: + if self not in self._EnergisedEnd._EnergisedEndShortCircuitTests: + self._EnergisedEnd._EnergisedEndShortCircuitTests.append(self) + + EnergisedEnd = property(getEnergisedEnd, setEnergisedEnd) + diff --git a/CIM16/IEC61968/AssetModels/TapChangerInfo.py b/CIM16/IEC61968/AssetModels/TapChangerInfo.py new file mode 100755 index 00000000..9ae72735 --- /dev/null +++ b/CIM16/IEC61968/AssetModels/TapChangerInfo.py @@ -0,0 +1,125 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class TapChangerInfo(AssetInfo): + """Tap changer data.Tap changer data. + """ + + def __init__(self, ctRating=0.0, stepPhaseIncrement=0.0, ratedApparentPower=0.0, frequency=0.0, neutralU=0.0, ctRatio=0.0, stepVoltageIncrement=0.0, isTcul=False, neutralStep=0, ratedCurrent=0.0, lowStep=0, ratedVoltage=0.0, highStep=0, ptRatio=0.0, bil=0.0, TapChangers=None, *args, **kw_args): + """Initialises a new 'TapChangerInfo' instance. + + @param ctRating: Built-in current transformer primary rating. + @param stepPhaseIncrement: Phase shift per step position. + @param ratedApparentPower: Rated apparent power. + @param frequency: Frequency at which the ratings apply. + @param neutralU: Voltage at which the winding operates at the neutral tap setting. + @param ctRatio: Built-in current transducer ratio. + @param stepVoltageIncrement: Tap step increment, in per cent of rated voltage, per step position. + @param isTcul: Whether this tap changer has under load tap changing capabilities. + @param neutralStep: The neutral tap step position for the winding. + @param ratedCurrent: Rated current. + @param lowStep: Lowest possible tap step position, retard from neutral. + @param ratedVoltage: Rated voltage. + @param highStep: Highest possible tap step position, advance from neutral. + @param ptRatio: Built-in voltage transducer ratio. + @param bil: Basic Insulation Level (BIL) expressed as the impulse crest voltage of a nominal wave, typically 1.2 X 50 microsecond. This is a measure of the ability of the insulation to withstand very high voltage surges. + @param TapChangers: All tap changers having this data. + """ + #: Built-in current transformer primary rating. + self.ctRating = ctRating + + #: Phase shift per step position. + self.stepPhaseIncrement = stepPhaseIncrement + + #: Rated apparent power. + self.ratedApparentPower = ratedApparentPower + + #: Frequency at which the ratings apply. + self.frequency = frequency + + #: Voltage at which the winding operates at the neutral tap setting. + self.neutralU = neutralU + + #: Built-in current transducer ratio. + self.ctRatio = ctRatio + + #: Tap step increment, in per cent of rated voltage, per step position. + self.stepVoltageIncrement = stepVoltageIncrement + + #: Whether this tap changer has under load tap changing capabilities. + self.isTcul = isTcul + + #: The neutral tap step position for the winding. + self.neutralStep = neutralStep + + #: Rated current. + self.ratedCurrent = ratedCurrent + + #: Lowest possible tap step position, retard from neutral. + self.lowStep = lowStep + + #: Rated voltage. + self.ratedVoltage = ratedVoltage + + #: Highest possible tap step position, advance from neutral. + self.highStep = highStep + + #: Built-in voltage transducer ratio. + self.ptRatio = ptRatio + + #: Basic Insulation Level (BIL) expressed as the impulse crest voltage of a nominal wave, typically 1.2 X 50 microsecond. This is a measure of the ability of the insulation to withstand very high voltage surges. + self.bil = bil + + self._TapChangers = [] + self.TapChangers = [] if TapChangers is None else TapChangers + + super(TapChangerInfo, self).__init__(*args, **kw_args) + + _attrs = ["ctRating", "stepPhaseIncrement", "ratedApparentPower", "frequency", "neutralU", "ctRatio", "stepVoltageIncrement", "isTcul", "neutralStep", "ratedCurrent", "lowStep", "ratedVoltage", "highStep", "ptRatio", "bil"] + _attr_types = {"ctRating": float, "stepPhaseIncrement": float, "ratedApparentPower": float, "frequency": float, "neutralU": float, "ctRatio": float, "stepVoltageIncrement": float, "isTcul": bool, "neutralStep": int, "ratedCurrent": float, "lowStep": int, "ratedVoltage": float, "highStep": int, "ptRatio": float, "bil": float} + _defaults = {"ctRating": 0.0, "stepPhaseIncrement": 0.0, "ratedApparentPower": 0.0, "frequency": 0.0, "neutralU": 0.0, "ctRatio": 0.0, "stepVoltageIncrement": 0.0, "isTcul": False, "neutralStep": 0, "ratedCurrent": 0.0, "lowStep": 0, "ratedVoltage": 0.0, "highStep": 0, "ptRatio": 0.0, "bil": 0.0} + _enums = {} + _refs = ["TapChangers"] + _many_refs = ["TapChangers"] + + def getTapChangers(self): + """All tap changers having this data. + """ + return self._TapChangers + + def setTapChangers(self, value): + for x in self._TapChangers: + x.TapChangerInfo = None + for y in value: + y._TapChangerInfo = self + self._TapChangers = value + + TapChangers = property(getTapChangers, setTapChangers) + + def addTapChangers(self, *TapChangers): + for obj in TapChangers: + obj.TapChangerInfo = self + + def removeTapChangers(self, *TapChangers): + for obj in TapChangers: + obj.TapChangerInfo = None + diff --git a/CIM16/IEC61968/AssetModels/TapeShieldCableInfo.py b/CIM16/IEC61968/AssetModels/TapeShieldCableInfo.py new file mode 100755 index 00000000..73824059 --- /dev/null +++ b/CIM16/IEC61968/AssetModels/TapeShieldCableInfo.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.AssetModels.CableInfo import CableInfo + +class TapeShieldCableInfo(CableInfo): + """Tape shield cable data.Tape shield cable data. + """ + + def __init__(self, tapeLap=0.0, tapeThickness=0.0, *args, **kw_args): + """Initialises a new 'TapeShieldCableInfo' instance. + + @param tapeLap: Percentage of the tape shield width that overlaps in each wrap, typically 10% to 25%. + @param tapeThickness: Thickness of the tape shield, before wrapping. + """ + #: Percentage of the tape shield width that overlaps in each wrap, typically 10% to 25%. + self.tapeLap = tapeLap + + #: Thickness of the tape shield, before wrapping. + self.tapeThickness = tapeThickness + + super(TapeShieldCableInfo, self).__init__(*args, **kw_args) + + _attrs = ["tapeLap", "tapeThickness"] + _attr_types = {"tapeLap": float, "tapeThickness": float} + _defaults = {"tapeLap": 0.0, "tapeThickness": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/AssetModels/TransformerEndInfo.py b/CIM16/IEC61968/AssetModels/TransformerEndInfo.py new file mode 100755 index 00000000..e84c2356 --- /dev/null +++ b/CIM16/IEC61968/AssetModels/TransformerEndInfo.py @@ -0,0 +1,336 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class TransformerEndInfo(AssetInfo): + """Transformer end data.Transformer end data. + """ + + def __init__(self, r=0.0, insulationU=0.0, emergencyS=0.0, shortTermS=0.0, connectionKind="Z", endNumber=0, ratedS=0.0, ratedU=0.0, phaseAngleClock=0, FromMeshImpedance=None, EnergisedEndNoLoadTest=None, OpenEndOpenCircuitTests=None, ToMeshImpedance=None, TransformerEnd=None, TransformerTankInfo=None, EnergisedEndOpenCircuitTests=None, GroundedEndShortCircuitTests=None, EnergisedEndShortCircuitTests=None, CoreAdmittance=None, *args, **kw_args): + """Initialises a new 'TransformerEndInfo' instance. + + @param r: DC resistance. + @param insulationU: Basic insulation level voltage rating. + @param emergencyS: Apparent power that the winding can carry under emergency conditions (also called long-term emergency power). + @param shortTermS: Apparent power that this winding can carry for a short period of time (in emergency). + @param connectionKind: Kind of connection. Values are: "Z", "A", "Yn", "Y", "Zn", "D", "I" + @param endNumber: Number for this transformer end, corresponding to the end's order in the PowerTransformer.vectorGroup attribute. Highest voltage winding should be 1. + @param ratedS: Normal apparent power rating. + @param ratedU: Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings. + @param phaseAngleClock: Winding phase angle where 360 degrees are represented with clock hours, so the valid values are {0, ..., 11}. For example, to express winding code 'Dyn11', set attributes as follows: 'connectionKind' = Yn and 'phaseAngleClock' = 11. + @param FromMeshImpedance: All mesh impedances between this 'to' and other 'from' transformer ends. + @param EnergisedEndNoLoadTest: All no-load test measurements in which this transformer end was energised. + @param OpenEndOpenCircuitTests: All open-circuit test measurements in which this transformer end was not excited. + @param ToMeshImpedance: All mesh impedances between this 'from' and other 'to' transformer ends. + @param TransformerEnd: All transformer ends described by this end data. + @param TransformerTankInfo: Transformer tank data that this end description is part of. + @param EnergisedEndOpenCircuitTests: All open-circuit test measurements in which this transformer end was excited. + @param GroundedEndShortCircuitTests: All short-circuit test measurements in which this transformer end was short-circuited. + @param EnergisedEndShortCircuitTests: All short-circuit test measurements in which this transformer end was energised. + @param CoreAdmittance: Core admittance of this transformer end info, representing magnetising current and core losses. The full values of the transformer should be supplied for one transformer end info only. + """ + #: DC resistance. + self.r = r + + #: Basic insulation level voltage rating. + self.insulationU = insulationU + + #: Apparent power that the winding can carry under emergency conditions (also called long-term emergency power). + self.emergencyS = emergencyS + + #: Apparent power that this winding can carry for a short period of time (in emergency). + self.shortTermS = shortTermS + + #: Kind of connection. Values are: "Z", "A", "Yn", "Y", "Zn", "D", "I" + self.connectionKind = connectionKind + + #: Number for this transformer end, corresponding to the end's order in the PowerTransformer.vectorGroup attribute. Highest voltage winding should be 1. + self.endNumber = endNumber + + #: Normal apparent power rating. + self.ratedS = ratedS + + #: Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings. + self.ratedU = ratedU + + #: Winding phase angle where 360 degrees are represented with clock hours, so the valid values are {0, ..., 11}. For example, to express winding code 'Dyn11', set attributes as follows: 'connectionKind' = Yn and 'phaseAngleClock' = 11. + self.phaseAngleClock = phaseAngleClock + + self._FromMeshImpedance = [] + self.FromMeshImpedance = [] if FromMeshImpedance is None else FromMeshImpedance + + self._EnergisedEndNoLoadTest = [] + self.EnergisedEndNoLoadTest = [] if EnergisedEndNoLoadTest is None else EnergisedEndNoLoadTest + + self._OpenEndOpenCircuitTests = [] + self.OpenEndOpenCircuitTests = [] if OpenEndOpenCircuitTests is None else OpenEndOpenCircuitTests + + self._ToMeshImpedance = [] + self.ToMeshImpedance = [] if ToMeshImpedance is None else ToMeshImpedance + + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + self._TransformerTankInfo = None + self.TransformerTankInfo = TransformerTankInfo + + self._EnergisedEndOpenCircuitTests = [] + self.EnergisedEndOpenCircuitTests = [] if EnergisedEndOpenCircuitTests is None else EnergisedEndOpenCircuitTests + + self._GroundedEndShortCircuitTests = [] + self.GroundedEndShortCircuitTests = [] if GroundedEndShortCircuitTests is None else GroundedEndShortCircuitTests + + self._EnergisedEndShortCircuitTests = [] + self.EnergisedEndShortCircuitTests = [] if EnergisedEndShortCircuitTests is None else EnergisedEndShortCircuitTests + + self._CoreAdmittance = None + self.CoreAdmittance = CoreAdmittance + + super(TransformerEndInfo, self).__init__(*args, **kw_args) + + _attrs = ["r", "insulationU", "emergencyS", "shortTermS", "connectionKind", "endNumber", "ratedS", "ratedU", "phaseAngleClock"] + _attr_types = {"r": float, "insulationU": float, "emergencyS": float, "shortTermS": float, "connectionKind": str, "endNumber": int, "ratedS": float, "ratedU": float, "phaseAngleClock": int} + _defaults = {"r": 0.0, "insulationU": 0.0, "emergencyS": 0.0, "shortTermS": 0.0, "connectionKind": "Z", "endNumber": 0, "ratedS": 0.0, "ratedU": 0.0, "phaseAngleClock": 0} + _enums = {"connectionKind": "WindingConnection"} + _refs = ["FromMeshImpedance", "EnergisedEndNoLoadTest", "OpenEndOpenCircuitTests", "ToMeshImpedance", "TransformerEnd", "TransformerTankInfo", "EnergisedEndOpenCircuitTests", "GroundedEndShortCircuitTests", "EnergisedEndShortCircuitTests", "CoreAdmittance"] + _many_refs = ["FromMeshImpedance", "EnergisedEndNoLoadTest", "OpenEndOpenCircuitTests", "ToMeshImpedance", "TransformerEnd", "EnergisedEndOpenCircuitTests", "GroundedEndShortCircuitTests", "EnergisedEndShortCircuitTests"] + + def getFromMeshImpedance(self): + """All mesh impedances between this 'to' and other 'from' transformer ends. + """ + return self._FromMeshImpedance + + def setFromMeshImpedance(self, value): + for x in self._FromMeshImpedance: + x.FromTransformerEndInfo = None + for y in value: + y._FromTransformerEndInfo = self + self._FromMeshImpedance = value + + FromMeshImpedance = property(getFromMeshImpedance, setFromMeshImpedance) + + def addFromMeshImpedance(self, *FromMeshImpedance): + for obj in FromMeshImpedance: + obj.FromTransformerEndInfo = self + + def removeFromMeshImpedance(self, *FromMeshImpedance): + for obj in FromMeshImpedance: + obj.FromTransformerEndInfo = None + + def getEnergisedEndNoLoadTest(self): + """All no-load test measurements in which this transformer end was energised. + """ + return self._EnergisedEndNoLoadTest + + def setEnergisedEndNoLoadTest(self, value): + for x in self._EnergisedEndNoLoadTest: + x.EnergisedEnd = None + for y in value: + y._EnergisedEnd = self + self._EnergisedEndNoLoadTest = value + + EnergisedEndNoLoadTest = property(getEnergisedEndNoLoadTest, setEnergisedEndNoLoadTest) + + def addEnergisedEndNoLoadTest(self, *EnergisedEndNoLoadTest): + for obj in EnergisedEndNoLoadTest: + obj.EnergisedEnd = self + + def removeEnergisedEndNoLoadTest(self, *EnergisedEndNoLoadTest): + for obj in EnergisedEndNoLoadTest: + obj.EnergisedEnd = None + + def getOpenEndOpenCircuitTests(self): + """All open-circuit test measurements in which this transformer end was not excited. + """ + return self._OpenEndOpenCircuitTests + + def setOpenEndOpenCircuitTests(self, value): + for x in self._OpenEndOpenCircuitTests: + x.OpenEnd = None + for y in value: + y._OpenEnd = self + self._OpenEndOpenCircuitTests = value + + OpenEndOpenCircuitTests = property(getOpenEndOpenCircuitTests, setOpenEndOpenCircuitTests) + + def addOpenEndOpenCircuitTests(self, *OpenEndOpenCircuitTests): + for obj in OpenEndOpenCircuitTests: + obj.OpenEnd = self + + def removeOpenEndOpenCircuitTests(self, *OpenEndOpenCircuitTests): + for obj in OpenEndOpenCircuitTests: + obj.OpenEnd = None + + def getToMeshImpedance(self): + """All mesh impedances between this 'from' and other 'to' transformer ends. + """ + return self._ToMeshImpedance + + def setToMeshImpedance(self, value): + for p in self._ToMeshImpedance: + filtered = [q for q in p.ToTransformerEndInfo if q != self] + self._ToMeshImpedance._ToTransformerEndInfo = filtered + for r in value: + if self not in r._ToTransformerEndInfo: + r._ToTransformerEndInfo.append(self) + self._ToMeshImpedance = value + + ToMeshImpedance = property(getToMeshImpedance, setToMeshImpedance) + + def addToMeshImpedance(self, *ToMeshImpedance): + for obj in ToMeshImpedance: + if self not in obj._ToTransformerEndInfo: + obj._ToTransformerEndInfo.append(self) + self._ToMeshImpedance.append(obj) + + def removeToMeshImpedance(self, *ToMeshImpedance): + for obj in ToMeshImpedance: + if self in obj._ToTransformerEndInfo: + obj._ToTransformerEndInfo.remove(self) + self._ToMeshImpedance.remove(obj) + + def getTransformerEnd(self): + """All transformer ends described by this end data. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.TransformerEndInfo = None + for y in value: + y._TransformerEndInfo = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.TransformerEndInfo = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.TransformerEndInfo = None + + def getTransformerTankInfo(self): + """Transformer tank data that this end description is part of. + """ + return self._TransformerTankInfo + + def setTransformerTankInfo(self, value): + if self._TransformerTankInfo is not None: + filtered = [x for x in self.TransformerTankInfo.TransformerEndInfos if x != self] + self._TransformerTankInfo._TransformerEndInfos = filtered + + self._TransformerTankInfo = value + if self._TransformerTankInfo is not None: + if self not in self._TransformerTankInfo._TransformerEndInfos: + self._TransformerTankInfo._TransformerEndInfos.append(self) + + TransformerTankInfo = property(getTransformerTankInfo, setTransformerTankInfo) + + def getEnergisedEndOpenCircuitTests(self): + """All open-circuit test measurements in which this transformer end was excited. + """ + return self._EnergisedEndOpenCircuitTests + + def setEnergisedEndOpenCircuitTests(self, value): + for x in self._EnergisedEndOpenCircuitTests: + x.EnergisedEnd = None + for y in value: + y._EnergisedEnd = self + self._EnergisedEndOpenCircuitTests = value + + EnergisedEndOpenCircuitTests = property(getEnergisedEndOpenCircuitTests, setEnergisedEndOpenCircuitTests) + + def addEnergisedEndOpenCircuitTests(self, *EnergisedEndOpenCircuitTests): + for obj in EnergisedEndOpenCircuitTests: + obj.EnergisedEnd = self + + def removeEnergisedEndOpenCircuitTests(self, *EnergisedEndOpenCircuitTests): + for obj in EnergisedEndOpenCircuitTests: + obj.EnergisedEnd = None + + def getGroundedEndShortCircuitTests(self): + """All short-circuit test measurements in which this transformer end was short-circuited. + """ + return self._GroundedEndShortCircuitTests + + def setGroundedEndShortCircuitTests(self, value): + for p in self._GroundedEndShortCircuitTests: + filtered = [q for q in p.GroundedEnds if q != self] + self._GroundedEndShortCircuitTests._GroundedEnds = filtered + for r in value: + if self not in r._GroundedEnds: + r._GroundedEnds.append(self) + self._GroundedEndShortCircuitTests = value + + GroundedEndShortCircuitTests = property(getGroundedEndShortCircuitTests, setGroundedEndShortCircuitTests) + + def addGroundedEndShortCircuitTests(self, *GroundedEndShortCircuitTests): + for obj in GroundedEndShortCircuitTests: + if self not in obj._GroundedEnds: + obj._GroundedEnds.append(self) + self._GroundedEndShortCircuitTests.append(obj) + + def removeGroundedEndShortCircuitTests(self, *GroundedEndShortCircuitTests): + for obj in GroundedEndShortCircuitTests: + if self in obj._GroundedEnds: + obj._GroundedEnds.remove(self) + self._GroundedEndShortCircuitTests.remove(obj) + + def getEnergisedEndShortCircuitTests(self): + """All short-circuit test measurements in which this transformer end was energised. + """ + return self._EnergisedEndShortCircuitTests + + def setEnergisedEndShortCircuitTests(self, value): + for x in self._EnergisedEndShortCircuitTests: + x.EnergisedEnd = None + for y in value: + y._EnergisedEnd = self + self._EnergisedEndShortCircuitTests = value + + EnergisedEndShortCircuitTests = property(getEnergisedEndShortCircuitTests, setEnergisedEndShortCircuitTests) + + def addEnergisedEndShortCircuitTests(self, *EnergisedEndShortCircuitTests): + for obj in EnergisedEndShortCircuitTests: + obj.EnergisedEnd = self + + def removeEnergisedEndShortCircuitTests(self, *EnergisedEndShortCircuitTests): + for obj in EnergisedEndShortCircuitTests: + obj.EnergisedEnd = None + + def getCoreAdmittance(self): + """Core admittance of this transformer end info, representing magnetising current and core losses. The full values of the transformer should be supplied for one transformer end info only. + """ + return self._CoreAdmittance + + def setCoreAdmittance(self, value): + if self._CoreAdmittance is not None: + self._CoreAdmittance._TransformerEndInfo = None + + self._CoreAdmittance = value + if self._CoreAdmittance is not None: + self._CoreAdmittance.TransformerEndInfo = None + self._CoreAdmittance._TransformerEndInfo = self + + CoreAdmittance = property(getCoreAdmittance, setCoreAdmittance) + diff --git a/CIM16/IEC61968/AssetModels/TransformerTankInfo.py b/CIM16/IEC61968/AssetModels/TransformerTankInfo.py new file mode 100755 index 00000000..cdfd2ccf --- /dev/null +++ b/CIM16/IEC61968/AssetModels/TransformerTankInfo.py @@ -0,0 +1,162 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class TransformerTankInfo(AssetInfo): + """Set of transformer tank data, from an equipment library.Set of transformer tank data, from an equipment library. + """ + + def __init__(self, TransformerAssets=None, TransformerEndInfos=None, PowerTransformerInfo=None, TransformerAssetModels=None, TransformerTanks=None, *args, **kw_args): + """Initialises a new 'TransformerTankInfo' instance. + + @param TransformerAssets: + @param TransformerEndInfos: Data for all the ends described by this transformer tank data. + @param PowerTransformerInfo: Power transformer data that this tank description is part of. + @param TransformerAssetModels: + @param TransformerTanks: All transformer tanks that can be described with this transformer tank data. + """ + self._TransformerAssets = [] + self.TransformerAssets = [] if TransformerAssets is None else TransformerAssets + + self._TransformerEndInfos = [] + self.TransformerEndInfos = [] if TransformerEndInfos is None else TransformerEndInfos + + self._PowerTransformerInfo = None + self.PowerTransformerInfo = PowerTransformerInfo + + self._TransformerAssetModels = [] + self.TransformerAssetModels = [] if TransformerAssetModels is None else TransformerAssetModels + + self._TransformerTanks = [] + self.TransformerTanks = [] if TransformerTanks is None else TransformerTanks + + super(TransformerTankInfo, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TransformerAssets", "TransformerEndInfos", "PowerTransformerInfo", "TransformerAssetModels", "TransformerTanks"] + _many_refs = ["TransformerAssets", "TransformerEndInfos", "TransformerAssetModels", "TransformerTanks"] + + def getTransformerAssets(self): + + return self._TransformerAssets + + def setTransformerAssets(self, value): + for x in self._TransformerAssets: + x.TransformerInfo = None + for y in value: + y._TransformerInfo = self + self._TransformerAssets = value + + TransformerAssets = property(getTransformerAssets, setTransformerAssets) + + def addTransformerAssets(self, *TransformerAssets): + for obj in TransformerAssets: + obj.TransformerInfo = self + + def removeTransformerAssets(self, *TransformerAssets): + for obj in TransformerAssets: + obj.TransformerInfo = None + + def getTransformerEndInfos(self): + """Data for all the ends described by this transformer tank data. + """ + return self._TransformerEndInfos + + def setTransformerEndInfos(self, value): + for x in self._TransformerEndInfos: + x.TransformerTankInfo = None + for y in value: + y._TransformerTankInfo = self + self._TransformerEndInfos = value + + TransformerEndInfos = property(getTransformerEndInfos, setTransformerEndInfos) + + def addTransformerEndInfos(self, *TransformerEndInfos): + for obj in TransformerEndInfos: + obj.TransformerTankInfo = self + + def removeTransformerEndInfos(self, *TransformerEndInfos): + for obj in TransformerEndInfos: + obj.TransformerTankInfo = None + + def getPowerTransformerInfo(self): + """Power transformer data that this tank description is part of. + """ + return self._PowerTransformerInfo + + def setPowerTransformerInfo(self, value): + if self._PowerTransformerInfo is not None: + filtered = [x for x in self.PowerTransformerInfo.TransformerTankInfo if x != self] + self._PowerTransformerInfo._TransformerTankInfo = filtered + + self._PowerTransformerInfo = value + if self._PowerTransformerInfo is not None: + if self not in self._PowerTransformerInfo._TransformerTankInfo: + self._PowerTransformerInfo._TransformerTankInfo.append(self) + + PowerTransformerInfo = property(getPowerTransformerInfo, setPowerTransformerInfo) + + def getTransformerAssetModels(self): + + return self._TransformerAssetModels + + def setTransformerAssetModels(self, value): + for x in self._TransformerAssetModels: + x.TransformerInfo = None + for y in value: + y._TransformerInfo = self + self._TransformerAssetModels = value + + TransformerAssetModels = property(getTransformerAssetModels, setTransformerAssetModels) + + def addTransformerAssetModels(self, *TransformerAssetModels): + for obj in TransformerAssetModels: + obj.TransformerInfo = self + + def removeTransformerAssetModels(self, *TransformerAssetModels): + for obj in TransformerAssetModels: + obj.TransformerInfo = None + + def getTransformerTanks(self): + """All transformer tanks that can be described with this transformer tank data. + """ + return self._TransformerTanks + + def setTransformerTanks(self, value): + for x in self._TransformerTanks: + x.TransformerTankInfo = None + for y in value: + y._TransformerTankInfo = self + self._TransformerTanks = value + + TransformerTanks = property(getTransformerTanks, setTransformerTanks) + + def addTransformerTanks(self, *TransformerTanks): + for obj in TransformerTanks: + obj.TransformerTankInfo = self + + def removeTransformerTanks(self, *TransformerTanks): + for obj in TransformerTanks: + obj.TransformerTankInfo = None + diff --git a/CIM16/IEC61968/AssetModels/TransformerTest.py b/CIM16/IEC61968/AssetModels/TransformerTest.py new file mode 100755 index 00000000..04738f95 --- /dev/null +++ b/CIM16/IEC61968/AssetModels/TransformerTest.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerTest(IdentifiedObject): + """Test result for transformer ends, such as short-circuit, open-circuit (excitation) or no-load test.Test result for transformer ends, such as short-circuit, open-circuit (excitation) or no-load test. + """ + + def __init__(self, basePower=0.0, temperature=0.0, *args, **kw_args): + """Initialises a new 'TransformerTest' instance. + + @param basePower: Base power at which the tests are conducted, usually equal to the rateds of one of the involved transformer ends. + @param temperature: Temperature at which the test is conducted. + """ + #: Base power at which the tests are conducted, usually equal to the rateds of one of the involved transformer ends. + self.basePower = basePower + + #: Temperature at which the test is conducted. + self.temperature = temperature + + super(TransformerTest, self).__init__(*args, **kw_args) + + _attrs = ["basePower", "temperature"] + _attr_types = {"basePower": float, "temperature": float} + _defaults = {"basePower": 0.0, "temperature": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/AssetModels/WireArrangement.py b/CIM16/IEC61968/AssetModels/WireArrangement.py new file mode 100755 index 00000000..aae3a925 --- /dev/null +++ b/CIM16/IEC61968/AssetModels/WireArrangement.py @@ -0,0 +1,93 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class WireArrangement(IdentifiedObject): + """Identification, spacing and configuration of the wires of a conductor, with reference to their type.Identification, spacing and configuration of the wires of a conductor, with reference to their type. + """ + + def __init__(self, mountingPointY=0.0, mountingPointX=0.0, position=0, ConductorInfo=None, WireType=None, *args, **kw_args): + """Initialises a new 'WireArrangement' instance. + + @param mountingPointY: Height above ground of the first wire. + @param mountingPointX: Signed horizontal distance from the first wire to a common reference point. + @param position: Position number on the structure corresponding to this wire. For example, use 1..3 for phases and 4 for the neutral on a 3-phase structure. The individual phase assignments matter; for example, ABC will produce a different set of unbalanced line parameters, by phase, than BAC. + @param ConductorInfo: Conductor data this wire arrangement belongs to. + @param WireType: Wire type used for this wire arrangement. + """ + #: Height above ground of the first wire. + self.mountingPointY = mountingPointY + + #: Signed horizontal distance from the first wire to a common reference point. + self.mountingPointX = mountingPointX + + #: Position number on the structure corresponding to this wire. For example, use 1..3 for phases and 4 for the neutral on a 3-phase structure. The individual phase assignments matter; for example, ABC will produce a different set of unbalanced line parameters, by phase, than BAC. + self.position = position + + self._ConductorInfo = None + self.ConductorInfo = ConductorInfo + + self._WireType = None + self.WireType = WireType + + super(WireArrangement, self).__init__(*args, **kw_args) + + _attrs = ["mountingPointY", "mountingPointX", "position"] + _attr_types = {"mountingPointY": float, "mountingPointX": float, "position": int} + _defaults = {"mountingPointY": 0.0, "mountingPointX": 0.0, "position": 0} + _enums = {} + _refs = ["ConductorInfo", "WireType"] + _many_refs = [] + + def getConductorInfo(self): + """Conductor data this wire arrangement belongs to. + """ + return self._ConductorInfo + + def setConductorInfo(self, value): + if self._ConductorInfo is not None: + filtered = [x for x in self.ConductorInfo.WireArrangements if x != self] + self._ConductorInfo._WireArrangements = filtered + + self._ConductorInfo = value + if self._ConductorInfo is not None: + if self not in self._ConductorInfo._WireArrangements: + self._ConductorInfo._WireArrangements.append(self) + + ConductorInfo = property(getConductorInfo, setConductorInfo) + + def getWireType(self): + """Wire type used for this wire arrangement. + """ + return self._WireType + + def setWireType(self, value): + if self._WireType is not None: + filtered = [x for x in self.WireType.WireArrangements if x != self] + self._WireType._WireArrangements = filtered + + self._WireType = value + if self._WireType is not None: + if self not in self._WireType._WireArrangements: + self._WireType._WireArrangements.append(self) + + WireType = property(getWireType, setWireType) + diff --git a/CIM16/IEC61968/AssetModels/WireType.py b/CIM16/IEC61968/AssetModels/WireType.py new file mode 100755 index 00000000..2a968a91 --- /dev/null +++ b/CIM16/IEC61968/AssetModels/WireType.py @@ -0,0 +1,139 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class WireType(IdentifiedObject): + """Wire conductor (per IEEE specs). A specific type of wire or combination of wires, not insulated from each other, suitable for carrying electrical current.Wire conductor (per IEEE specs). A specific type of wire or combination of wires, not insulated from each other, suitable for carrying electrical current. + """ + + def __init__(self, coreRadius=0.0, rAC50=0.0, coreStrandCount=0, radius=0.0, material="aluminum", rDC20=0.0, sizeDescription='', rAC75=0.0, gmr=0.0, ratedCurrent=0.0, strandCount=0, rAC25=0.0, WireArrangements=None, ConcentricNeutralCableInfos=None, *args, **kw_args): + """Initialises a new 'WireType' instance. + + @param coreRadius: (if there is a different core material) Radius of the central core. + @param rAC50: AC resistance per unit length of the conductor at 50 oC. + @param coreStrandCount: (if used) Number of strands in the steel core. + @param radius: Outside radius of the wire. + @param material: Wire material. Values are: "aluminum", "copper", "other", "steel", "acsr" + @param rDC20: DC resistance per unit length of the conductor at 20 oC. + @param sizeDescription: Describes the wire guage or cross section (e.g., 4/0, #2, 336.5). + @param rAC75: AC resistance per unit length of the conductor at 75 oC. + @param gmr: Geometric mean radius. If we replace the conductor by a thin walled tube of radius GMR, then its reactance is identical to the reactance of the actual conductor. + @param ratedCurrent: Current carrying capacity of the wire under stated thermal conditions. + @param strandCount: Number of strands in the wire. + @param rAC25: AC resistance per unit length of the conductor at 25 oC. + @param WireArrangements: All wire arrangements using this wire type. + @param ConcentricNeutralCableInfos: All concentric neutral cables using this wire type. + """ + #: (if there is a different core material) Radius of the central core. + self.coreRadius = coreRadius + + #: AC resistance per unit length of the conductor at 50 oC. + self.rAC50 = rAC50 + + #: (if used) Number of strands in the steel core. + self.coreStrandCount = coreStrandCount + + #: Outside radius of the wire. + self.radius = radius + + #: Wire material. Values are: "aluminum", "copper", "other", "steel", "acsr" + self.material = material + + #: DC resistance per unit length of the conductor at 20 oC. + self.rDC20 = rDC20 + + #: Describes the wire guage or cross section (e.g., 4/0, #2, 336.5). + self.sizeDescription = sizeDescription + + #: AC resistance per unit length of the conductor at 75 oC. + self.rAC75 = rAC75 + + #: Geometric mean radius. If we replace the conductor by a thin walled tube of radius GMR, then its reactance is identical to the reactance of the actual conductor. + self.gmr = gmr + + #: Current carrying capacity of the wire under stated thermal conditions. + self.ratedCurrent = ratedCurrent + + #: Number of strands in the wire. + self.strandCount = strandCount + + #: AC resistance per unit length of the conductor at 25 oC. + self.rAC25 = rAC25 + + self._WireArrangements = [] + self.WireArrangements = [] if WireArrangements is None else WireArrangements + + self._ConcentricNeutralCableInfos = [] + self.ConcentricNeutralCableInfos = [] if ConcentricNeutralCableInfos is None else ConcentricNeutralCableInfos + + super(WireType, self).__init__(*args, **kw_args) + + _attrs = ["coreRadius", "rAC50", "coreStrandCount", "radius", "material", "rDC20", "sizeDescription", "rAC75", "gmr", "ratedCurrent", "strandCount", "rAC25"] + _attr_types = {"coreRadius": float, "rAC50": float, "coreStrandCount": int, "radius": float, "material": str, "rDC20": float, "sizeDescription": str, "rAC75": float, "gmr": float, "ratedCurrent": float, "strandCount": int, "rAC25": float} + _defaults = {"coreRadius": 0.0, "rAC50": 0.0, "coreStrandCount": 0, "radius": 0.0, "material": "aluminum", "rDC20": 0.0, "sizeDescription": '', "rAC75": 0.0, "gmr": 0.0, "ratedCurrent": 0.0, "strandCount": 0, "rAC25": 0.0} + _enums = {"material": "ConductorMaterialKind"} + _refs = ["WireArrangements", "ConcentricNeutralCableInfos"] + _many_refs = ["WireArrangements", "ConcentricNeutralCableInfos"] + + def getWireArrangements(self): + """All wire arrangements using this wire type. + """ + return self._WireArrangements + + def setWireArrangements(self, value): + for x in self._WireArrangements: + x.WireType = None + for y in value: + y._WireType = self + self._WireArrangements = value + + WireArrangements = property(getWireArrangements, setWireArrangements) + + def addWireArrangements(self, *WireArrangements): + for obj in WireArrangements: + obj.WireType = self + + def removeWireArrangements(self, *WireArrangements): + for obj in WireArrangements: + obj.WireType = None + + def getConcentricNeutralCableInfos(self): + """All concentric neutral cables using this wire type. + """ + return self._ConcentricNeutralCableInfos + + def setConcentricNeutralCableInfos(self, value): + for x in self._ConcentricNeutralCableInfos: + x.WireType = None + for y in value: + y._WireType = self + self._ConcentricNeutralCableInfos = value + + ConcentricNeutralCableInfos = property(getConcentricNeutralCableInfos, setConcentricNeutralCableInfos) + + def addConcentricNeutralCableInfos(self, *ConcentricNeutralCableInfos): + for obj in ConcentricNeutralCableInfos: + obj.WireType = self + + def removeConcentricNeutralCableInfos(self, *ConcentricNeutralCableInfos): + for obj in ConcentricNeutralCableInfos: + obj.WireType = None + diff --git a/CIM16/IEC61968/AssetModels/__init__.py b/CIM16/IEC61968/AssetModels/__init__.py new file mode 100755 index 00000000..e59fb621 --- /dev/null +++ b/CIM16/IEC61968/AssetModels/__init__.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package is an extension of Assets package and contains the core information classes that support asset management and different network and work planning applications with specialized AssetInfo subclasses. They hold attributes that can be referenced by not only Asset-s or AssetModel-s but also by ConductingEquipment-s. +""" + +from CIM16.IEC61968.AssetModels.ShortCircuitTest import ShortCircuitTest +from CIM16.IEC61968.AssetModels.EndDeviceInfo import EndDeviceInfo +from CIM16.IEC61968.AssetModels.WireType import WireType +from CIM16.IEC61968.AssetModels.TapeShieldCableInfo import TapeShieldCableInfo +from CIM16.IEC61968.AssetModels.ConductorInfo import ConductorInfo +from CIM16.IEC61968.AssetModels.TapChangerInfo import TapChangerInfo +from CIM16.IEC61968.AssetModels.TransformerTankInfo import TransformerTankInfo +from CIM16.IEC61968.AssetModels.PowerTransformerInfo import PowerTransformerInfo +from CIM16.IEC61968.AssetModels.OpenCircuitTest import OpenCircuitTest +from CIM16.IEC61968.AssetModels.CableInfo import CableInfo +from CIM16.IEC61968.AssetModels.TransformerEndInfo import TransformerEndInfo +from CIM16.IEC61968.AssetModels.NoLoadTest import NoLoadTest +from CIM16.IEC61968.AssetModels.OverheadConductorInfo import OverheadConductorInfo +from CIM16.IEC61968.AssetModels.ConcentricNeutralCableInfo import ConcentricNeutralCableInfo +from CIM16.IEC61968.AssetModels.WireArrangement import WireArrangement +from CIM16.IEC61968.AssetModels.TransformerTest import TransformerTest + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#AssetModels" +nsPrefix = "cimAssetModels" + + +class CableOuterJacketKind(str): + """Values are: pvc, linearLowDensityPolyethylene, none, insulating, other, polyethylene, semiconducting + """ + pass + +class ConductorMaterialKind(str): + """Values are: aluminum, copper, other, steel, acsr + """ + pass + +class ConductorUsageKind(str): + """Values are: secondary, other, distribution, transmission + """ + pass + +class CableConstructionKind(str): + """Values are: sector, other, solid, compacted, stranded, segmental, compressed + """ + pass + +class CableShieldMaterialKind(str): + """Values are: lead, aluminum, other, copper, steel + """ + pass + +class ConductorInsulationKind(str): + """Values are: treeRetardantCrosslinkedPolyethylene, butyl, highPressureFluidFilled, other, varnishedCambricCloth, siliconRubber, beltedPilc, crosslinkedPolyethylene, oilPaper, lowCapacitanceRubber, asbestosAndVarnishedCambric, treeResistantHighMolecularWeightPolyethylene, unbeltedPilc, ozoneResistantRubber, ethylenePropyleneRubber, highMolecularWeightPolyethylene, varnishedDacronGlass, rubber + """ + pass diff --git a/CIM16/IEC61968/Assets/AcceptanceTest.py b/CIM16/IEC61968/Assets/AcceptanceTest.py new file mode 100755 index 00000000..44bfede9 --- /dev/null +++ b/CIM16/IEC61968/Assets/AcceptanceTest.py @@ -0,0 +1,49 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class AcceptanceTest(object): + """Acceptance test for assets.Acceptance test for assets. + """ + + def __init__(self, success=False, dateTime='', type=''): + """Initialises a new 'AcceptanceTest' instance. + + @param success: True if asset has passed acceptance test and may be placed in or is in service. It is set to false if asset is removed from service and is required to be tested again before being placed back in service, possibly in a new location. Since asset may go through multiple tests during its life cycle, the date of each acceptance test may be recorded in Asset.ActivityRecord.status.dateTime. + @param dateTime: Date and time the asset was last tested using the 'type' of test and yielding the current status in 'success' attribute. + @param type: Type of test or group of tests that was conducted on 'dateTime'. + """ + #: True if asset has passed acceptance test and may be placed in or is in service. It is set to false if asset is removed from service and is required to be tested again before being placed back in service, possibly in a new location. Since asset may go through multiple tests during its life cycle, the date of each acceptance test may be recorded in Asset.ActivityRecord.status.dateTime. + self.success = success + + #: Date and time the asset was last tested using the 'type' of test and yielding the current status in 'success' attribute. + self.dateTime = dateTime + + #: Type of test or group of tests that was conducted on 'dateTime'. + self.type = type + + + _attrs = ["success", "dateTime", "type"] + _attr_types = {"success": bool, "dateTime": str, "type": str} + _defaults = {"success": False, "dateTime": '', "type": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/Assets/Asset.py b/CIM16/IEC61968/Assets/Asset.py new file mode 100755 index 00000000..7795432e --- /dev/null +++ b/CIM16/IEC61968/Assets/Asset.py @@ -0,0 +1,701 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Asset(IdentifiedObject): + """Tangible resource of the utility, including power system equipment, cabinets, buildings, etc. For electrical network equipment, the role of the asset is defined through PowerSystemResource and its subclasses, defined mainly in the Wires model (refer to IEC61970-301 and model package IEC61970::Wires). Asset description places emphasis on the physical characteristics of the equipment fulfilling that role.Tangible resource of the utility, including power system equipment, cabinets, buildings, etc. For electrical network equipment, the role of the asset is defined through PowerSystemResource and its subclasses, defined mainly in the Wires model (refer to IEC61970-301 and model package IEC61970::Wires). Asset description places emphasis on the physical characteristics of the equipment fulfilling that role. + """ + + def __init__(self, corporateCode='', utcNumber='', initialCondition='', category='', serialNumber='', critical=False, application='', purchasePrice=0.0, initialLossOfLife=0.0, manufacturedDate='', installationDate='', lotNumber='', DocumentRoles=None, Mediums=None, ErpRecDeliveryItems=None, Ratings=None, ToAssetRoles=None, electronicAddress=None, FromAssetRoles=None, AssetFunctions=None, ErpItemMaster=None, ErpInventory=None, ReliabilityInfos=None, AssetInfo=None, WorkTask=None, acceptanceTest=None, ErpOrganisationRoles=None, ScheduledEvents=None, AssetContainer=None, AssetPropertyCurves=None, ChangeItems=None, ActivityRecords=None, Location=None, status=None, PowerSystemResources=None, FinancialInfo=None, Properties=None, Measurements=None, *args, **kw_args): + """Initialises a new 'Asset' instance. + + @param corporateCode: Code for this type of asset. + @param utcNumber: Uniquely tracked commodity (UTC) number. + @param initialCondition: Condition of asset in inventory or at time of installation. Examples include new, rebuilt, overhaul required, other. Refer to inspection data for information on the most current condition of the asset. + @param category: Extension mechanism to accommodate utility-specific categorisation of Asset and its subtypes, according to their corporate standards, practices, and existing IT systems (e.g., for management of assets, maintenance, work, outage, customers, etc.). + @param serialNumber: Serial number of this asset. + @param critical: True if asset is considered critical for some reason (for example, a pole with critical attachments). + @param application: The way this particular asset is being used in this installation. For example, the application of a bushing when attached to a specific transformer winding would be one of the following: H1, H2, H3, H0, X1, X2, X3, X0, Y1, Y2, Y3, Y0. + @param purchasePrice: Purchase price of asset. + @param initialLossOfLife: Whenever an asset is reconditioned, percentage of expected life for the asset when it was new; zero for new devices. + @param manufacturedDate: Date this asset was manufactured. + @param installationDate: (if applicable) Date current installation was completed, which may not be the same as the in-service date. Asset may have been installed at other locations previously. Ignored if asset is (1) not currently installed (e.g., stored in a depot) or (2) not intended to be installed (e.g., vehicle, tool). + @param lotNumber: Lot number for this asset. Even for the same model and version number, many assets are manufactured in lots. + @param DocumentRoles: + @param Mediums: + @param ErpRecDeliveryItems: + @param Ratings: UserAttributes used to specify ratings of this asset. Ratings also can be used to set the initial value of operational measurement limits. Use 'name' to specify what kind of rating it is (e.g., voltage, current), and 'value' attribute for the actual value and unit information of the rating. + @param ToAssetRoles: + @param electronicAddress: Electronic address. + @param FromAssetRoles: + @param AssetFunctions: + @param ErpItemMaster: + @param ErpInventory: + @param ReliabilityInfos: + @param AssetInfo: Data applicable to this asset. + @param WorkTask: + @param acceptanceTest: Information on acceptance test. + @param ErpOrganisationRoles: + @param ScheduledEvents: + @param AssetContainer: + @param AssetPropertyCurves: + @param ChangeItems: + @param ActivityRecords: All activity records created for this asset. + @param Location: Location of this asset. + @param status: Status of this asset. + @param PowerSystemResources: All power system resources used to electrically model this asset. For example, transformer asset is electrically modelled with a transformer and its windings and tap changer. + @param FinancialInfo: + @param Properties: UserAttributes used to specify further properties of this asset. Use 'name' to specify what kind of property it is, and 'value.value' attribute for the actual value. + @param Measurements: + """ + #: Code for this type of asset. + self.corporateCode = corporateCode + + #: Uniquely tracked commodity (UTC) number. + self.utcNumber = utcNumber + + #: Condition of asset in inventory or at time of installation. Examples include new, rebuilt, overhaul required, other. Refer to inspection data for information on the most current condition of the asset. + self.initialCondition = initialCondition + + #: Extension mechanism to accommodate utility-specific categorisation of Asset and its subtypes, according to their corporate standards, practices, and existing IT systems (e.g., for management of assets, maintenance, work, outage, customers, etc.). + self.category = category + + #: Serial number of this asset. + self.serialNumber = serialNumber + + #: True if asset is considered critical for some reason (for example, a pole with critical attachments). + self.critical = critical + + #: The way this particular asset is being used in this installation. For example, the application of a bushing when attached to a specific transformer winding would be one of the following: H1, H2, H3, H0, X1, X2, X3, X0, Y1, Y2, Y3, Y0. + self.application = application + + #: Purchase price of asset. + self.purchasePrice = purchasePrice + + #: Whenever an asset is reconditioned, percentage of expected life for the asset when it was new; zero for new devices. + self.initialLossOfLife = initialLossOfLife + + #: Date this asset was manufactured. + self.manufacturedDate = manufacturedDate + + #: (if applicable) Date current installation was completed, which may not be the same as the in-service date. Asset may have been installed at other locations previously. Ignored if asset is (1) not currently installed (e.g., stored in a depot) or (2) not intended to be installed (e.g., vehicle, tool). + self.installationDate = installationDate + + #: Lot number for this asset. Even for the same model and version number, many assets are manufactured in lots. + self.lotNumber = lotNumber + + self._DocumentRoles = [] + self.DocumentRoles = [] if DocumentRoles is None else DocumentRoles + + self._Mediums = [] + self.Mediums = [] if Mediums is None else Mediums + + self._ErpRecDeliveryItems = [] + self.ErpRecDeliveryItems = [] if ErpRecDeliveryItems is None else ErpRecDeliveryItems + + self._Ratings = [] + self.Ratings = [] if Ratings is None else Ratings + + self._ToAssetRoles = [] + self.ToAssetRoles = [] if ToAssetRoles is None else ToAssetRoles + + self.electronicAddress = electronicAddress + + self._FromAssetRoles = [] + self.FromAssetRoles = [] if FromAssetRoles is None else FromAssetRoles + + self._AssetFunctions = [] + self.AssetFunctions = [] if AssetFunctions is None else AssetFunctions + + self._ErpItemMaster = None + self.ErpItemMaster = ErpItemMaster + + self._ErpInventory = None + self.ErpInventory = ErpInventory + + self._ReliabilityInfos = [] + self.ReliabilityInfos = [] if ReliabilityInfos is None else ReliabilityInfos + + self._AssetInfo = None + self.AssetInfo = AssetInfo + + self._WorkTask = None + self.WorkTask = WorkTask + + self.acceptanceTest = acceptanceTest + + self._ErpOrganisationRoles = [] + self.ErpOrganisationRoles = [] if ErpOrganisationRoles is None else ErpOrganisationRoles + + self._ScheduledEvents = [] + self.ScheduledEvents = [] if ScheduledEvents is None else ScheduledEvents + + self._AssetContainer = None + self.AssetContainer = AssetContainer + + self._AssetPropertyCurves = [] + self.AssetPropertyCurves = [] if AssetPropertyCurves is None else AssetPropertyCurves + + self._ChangeItems = [] + self.ChangeItems = [] if ChangeItems is None else ChangeItems + + self._ActivityRecords = [] + self.ActivityRecords = [] if ActivityRecords is None else ActivityRecords + + self._Location = None + self.Location = Location + + self.status = status + + self._PowerSystemResources = [] + self.PowerSystemResources = [] if PowerSystemResources is None else PowerSystemResources + + self._FinancialInfo = None + self.FinancialInfo = FinancialInfo + + self._Properties = [] + self.Properties = [] if Properties is None else Properties + + self._Measurements = [] + self.Measurements = [] if Measurements is None else Measurements + + super(Asset, self).__init__(*args, **kw_args) + + _attrs = ["corporateCode", "utcNumber", "initialCondition", "category", "serialNumber", "critical", "application", "purchasePrice", "initialLossOfLife", "manufacturedDate", "installationDate", "lotNumber"] + _attr_types = {"corporateCode": str, "utcNumber": str, "initialCondition": str, "category": str, "serialNumber": str, "critical": bool, "application": str, "purchasePrice": float, "initialLossOfLife": float, "manufacturedDate": str, "installationDate": str, "lotNumber": str} + _defaults = {"corporateCode": '', "utcNumber": '', "initialCondition": '', "category": '', "serialNumber": '', "critical": False, "application": '', "purchasePrice": 0.0, "initialLossOfLife": 0.0, "manufacturedDate": '', "installationDate": '', "lotNumber": ''} + _enums = {} + _refs = ["DocumentRoles", "Mediums", "ErpRecDeliveryItems", "Ratings", "ToAssetRoles", "electronicAddress", "FromAssetRoles", "AssetFunctions", "ErpItemMaster", "ErpInventory", "ReliabilityInfos", "AssetInfo", "WorkTask", "acceptanceTest", "ErpOrganisationRoles", "ScheduledEvents", "AssetContainer", "AssetPropertyCurves", "ChangeItems", "ActivityRecords", "Location", "status", "PowerSystemResources", "FinancialInfo", "Properties", "Measurements"] + _many_refs = ["DocumentRoles", "Mediums", "ErpRecDeliveryItems", "Ratings", "ToAssetRoles", "FromAssetRoles", "AssetFunctions", "ReliabilityInfos", "ErpOrganisationRoles", "ScheduledEvents", "AssetPropertyCurves", "ChangeItems", "ActivityRecords", "PowerSystemResources", "Properties", "Measurements"] + + def getDocumentRoles(self): + + return self._DocumentRoles + + def setDocumentRoles(self, value): + for x in self._DocumentRoles: + x.Asset = None + for y in value: + y._Asset = self + self._DocumentRoles = value + + DocumentRoles = property(getDocumentRoles, setDocumentRoles) + + def addDocumentRoles(self, *DocumentRoles): + for obj in DocumentRoles: + obj.Asset = self + + def removeDocumentRoles(self, *DocumentRoles): + for obj in DocumentRoles: + obj.Asset = None + + def getMediums(self): + + return self._Mediums + + def setMediums(self, value): + for p in self._Mediums: + filtered = [q for q in p.Assets if q != self] + self._Mediums._Assets = filtered + for r in value: + if self not in r._Assets: + r._Assets.append(self) + self._Mediums = value + + Mediums = property(getMediums, setMediums) + + def addMediums(self, *Mediums): + for obj in Mediums: + if self not in obj._Assets: + obj._Assets.append(self) + self._Mediums.append(obj) + + def removeMediums(self, *Mediums): + for obj in Mediums: + if self in obj._Assets: + obj._Assets.remove(self) + self._Mediums.remove(obj) + + def getErpRecDeliveryItems(self): + + return self._ErpRecDeliveryItems + + def setErpRecDeliveryItems(self, value): + for p in self._ErpRecDeliveryItems: + filtered = [q for q in p.Assets if q != self] + self._ErpRecDeliveryItems._Assets = filtered + for r in value: + if self not in r._Assets: + r._Assets.append(self) + self._ErpRecDeliveryItems = value + + ErpRecDeliveryItems = property(getErpRecDeliveryItems, setErpRecDeliveryItems) + + def addErpRecDeliveryItems(self, *ErpRecDeliveryItems): + for obj in ErpRecDeliveryItems: + if self not in obj._Assets: + obj._Assets.append(self) + self._ErpRecDeliveryItems.append(obj) + + def removeErpRecDeliveryItems(self, *ErpRecDeliveryItems): + for obj in ErpRecDeliveryItems: + if self in obj._Assets: + obj._Assets.remove(self) + self._ErpRecDeliveryItems.remove(obj) + + def getRatings(self): + """UserAttributes used to specify ratings of this asset. Ratings also can be used to set the initial value of operational measurement limits. Use 'name' to specify what kind of rating it is (e.g., voltage, current), and 'value' attribute for the actual value and unit information of the rating. + """ + return self._Ratings + + def setRatings(self, value): + for p in self._Ratings: + filtered = [q for q in p.RatingAssets if q != self] + self._Ratings._RatingAssets = filtered + for r in value: + if self not in r._RatingAssets: + r._RatingAssets.append(self) + self._Ratings = value + + Ratings = property(getRatings, setRatings) + + def addRatings(self, *Ratings): + for obj in Ratings: + if self not in obj._RatingAssets: + obj._RatingAssets.append(self) + self._Ratings.append(obj) + + def removeRatings(self, *Ratings): + for obj in Ratings: + if self in obj._RatingAssets: + obj._RatingAssets.remove(self) + self._Ratings.remove(obj) + + def getToAssetRoles(self): + + return self._ToAssetRoles + + def setToAssetRoles(self, value): + for x in self._ToAssetRoles: + x.FromAsset = None + for y in value: + y._FromAsset = self + self._ToAssetRoles = value + + ToAssetRoles = property(getToAssetRoles, setToAssetRoles) + + def addToAssetRoles(self, *ToAssetRoles): + for obj in ToAssetRoles: + obj.FromAsset = self + + def removeToAssetRoles(self, *ToAssetRoles): + for obj in ToAssetRoles: + obj.FromAsset = None + + # Electronic address. + electronicAddress = None + + def getFromAssetRoles(self): + + return self._FromAssetRoles + + def setFromAssetRoles(self, value): + for x in self._FromAssetRoles: + x.ToAsset = None + for y in value: + y._ToAsset = self + self._FromAssetRoles = value + + FromAssetRoles = property(getFromAssetRoles, setFromAssetRoles) + + def addFromAssetRoles(self, *FromAssetRoles): + for obj in FromAssetRoles: + obj.ToAsset = self + + def removeFromAssetRoles(self, *FromAssetRoles): + for obj in FromAssetRoles: + obj.ToAsset = None + + def getAssetFunctions(self): + + return self._AssetFunctions + + def setAssetFunctions(self, value): + for x in self._AssetFunctions: + x.Asset = None + for y in value: + y._Asset = self + self._AssetFunctions = value + + AssetFunctions = property(getAssetFunctions, setAssetFunctions) + + def addAssetFunctions(self, *AssetFunctions): + for obj in AssetFunctions: + obj.Asset = self + + def removeAssetFunctions(self, *AssetFunctions): + for obj in AssetFunctions: + obj.Asset = None + + def getErpItemMaster(self): + + return self._ErpItemMaster + + def setErpItemMaster(self, value): + if self._ErpItemMaster is not None: + self._ErpItemMaster._Asset = None + + self._ErpItemMaster = value + if self._ErpItemMaster is not None: + self._ErpItemMaster.Asset = None + self._ErpItemMaster._Asset = self + + ErpItemMaster = property(getErpItemMaster, setErpItemMaster) + + def getErpInventory(self): + + return self._ErpInventory + + def setErpInventory(self, value): + if self._ErpInventory is not None: + self._ErpInventory._Asset = None + + self._ErpInventory = value + if self._ErpInventory is not None: + self._ErpInventory.Asset = None + self._ErpInventory._Asset = self + + ErpInventory = property(getErpInventory, setErpInventory) + + def getReliabilityInfos(self): + + return self._ReliabilityInfos + + def setReliabilityInfos(self, value): + for p in self._ReliabilityInfos: + filtered = [q for q in p.Assets if q != self] + self._ReliabilityInfos._Assets = filtered + for r in value: + if self not in r._Assets: + r._Assets.append(self) + self._ReliabilityInfos = value + + ReliabilityInfos = property(getReliabilityInfos, setReliabilityInfos) + + def addReliabilityInfos(self, *ReliabilityInfos): + for obj in ReliabilityInfos: + if self not in obj._Assets: + obj._Assets.append(self) + self._ReliabilityInfos.append(obj) + + def removeReliabilityInfos(self, *ReliabilityInfos): + for obj in ReliabilityInfos: + if self in obj._Assets: + obj._Assets.remove(self) + self._ReliabilityInfos.remove(obj) + + def getAssetInfo(self): + """Data applicable to this asset. + """ + return self._AssetInfo + + def setAssetInfo(self, value): + if self._AssetInfo is not None: + self._AssetInfo._Assets = None + + self._AssetInfo = value + if self._AssetInfo is not None: + self._AssetInfo.Assets = None + self._AssetInfo._Assets = self + + AssetInfo = property(getAssetInfo, setAssetInfo) + + def getWorkTask(self): + + return self._WorkTask + + def setWorkTask(self, value): + if self._WorkTask is not None: + filtered = [x for x in self.WorkTask.Assets if x != self] + self._WorkTask._Assets = filtered + + self._WorkTask = value + if self._WorkTask is not None: + if self not in self._WorkTask._Assets: + self._WorkTask._Assets.append(self) + + WorkTask = property(getWorkTask, setWorkTask) + + # Information on acceptance test. + acceptanceTest = None + + def getErpOrganisationRoles(self): + + return self._ErpOrganisationRoles + + def setErpOrganisationRoles(self, value): + for x in self._ErpOrganisationRoles: + x.Asset = None + for y in value: + y._Asset = self + self._ErpOrganisationRoles = value + + ErpOrganisationRoles = property(getErpOrganisationRoles, setErpOrganisationRoles) + + def addErpOrganisationRoles(self, *ErpOrganisationRoles): + for obj in ErpOrganisationRoles: + obj.Asset = self + + def removeErpOrganisationRoles(self, *ErpOrganisationRoles): + for obj in ErpOrganisationRoles: + obj.Asset = None + + def getScheduledEvents(self): + + return self._ScheduledEvents + + def setScheduledEvents(self, value): + for p in self._ScheduledEvents: + filtered = [q for q in p.Assets if q != self] + self._ScheduledEvents._Assets = filtered + for r in value: + if self not in r._Assets: + r._Assets.append(self) + self._ScheduledEvents = value + + ScheduledEvents = property(getScheduledEvents, setScheduledEvents) + + def addScheduledEvents(self, *ScheduledEvents): + for obj in ScheduledEvents: + if self not in obj._Assets: + obj._Assets.append(self) + self._ScheduledEvents.append(obj) + + def removeScheduledEvents(self, *ScheduledEvents): + for obj in ScheduledEvents: + if self in obj._Assets: + obj._Assets.remove(self) + self._ScheduledEvents.remove(obj) + + def getAssetContainer(self): + + return self._AssetContainer + + def setAssetContainer(self, value): + if self._AssetContainer is not None: + filtered = [x for x in self.AssetContainer.Assets if x != self] + self._AssetContainer._Assets = filtered + + self._AssetContainer = value + if self._AssetContainer is not None: + if self not in self._AssetContainer._Assets: + self._AssetContainer._Assets.append(self) + + AssetContainer = property(getAssetContainer, setAssetContainer) + + def getAssetPropertyCurves(self): + + return self._AssetPropertyCurves + + def setAssetPropertyCurves(self, value): + for p in self._AssetPropertyCurves: + filtered = [q for q in p.Assets if q != self] + self._AssetPropertyCurves._Assets = filtered + for r in value: + if self not in r._Assets: + r._Assets.append(self) + self._AssetPropertyCurves = value + + AssetPropertyCurves = property(getAssetPropertyCurves, setAssetPropertyCurves) + + def addAssetPropertyCurves(self, *AssetPropertyCurves): + for obj in AssetPropertyCurves: + if self not in obj._Assets: + obj._Assets.append(self) + self._AssetPropertyCurves.append(obj) + + def removeAssetPropertyCurves(self, *AssetPropertyCurves): + for obj in AssetPropertyCurves: + if self in obj._Assets: + obj._Assets.remove(self) + self._AssetPropertyCurves.remove(obj) + + def getChangeItems(self): + + return self._ChangeItems + + def setChangeItems(self, value): + for x in self._ChangeItems: + x.Asset = None + for y in value: + y._Asset = self + self._ChangeItems = value + + ChangeItems = property(getChangeItems, setChangeItems) + + def addChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.Asset = self + + def removeChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.Asset = None + + def getActivityRecords(self): + """All activity records created for this asset. + """ + return self._ActivityRecords + + def setActivityRecords(self, value): + for p in self._ActivityRecords: + filtered = [q for q in p.Assets if q != self] + self._ActivityRecords._Assets = filtered + for r in value: + if self not in r._Assets: + r._Assets.append(self) + self._ActivityRecords = value + + ActivityRecords = property(getActivityRecords, setActivityRecords) + + def addActivityRecords(self, *ActivityRecords): + for obj in ActivityRecords: + if self not in obj._Assets: + obj._Assets.append(self) + self._ActivityRecords.append(obj) + + def removeActivityRecords(self, *ActivityRecords): + for obj in ActivityRecords: + if self in obj._Assets: + obj._Assets.remove(self) + self._ActivityRecords.remove(obj) + + def getLocation(self): + """Location of this asset. + """ + return self._Location + + def setLocation(self, value): + if self._Location is not None: + filtered = [x for x in self.Location.Assets if x != self] + self._Location._Assets = filtered + + self._Location = value + if self._Location is not None: + if self not in self._Location._Assets: + self._Location._Assets.append(self) + + Location = property(getLocation, setLocation) + + # Status of this asset. + status = None + + def getPowerSystemResources(self): + """All power system resources used to electrically model this asset. For example, transformer asset is electrically modelled with a transformer and its windings and tap changer. + """ + return self._PowerSystemResources + + def setPowerSystemResources(self, value): + for p in self._PowerSystemResources: + filtered = [q for q in p.Assets if q != self] + self._PowerSystemResources._Assets = filtered + for r in value: + if self not in r._Assets: + r._Assets.append(self) + self._PowerSystemResources = value + + PowerSystemResources = property(getPowerSystemResources, setPowerSystemResources) + + def addPowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + if self not in obj._Assets: + obj._Assets.append(self) + self._PowerSystemResources.append(obj) + + def removePowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + if self in obj._Assets: + obj._Assets.remove(self) + self._PowerSystemResources.remove(obj) + + def getFinancialInfo(self): + + return self._FinancialInfo + + def setFinancialInfo(self, value): + if self._FinancialInfo is not None: + self._FinancialInfo._Asset = None + + self._FinancialInfo = value + if self._FinancialInfo is not None: + self._FinancialInfo.Asset = None + self._FinancialInfo._Asset = self + + FinancialInfo = property(getFinancialInfo, setFinancialInfo) + + def getProperties(self): + """UserAttributes used to specify further properties of this asset. Use 'name' to specify what kind of property it is, and 'value.value' attribute for the actual value. + """ + return self._Properties + + def setProperties(self, value): + for p in self._Properties: + filtered = [q for q in p.PropertyAssets if q != self] + self._Properties._PropertyAssets = filtered + for r in value: + if self not in r._PropertyAssets: + r._PropertyAssets.append(self) + self._Properties = value + + Properties = property(getProperties, setProperties) + + def addProperties(self, *Properties): + for obj in Properties: + if self not in obj._PropertyAssets: + obj._PropertyAssets.append(self) + self._Properties.append(obj) + + def removeProperties(self, *Properties): + for obj in Properties: + if self in obj._PropertyAssets: + obj._PropertyAssets.remove(self) + self._Properties.remove(obj) + + def getMeasurements(self): + + return self._Measurements + + def setMeasurements(self, value): + for x in self._Measurements: + x.Asset = None + for y in value: + y._Asset = self + self._Measurements = value + + Measurements = property(getMeasurements, setMeasurements) + + def addMeasurements(self, *Measurements): + for obj in Measurements: + obj.Asset = self + + def removeMeasurements(self, *Measurements): + for obj in Measurements: + obj.Asset = None + diff --git a/CIM16/IEC61968/Assets/AssetContainer.py b/CIM16/IEC61968/Assets/AssetContainer.py new file mode 100755 index 00000000..9c0c2f8c --- /dev/null +++ b/CIM16/IEC61968/Assets/AssetContainer.py @@ -0,0 +1,121 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.Asset import Asset + +class AssetContainer(Asset): + """Asset that is aggregation of other assets such as conductors, transformers, switchgear, land, fences, buildings, equipment, vehicles, etc.Asset that is aggregation of other assets such as conductors, transformers, switchgear, land, fences, buildings, equipment, vehicles, etc. + """ + + def __init__(self, Seals=None, Assets=None, LandProperties=None, *args, **kw_args): + """Initialises a new 'AssetContainer' instance. + + @param Seals: All seals applied to this asset container. + @param Assets: + @param LandProperties: + """ + self._Seals = [] + self.Seals = [] if Seals is None else Seals + + self._Assets = [] + self.Assets = [] if Assets is None else Assets + + self._LandProperties = [] + self.LandProperties = [] if LandProperties is None else LandProperties + + super(AssetContainer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Seals", "Assets", "LandProperties"] + _many_refs = ["Seals", "Assets", "LandProperties"] + + def getSeals(self): + """All seals applied to this asset container. + """ + return self._Seals + + def setSeals(self, value): + for x in self._Seals: + x.AssetContainer = None + for y in value: + y._AssetContainer = self + self._Seals = value + + Seals = property(getSeals, setSeals) + + def addSeals(self, *Seals): + for obj in Seals: + obj.AssetContainer = self + + def removeSeals(self, *Seals): + for obj in Seals: + obj.AssetContainer = None + + def getAssets(self): + + return self._Assets + + def setAssets(self, value): + for x in self._Assets: + x.AssetContainer = None + for y in value: + y._AssetContainer = self + self._Assets = value + + Assets = property(getAssets, setAssets) + + def addAssets(self, *Assets): + for obj in Assets: + obj.AssetContainer = self + + def removeAssets(self, *Assets): + for obj in Assets: + obj.AssetContainer = None + + def getLandProperties(self): + + return self._LandProperties + + def setLandProperties(self, value): + for p in self._LandProperties: + filtered = [q for q in p.AssetContainers if q != self] + self._LandProperties._AssetContainers = filtered + for r in value: + if self not in r._AssetContainers: + r._AssetContainers.append(self) + self._LandProperties = value + + LandProperties = property(getLandProperties, setLandProperties) + + def addLandProperties(self, *LandProperties): + for obj in LandProperties: + if self not in obj._AssetContainers: + obj._AssetContainers.append(self) + self._LandProperties.append(obj) + + def removeLandProperties(self, *LandProperties): + for obj in LandProperties: + if self in obj._AssetContainers: + obj._AssetContainers.remove(self) + self._LandProperties.remove(obj) + diff --git a/CIM16/IEC61968/Assets/AssetFunction.py b/CIM16/IEC61968/Assets/AssetFunction.py new file mode 100755 index 00000000..500ad7df --- /dev/null +++ b/CIM16/IEC61968/Assets/AssetFunction.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class AssetFunction(IdentifiedObject): + """Function performed by an asset.Function performed by an asset. + """ + + def __init__(self, password='', hardwareID='', firmwareID='', programID='', configID='', Asset=None, *args, **kw_args): + """Initialises a new 'AssetFunction' instance. + + @param password: Password needed to access this function. + @param hardwareID: Hardware version. + @param firmwareID: Firmware version. + @param programID: Name of program. + @param configID: Configuration specified for this function. + @param Asset: + """ + #: Password needed to access this function. + self.password = password + + #: Hardware version. + self.hardwareID = hardwareID + + #: Firmware version. + self.firmwareID = firmwareID + + #: Name of program. + self.programID = programID + + #: Configuration specified for this function. + self.configID = configID + + self._Asset = None + self.Asset = Asset + + super(AssetFunction, self).__init__(*args, **kw_args) + + _attrs = ["password", "hardwareID", "firmwareID", "programID", "configID"] + _attr_types = {"password": str, "hardwareID": str, "firmwareID": str, "programID": str, "configID": str} + _defaults = {"password": '', "hardwareID": '', "firmwareID": '', "programID": '', "configID": ''} + _enums = {} + _refs = ["Asset"] + _many_refs = [] + + def getAsset(self): + + return self._Asset + + def setAsset(self, value): + if self._Asset is not None: + filtered = [x for x in self.Asset.AssetFunctions if x != self] + self._Asset._AssetFunctions = filtered + + self._Asset = value + if self._Asset is not None: + if self not in self._Asset._AssetFunctions: + self._Asset._AssetFunctions.append(self) + + Asset = property(getAsset, setAsset) + diff --git a/CIM16/IEC61968/Assets/AssetInfo.py b/CIM16/IEC61968/Assets/AssetInfo.py new file mode 100755 index 00000000..27cc91f9 --- /dev/null +++ b/CIM16/IEC61968/Assets/AssetInfo.py @@ -0,0 +1,99 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class AssetInfo(IdentifiedObject): + """Set of attributes of an asset, representing typical data-sheet information of a physical device, that can be instantiated and shared in different data exchange contexts: - as attributes of an asset instance (installed or in stock) - as attributes of an asset model (product by a manufacturer) - as attributes of a type asset (generic type of an asset as used in designs/extension planning).Set of attributes of an asset, representing typical data-sheet information of a physical device, that can be instantiated and shared in different data exchange contexts: - as attributes of an asset instance (installed or in stock) - as attributes of an asset model (product by a manufacturer) - as attributes of a type asset (generic type of an asset as used in designs/extension planning). + """ + + def __init__(self, Assets=None, DimensionsInfo=None, AssetModel=None, *args, **kw_args): + """Initialises a new 'AssetInfo' instance. + + @param Assets: All assets described by this data. + @param DimensionsInfo: + @param AssetModel: Asset model described by this data. + """ + self._Assets = None + self.Assets = Assets + + self._DimensionsInfo = None + self.DimensionsInfo = DimensionsInfo + + self._AssetModel = None + self.AssetModel = AssetModel + + super(AssetInfo, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Assets", "DimensionsInfo", "AssetModel"] + _many_refs = [] + + def getAssets(self): + """All assets described by this data. + """ + return self._Assets + + def setAssets(self, value): + if self._Assets is not None: + self._Assets._AssetInfo = None + + self._Assets = value + if self._Assets is not None: + self._Assets.AssetInfo = None + self._Assets._AssetInfo = self + + Assets = property(getAssets, setAssets) + + def getDimensionsInfo(self): + + return self._DimensionsInfo + + def setDimensionsInfo(self, value): + if self._DimensionsInfo is not None: + filtered = [x for x in self.DimensionsInfo.AssetInfos if x != self] + self._DimensionsInfo._AssetInfos = filtered + + self._DimensionsInfo = value + if self._DimensionsInfo is not None: + if self not in self._DimensionsInfo._AssetInfos: + self._DimensionsInfo._AssetInfos.append(self) + + DimensionsInfo = property(getDimensionsInfo, setDimensionsInfo) + + def getAssetModel(self): + """Asset model described by this data. + """ + return self._AssetModel + + def setAssetModel(self, value): + if self._AssetModel is not None: + self._AssetModel._AssetInfo = None + + self._AssetModel = value + if self._AssetModel is not None: + self._AssetModel.AssetInfo = None + self._AssetModel._AssetInfo = self + + AssetModel = property(getAssetModel, setAssetModel) + diff --git a/CIM16/IEC61968/Assets/AssetModel.py b/CIM16/IEC61968/Assets/AssetModel.py new file mode 100755 index 00000000..d0c2e350 --- /dev/null +++ b/CIM16/IEC61968/Assets/AssetModel.py @@ -0,0 +1,84 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class AssetModel(IdentifiedObject): + """Model of an asset, either a product of a specific manufacturer or a generic asset model or material item. Data-sheet characteristics are available through the associated AssetInfo subclass and can be shared with asset or power system resource instances.Model of an asset, either a product of a specific manufacturer or a generic asset model or material item. Data-sheet characteristics are available through the associated AssetInfo subclass and can be shared with asset or power system resource instances. + """ + + def __init__(self, AssetInfo=None, ErpInventoryCounts=None, *args, **kw_args): + """Initialises a new 'AssetModel' instance. + + @param AssetInfo: Data applicable to this asset model. + @param ErpInventoryCounts: + """ + self._AssetInfo = None + self.AssetInfo = AssetInfo + + self._ErpInventoryCounts = [] + self.ErpInventoryCounts = [] if ErpInventoryCounts is None else ErpInventoryCounts + + super(AssetModel, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["AssetInfo", "ErpInventoryCounts"] + _many_refs = ["ErpInventoryCounts"] + + def getAssetInfo(self): + """Data applicable to this asset model. + """ + return self._AssetInfo + + def setAssetInfo(self, value): + if self._AssetInfo is not None: + self._AssetInfo._AssetModel = None + + self._AssetInfo = value + if self._AssetInfo is not None: + self._AssetInfo.AssetModel = None + self._AssetInfo._AssetModel = self + + AssetInfo = property(getAssetInfo, setAssetInfo) + + def getErpInventoryCounts(self): + + return self._ErpInventoryCounts + + def setErpInventoryCounts(self, value): + for x in self._ErpInventoryCounts: + x.AssetModel = None + for y in value: + y._AssetModel = self + self._ErpInventoryCounts = value + + ErpInventoryCounts = property(getErpInventoryCounts, setErpInventoryCounts) + + def addErpInventoryCounts(self, *ErpInventoryCounts): + for obj in ErpInventoryCounts: + obj.AssetModel = self + + def removeErpInventoryCounts(self, *ErpInventoryCounts): + for obj in ErpInventoryCounts: + obj.AssetModel = None + diff --git a/CIM16/IEC61968/Assets/ComMedia.py b/CIM16/IEC61968/Assets/ComMedia.py new file mode 100755 index 00000000..451c9e8e --- /dev/null +++ b/CIM16/IEC61968/Assets/ComMedia.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.Asset import Asset + +class ComMedia(Asset): + """Communication media such as fibre optic cable, power-line, telephone, etc.Communication media such as fibre optic cable, power-line, telephone, etc. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'ComMedia' instance. + + """ + super(ComMedia, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/Assets/ProductAssetModel.py b/CIM16/IEC61968/Assets/ProductAssetModel.py new file mode 100755 index 00000000..09e592e4 --- /dev/null +++ b/CIM16/IEC61968/Assets/ProductAssetModel.py @@ -0,0 +1,105 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetModel import AssetModel + +class ProductAssetModel(AssetModel): + """Asset model by a specific manufacturer.Asset model by a specific manufacturer. + """ + + def __init__(self, modelVersion='', usageKind="customerSubstation", corporateStandardKind="standard", modelNumber='', weightTotal=0.0, GenericAssetModelOrMaterial=None, AssetModelCatalogueItems=None, *args, **kw_args): + """Initialises a new 'ProductAssetModel' instance. + + @param modelVersion: Version number for product model, which indicates vintage of the product. + @param usageKind: Intended usage for this asset model. Values are: "customerSubstation", "transmission", "other", "substation", "unknown", "distributionOverhead", "distributionUnderground", "streetlight" + @param corporateStandardKind: Kind of corporate standard for this asset model. Values are: "standard", "underEvaluation", "other", "experimental" + @param modelNumber: Manufacturer's model number. + @param weightTotal: Total manufactured weight of asset. + @param GenericAssetModelOrMaterial: Generic asset model or material satisified by this product asset model. + @param AssetModelCatalogueItems: + """ + #: Version number for product model, which indicates vintage of the product. + self.modelVersion = modelVersion + + #: Intended usage for this asset model. Values are: "customerSubstation", "transmission", "other", "substation", "unknown", "distributionOverhead", "distributionUnderground", "streetlight" + self.usageKind = usageKind + + #: Kind of corporate standard for this asset model. Values are: "standard", "underEvaluation", "other", "experimental" + self.corporateStandardKind = corporateStandardKind + + #: Manufacturer's model number. + self.modelNumber = modelNumber + + #: Total manufactured weight of asset. + self.weightTotal = weightTotal + + self._GenericAssetModelOrMaterial = None + self.GenericAssetModelOrMaterial = GenericAssetModelOrMaterial + + self._AssetModelCatalogueItems = [] + self.AssetModelCatalogueItems = [] if AssetModelCatalogueItems is None else AssetModelCatalogueItems + + super(ProductAssetModel, self).__init__(*args, **kw_args) + + _attrs = ["modelVersion", "usageKind", "corporateStandardKind", "modelNumber", "weightTotal"] + _attr_types = {"modelVersion": str, "usageKind": str, "corporateStandardKind": str, "modelNumber": str, "weightTotal": float} + _defaults = {"modelVersion": '', "usageKind": "customerSubstation", "corporateStandardKind": "standard", "modelNumber": '', "weightTotal": 0.0} + _enums = {"usageKind": "AssetModelUsageKind", "corporateStandardKind": "CorporateStandardKind"} + _refs = ["GenericAssetModelOrMaterial", "AssetModelCatalogueItems"] + _many_refs = ["AssetModelCatalogueItems"] + + def getGenericAssetModelOrMaterial(self): + """Generic asset model or material satisified by this product asset model. + """ + return self._GenericAssetModelOrMaterial + + def setGenericAssetModelOrMaterial(self, value): + if self._GenericAssetModelOrMaterial is not None: + filtered = [x for x in self.GenericAssetModelOrMaterial.ProductAssetModels if x != self] + self._GenericAssetModelOrMaterial._ProductAssetModels = filtered + + self._GenericAssetModelOrMaterial = value + if self._GenericAssetModelOrMaterial is not None: + if self not in self._GenericAssetModelOrMaterial._ProductAssetModels: + self._GenericAssetModelOrMaterial._ProductAssetModels.append(self) + + GenericAssetModelOrMaterial = property(getGenericAssetModelOrMaterial, setGenericAssetModelOrMaterial) + + def getAssetModelCatalogueItems(self): + + return self._AssetModelCatalogueItems + + def setAssetModelCatalogueItems(self, value): + for x in self._AssetModelCatalogueItems: + x.AssetModel = None + for y in value: + y._AssetModel = self + self._AssetModelCatalogueItems = value + + AssetModelCatalogueItems = property(getAssetModelCatalogueItems, setAssetModelCatalogueItems) + + def addAssetModelCatalogueItems(self, *AssetModelCatalogueItems): + for obj in AssetModelCatalogueItems: + obj.AssetModel = self + + def removeAssetModelCatalogueItems(self, *AssetModelCatalogueItems): + for obj in AssetModelCatalogueItems: + obj.AssetModel = None + diff --git a/CIM16/IEC61968/Assets/Seal.py b/CIM16/IEC61968/Assets/Seal.py new file mode 100755 index 00000000..c6a60bc9 --- /dev/null +++ b/CIM16/IEC61968/Assets/Seal.py @@ -0,0 +1,76 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Seal(IdentifiedObject): + """Physically controls access to AssetContainers.Physically controls access to AssetContainers. + """ + + def __init__(self, appliedDateTime='', sealNumber='', kind="lead", condition="open", AssetContainer=None, *args, **kw_args): + """Initialises a new 'Seal' instance. + + @param appliedDateTime: Date and time this seal has been applied. + @param sealNumber: (reserved word) Seal number. + @param kind: Kind of seal. Values are: "lead", "other", "steel", "lock" + @param condition: Condition of seal. Values are: "open", "broken", "other", "missing", "locked" + @param AssetContainer: Asset container to which this seal is applied. + """ + #: Date and time this seal has been applied. + self.appliedDateTime = appliedDateTime + + #: (reserved word) Seal number. + self.sealNumber = sealNumber + + #: Kind of seal. Values are: "lead", "other", "steel", "lock" + self.kind = kind + + #: Condition of seal. Values are: "open", "broken", "other", "missing", "locked" + self.condition = condition + + self._AssetContainer = None + self.AssetContainer = AssetContainer + + super(Seal, self).__init__(*args, **kw_args) + + _attrs = ["appliedDateTime", "sealNumber", "kind", "condition"] + _attr_types = {"appliedDateTime": str, "sealNumber": str, "kind": str, "condition": str} + _defaults = {"appliedDateTime": '', "sealNumber": '', "kind": "lead", "condition": "open"} + _enums = {"kind": "SealKind", "condition": "SealConditionKind"} + _refs = ["AssetContainer"] + _many_refs = [] + + def getAssetContainer(self): + """Asset container to which this seal is applied. + """ + return self._AssetContainer + + def setAssetContainer(self, value): + if self._AssetContainer is not None: + filtered = [x for x in self.AssetContainer.Seals if x != self] + self._AssetContainer._Seals = filtered + + self._AssetContainer = value + if self._AssetContainer is not None: + if self not in self._AssetContainer._Seals: + self._AssetContainer._Seals.append(self) + + AssetContainer = property(getAssetContainer, setAssetContainer) + diff --git a/CIM16/IEC61968/Assets/__init__.py b/CIM16/IEC61968/Assets/__init__.py new file mode 100755 index 00000000..b6faf041 --- /dev/null +++ b/CIM16/IEC61968/Assets/__init__.py @@ -0,0 +1,56 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package contains the core information classes that support asset management applications that deal with the physical and lifecycle aspects of various network resources (as opposed to power system resource models defined in IEC61970::Wires package, which support network applications). +""" + +from CIM16.IEC61968.Assets.ProductAssetModel import ProductAssetModel +from CIM16.IEC61968.Assets.AssetModel import AssetModel +from CIM16.IEC61968.Assets.Asset import Asset +from CIM16.IEC61968.Assets.ComMedia import ComMedia +from CIM16.IEC61968.Assets.AssetContainer import AssetContainer +from CIM16.IEC61968.Assets.AssetFunction import AssetFunction +from CIM16.IEC61968.Assets.Seal import Seal +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo +from CIM16.IEC61968.Assets.AcceptanceTest import AcceptanceTest + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Assets" +nsPrefix = "cimAssets" + + +class CorporateStandardKind(str): + """Values are: standard, underEvaluation, other, experimental + """ + pass + +class SealConditionKind(str): + """Values are: open, broken, other, missing, locked + """ + pass + +class SealKind(str): + """Values are: lead, other, steel, lock + """ + pass + +class AssetModelUsageKind(str): + """Values are: customerSubstation, transmission, other, substation, unknown, distributionOverhead, distributionUnderground, streetlight + """ + pass diff --git a/CIM16/IEC61968/Common/ActivityRecord.py b/CIM16/IEC61968/Common/ActivityRecord.py new file mode 100755 index 00000000..57f231fd --- /dev/null +++ b/CIM16/IEC61968/Common/ActivityRecord.py @@ -0,0 +1,206 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ActivityRecord(IdentifiedObject): + """Records activity for an entity at a point in time; activity may be for an event that has already occurred or for a planned activity.Records activity for an entity at a point in time; activity may be for an event that has already occurred or for a planned activity. + """ + + def __init__(self, severity='', createdDateTime='', reason='', category='', ErpPersons=None, Organisations=None, Documents=None, Assets=None, status=None, ScheduledEvent=None, *args, **kw_args): + """Initialises a new 'ActivityRecord' instance. + + @param severity: Severity level of event resulting in this activity record. + @param createdDateTime: Date and time this activity record has been created (different from the 'status.dateTime', which is the time of a status change of the associated object, if applicable). + @param reason: Reason for event resulting in this activity record, typically supplied when user initiated. + @param category: Category of event resulting in this activity record. + @param ErpPersons: + @param Organisations: + @param Documents: All documents for which this activity record has been created. + @param Assets: All assets for which this activity record has been created. + @param status: Information on consequence of event resulting in this activity record. + @param ScheduledEvent: + """ + #: Severity level of event resulting in this activity record. + self.severity = severity + + #: Date and time this activity record has been created (different from the 'status.dateTime', which is the time of a status change of the associated object, if applicable). + self.createdDateTime = createdDateTime + + #: Reason for event resulting in this activity record, typically supplied when user initiated. + self.reason = reason + + #: Category of event resulting in this activity record. + self.category = category + + self._ErpPersons = [] + self.ErpPersons = [] if ErpPersons is None else ErpPersons + + self._Organisations = [] + self.Organisations = [] if Organisations is None else Organisations + + self._Documents = [] + self.Documents = [] if Documents is None else Documents + + self._Assets = [] + self.Assets = [] if Assets is None else Assets + + self.status = status + + self._ScheduledEvent = None + self.ScheduledEvent = ScheduledEvent + + super(ActivityRecord, self).__init__(*args, **kw_args) + + _attrs = ["severity", "createdDateTime", "reason", "category"] + _attr_types = {"severity": str, "createdDateTime": str, "reason": str, "category": str} + _defaults = {"severity": '', "createdDateTime": '', "reason": '', "category": ''} + _enums = {} + _refs = ["ErpPersons", "Organisations", "Documents", "Assets", "status", "ScheduledEvent"] + _many_refs = ["ErpPersons", "Organisations", "Documents", "Assets"] + + def getErpPersons(self): + + return self._ErpPersons + + def setErpPersons(self, value): + for p in self._ErpPersons: + filtered = [q for q in p.ActivityRecords if q != self] + self._ErpPersons._ActivityRecords = filtered + for r in value: + if self not in r._ActivityRecords: + r._ActivityRecords.append(self) + self._ErpPersons = value + + ErpPersons = property(getErpPersons, setErpPersons) + + def addErpPersons(self, *ErpPersons): + for obj in ErpPersons: + if self not in obj._ActivityRecords: + obj._ActivityRecords.append(self) + self._ErpPersons.append(obj) + + def removeErpPersons(self, *ErpPersons): + for obj in ErpPersons: + if self in obj._ActivityRecords: + obj._ActivityRecords.remove(self) + self._ErpPersons.remove(obj) + + def getOrganisations(self): + + return self._Organisations + + def setOrganisations(self, value): + for p in self._Organisations: + filtered = [q for q in p.ActivityRecords if q != self] + self._Organisations._ActivityRecords = filtered + for r in value: + if self not in r._ActivityRecords: + r._ActivityRecords.append(self) + self._Organisations = value + + Organisations = property(getOrganisations, setOrganisations) + + def addOrganisations(self, *Organisations): + for obj in Organisations: + if self not in obj._ActivityRecords: + obj._ActivityRecords.append(self) + self._Organisations.append(obj) + + def removeOrganisations(self, *Organisations): + for obj in Organisations: + if self in obj._ActivityRecords: + obj._ActivityRecords.remove(self) + self._Organisations.remove(obj) + + def getDocuments(self): + """All documents for which this activity record has been created. + """ + return self._Documents + + def setDocuments(self, value): + for p in self._Documents: + filtered = [q for q in p.ActivityRecords if q != self] + self._Documents._ActivityRecords = filtered + for r in value: + if self not in r._ActivityRecords: + r._ActivityRecords.append(self) + self._Documents = value + + Documents = property(getDocuments, setDocuments) + + def addDocuments(self, *Documents): + for obj in Documents: + if self not in obj._ActivityRecords: + obj._ActivityRecords.append(self) + self._Documents.append(obj) + + def removeDocuments(self, *Documents): + for obj in Documents: + if self in obj._ActivityRecords: + obj._ActivityRecords.remove(self) + self._Documents.remove(obj) + + def getAssets(self): + """All assets for which this activity record has been created. + """ + return self._Assets + + def setAssets(self, value): + for p in self._Assets: + filtered = [q for q in p.ActivityRecords if q != self] + self._Assets._ActivityRecords = filtered + for r in value: + if self not in r._ActivityRecords: + r._ActivityRecords.append(self) + self._Assets = value + + Assets = property(getAssets, setAssets) + + def addAssets(self, *Assets): + for obj in Assets: + if self not in obj._ActivityRecords: + obj._ActivityRecords.append(self) + self._Assets.append(obj) + + def removeAssets(self, *Assets): + for obj in Assets: + if self in obj._ActivityRecords: + obj._ActivityRecords.remove(self) + self._Assets.remove(obj) + + # Information on consequence of event resulting in this activity record. + status = None + + def getScheduledEvent(self): + + return self._ScheduledEvent + + def setScheduledEvent(self, value): + if self._ScheduledEvent is not None: + self._ScheduledEvent._ActivityRecord = None + + self._ScheduledEvent = value + if self._ScheduledEvent is not None: + self._ScheduledEvent.ActivityRecord = None + self._ScheduledEvent._ActivityRecord = self + + ScheduledEvent = property(getScheduledEvent, setScheduledEvent) + diff --git a/CIM16/IEC61968/Common/Agreement.py b/CIM16/IEC61968/Common/Agreement.py new file mode 100755 index 00000000..d36489d9 --- /dev/null +++ b/CIM16/IEC61968/Common/Agreement.py @@ -0,0 +1,49 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class Agreement(Document): + """Formal agreement between two parties defining the terms and conditions for a set of services. The specifics of the services are, in turn, defined via one or more service agreements.Formal agreement between two parties defining the terms and conditions for a set of services. The specifics of the services are, in turn, defined via one or more service agreements. + """ + + def __init__(self, signDate='', validityInterval=None, *args, **kw_args): + """Initialises a new 'Agreement' instance. + + @param signDate: Date this agreement was consummated among associated persons and/or organisations. + @param validityInterval: Date and time interval this agreement is valid (from going into effect to termination). + """ + #: Date this agreement was consummated among associated persons and/or organisations. + self.signDate = signDate + + self.validityInterval = validityInterval + + super(Agreement, self).__init__(*args, **kw_args) + + _attrs = ["signDate"] + _attr_types = {"signDate": str} + _defaults = {"signDate": ''} + _enums = {} + _refs = ["validityInterval"] + _many_refs = [] + + # Date and time interval this agreement is valid (from going into effect to termination). + validityInterval = None + diff --git a/CIM16/IEC61968/Common/CoordinateSystem.py b/CIM16/IEC61968/Common/CoordinateSystem.py new file mode 100755 index 00000000..d41567d9 --- /dev/null +++ b/CIM16/IEC61968/Common/CoordinateSystem.py @@ -0,0 +1,125 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class CoordinateSystem(IdentifiedObject): + """Coordinate reference system.Coordinate reference system. + """ + + def __init__(self, crsUrn='', Diagrams=None, Location=None, GmlDiagramObjects=None, *args, **kw_args): + """Initialises a new 'CoordinateSystem' instance. + + @param crsUrn: A Uniform Resource Name (URN) for the coordinate reference system (crs) used to define 'Location.PositionPoints'. An example would be the European Petroleum Survey Group (EPSG) code for a coordinate reference system, defined in URN under the Open Geospatial Consortium (OGC) namespace as: urn:ogc :def:uom:EPSG::XXXX, where XXXX is an EPSG code (a full list of codes can be found at the EPSG Registry website http://www.epsg-registry.org/). To define the coordinate system as being WGS84 (latitude, longitude) using an EPSG OGC, this attribute would be urn:ogc:def:uom:EPSG::4236. A profile should limit this code to a set of allowed URNs agreed to by all sending and receiving parties. + @param Diagrams: + @param Location: All locations described with position points in this coordinate system. + @param GmlDiagramObjects: + """ + #: A Uniform Resource Name (URN) for the coordinate reference system (crs) used to define 'Location.PositionPoints'. An example would be the European Petroleum Survey Group (EPSG) code for a coordinate reference system, defined in URN under the Open Geospatial Consortium (OGC) namespace as: urn:ogc :def:uom:EPSG::XXXX, where XXXX is an EPSG code (a full list of codes can be found at the EPSG Registry website http://www.epsg-registry.org/). To define the coordinate system as being WGS84 (latitude, longitude) using an EPSG OGC, this attribute would be urn:ogc:def:uom:EPSG::4236. A profile should limit this code to a set of allowed URNs agreed to by all sending and receiving parties. + self.crsUrn = crsUrn + + self._Diagrams = [] + self.Diagrams = [] if Diagrams is None else Diagrams + + self._Location = [] + self.Location = [] if Location is None else Location + + self._GmlDiagramObjects = [] + self.GmlDiagramObjects = [] if GmlDiagramObjects is None else GmlDiagramObjects + + super(CoordinateSystem, self).__init__(*args, **kw_args) + + _attrs = ["crsUrn"] + _attr_types = {"crsUrn": str} + _defaults = {"crsUrn": ''} + _enums = {} + _refs = ["Diagrams", "Location", "GmlDiagramObjects"] + _many_refs = ["Diagrams", "Location", "GmlDiagramObjects"] + + def getDiagrams(self): + + return self._Diagrams + + def setDiagrams(self, value): + for x in self._Diagrams: + x.CoordinateSystem = None + for y in value: + y._CoordinateSystem = self + self._Diagrams = value + + Diagrams = property(getDiagrams, setDiagrams) + + def addDiagrams(self, *Diagrams): + for obj in Diagrams: + obj.CoordinateSystem = self + + def removeDiagrams(self, *Diagrams): + for obj in Diagrams: + obj.CoordinateSystem = None + + def getLocation(self): + """All locations described with position points in this coordinate system. + """ + return self._Location + + def setLocation(self, value): + for x in self._Location: + x.CoordinateSystem = None + for y in value: + y._CoordinateSystem = self + self._Location = value + + Location = property(getLocation, setLocation) + + def addLocation(self, *Location): + for obj in Location: + obj.CoordinateSystem = self + + def removeLocation(self, *Location): + for obj in Location: + obj.CoordinateSystem = None + + def getGmlDiagramObjects(self): + + return self._GmlDiagramObjects + + def setGmlDiagramObjects(self, value): + for p in self._GmlDiagramObjects: + filtered = [q for q in p.CoordinateSystems if q != self] + self._GmlDiagramObjects._CoordinateSystems = filtered + for r in value: + if self not in r._CoordinateSystems: + r._CoordinateSystems.append(self) + self._GmlDiagramObjects = value + + GmlDiagramObjects = property(getGmlDiagramObjects, setGmlDiagramObjects) + + def addGmlDiagramObjects(self, *GmlDiagramObjects): + for obj in GmlDiagramObjects: + if self not in obj._CoordinateSystems: + obj._CoordinateSystems.append(self) + self._GmlDiagramObjects.append(obj) + + def removeGmlDiagramObjects(self, *GmlDiagramObjects): + for obj in GmlDiagramObjects: + if self in obj._CoordinateSystems: + obj._CoordinateSystems.remove(self) + self._GmlDiagramObjects.remove(obj) + diff --git a/CIM16/IEC61968/Common/Document.py b/CIM16/IEC61968/Common/Document.py new file mode 100755 index 00000000..651f87a7 --- /dev/null +++ b/CIM16/IEC61968/Common/Document.py @@ -0,0 +1,438 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Document(IdentifiedObject): + """Parent class for different groupings of information collected and managed as a part of a business process. It will frequently contain references to other objects, such as assets, people and power system resources.Parent class for different groupings of information collected and managed as a part of a business process. It will frequently contain references to other objects, such as assets, people and power system resources. + """ + + def __init__(self, revisionNumber='', createdDateTime='', lastModifiedDateTime='', subject='', title='', category='', ChangeItems=None, ToDocumentRoles=None, electronicAddress=None, NetworkDataSets=None, FromDocumentRoles=None, ScheduleParameterInfos=None, ErpOrganisationRoles=None, Measurements=None, ActivityRecords=None, ChangeSets=None, ErpPersonRoles=None, ScheduledEvents=None, docStatus=None, AssetRoles=None, status=None, PowerSystemResourceRoles=None, *args, **kw_args): + """Initialises a new 'Document' instance. + + @param revisionNumber: Revision number for this document. + @param createdDateTime: Date and time that this document was created. + @param lastModifiedDateTime: Date and time this document was last modified. Documents may potentially be modified many times during their lifetime. + @param subject: Document subject. + @param title: Document title. + @param category: Utility-specific categorisation of this document, according to their corporate standards, practices, and existing IT systems (e.g., for management of assets, maintenance, work, outage, customers, etc.). + @param ChangeItems: + @param ToDocumentRoles: + @param electronicAddress: Electronic address. + @param NetworkDataSets: + @param FromDocumentRoles: + @param ScheduleParameterInfos: + @param ErpOrganisationRoles: + @param Measurements: Measurements are specified in types of documents, such as procedures. + @param ActivityRecords: All activity records created for this document. + @param ChangeSets: + @param ErpPersonRoles: + @param ScheduledEvents: + @param docStatus: Status of this document. For status of subject matter this document represents (e.g., Agreement, Work), use 'status' attribute. Example values for 'docStatus.status' are draft, approved, cancelled, etc. + @param AssetRoles: + @param status: Status of subject matter (e.g., Agreement, Work) this document represents. For status of the document itself, use 'docStatus' attribute. + @param PowerSystemResourceRoles: + """ + #: Revision number for this document. + self.revisionNumber = revisionNumber + + #: Date and time that this document was created. + self.createdDateTime = createdDateTime + + #: Date and time this document was last modified. Documents may potentially be modified many times during their lifetime. + self.lastModifiedDateTime = lastModifiedDateTime + + #: Document subject. + self.subject = subject + + #: Document title. + self.title = title + + #: Utility-specific categorisation of this document, according to their corporate standards, practices, and existing IT systems (e.g., for management of assets, maintenance, work, outage, customers, etc.). + self.category = category + + self._ChangeItems = [] + self.ChangeItems = [] if ChangeItems is None else ChangeItems + + self._ToDocumentRoles = [] + self.ToDocumentRoles = [] if ToDocumentRoles is None else ToDocumentRoles + + self.electronicAddress = electronicAddress + + self._NetworkDataSets = [] + self.NetworkDataSets = [] if NetworkDataSets is None else NetworkDataSets + + self._FromDocumentRoles = [] + self.FromDocumentRoles = [] if FromDocumentRoles is None else FromDocumentRoles + + self._ScheduleParameterInfos = [] + self.ScheduleParameterInfos = [] if ScheduleParameterInfos is None else ScheduleParameterInfos + + self._ErpOrganisationRoles = [] + self.ErpOrganisationRoles = [] if ErpOrganisationRoles is None else ErpOrganisationRoles + + self._Measurements = [] + self.Measurements = [] if Measurements is None else Measurements + + self._ActivityRecords = [] + self.ActivityRecords = [] if ActivityRecords is None else ActivityRecords + + self._ChangeSets = [] + self.ChangeSets = [] if ChangeSets is None else ChangeSets + + self._ErpPersonRoles = [] + self.ErpPersonRoles = [] if ErpPersonRoles is None else ErpPersonRoles + + self._ScheduledEvents = [] + self.ScheduledEvents = [] if ScheduledEvents is None else ScheduledEvents + + self.docStatus = docStatus + + self._AssetRoles = [] + self.AssetRoles = [] if AssetRoles is None else AssetRoles + + self.status = status + + self._PowerSystemResourceRoles = [] + self.PowerSystemResourceRoles = [] if PowerSystemResourceRoles is None else PowerSystemResourceRoles + + super(Document, self).__init__(*args, **kw_args) + + _attrs = ["revisionNumber", "createdDateTime", "lastModifiedDateTime", "subject", "title", "category"] + _attr_types = {"revisionNumber": str, "createdDateTime": str, "lastModifiedDateTime": str, "subject": str, "title": str, "category": str} + _defaults = {"revisionNumber": '', "createdDateTime": '', "lastModifiedDateTime": '', "subject": '', "title": '', "category": ''} + _enums = {} + _refs = ["ChangeItems", "ToDocumentRoles", "electronicAddress", "NetworkDataSets", "FromDocumentRoles", "ScheduleParameterInfos", "ErpOrganisationRoles", "Measurements", "ActivityRecords", "ChangeSets", "ErpPersonRoles", "ScheduledEvents", "docStatus", "AssetRoles", "status", "PowerSystemResourceRoles"] + _many_refs = ["ChangeItems", "ToDocumentRoles", "NetworkDataSets", "FromDocumentRoles", "ScheduleParameterInfos", "ErpOrganisationRoles", "Measurements", "ActivityRecords", "ChangeSets", "ErpPersonRoles", "ScheduledEvents", "AssetRoles", "PowerSystemResourceRoles"] + + def getChangeItems(self): + + return self._ChangeItems + + def setChangeItems(self, value): + for x in self._ChangeItems: + x.Document = None + for y in value: + y._Document = self + self._ChangeItems = value + + ChangeItems = property(getChangeItems, setChangeItems) + + def addChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.Document = self + + def removeChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.Document = None + + def getToDocumentRoles(self): + + return self._ToDocumentRoles + + def setToDocumentRoles(self, value): + for x in self._ToDocumentRoles: + x.FromDocument = None + for y in value: + y._FromDocument = self + self._ToDocumentRoles = value + + ToDocumentRoles = property(getToDocumentRoles, setToDocumentRoles) + + def addToDocumentRoles(self, *ToDocumentRoles): + for obj in ToDocumentRoles: + obj.FromDocument = self + + def removeToDocumentRoles(self, *ToDocumentRoles): + for obj in ToDocumentRoles: + obj.FromDocument = None + + # Electronic address. + electronicAddress = None + + def getNetworkDataSets(self): + + return self._NetworkDataSets + + def setNetworkDataSets(self, value): + for p in self._NetworkDataSets: + filtered = [q for q in p.Documents if q != self] + self._NetworkDataSets._Documents = filtered + for r in value: + if self not in r._Documents: + r._Documents.append(self) + self._NetworkDataSets = value + + NetworkDataSets = property(getNetworkDataSets, setNetworkDataSets) + + def addNetworkDataSets(self, *NetworkDataSets): + for obj in NetworkDataSets: + if self not in obj._Documents: + obj._Documents.append(self) + self._NetworkDataSets.append(obj) + + def removeNetworkDataSets(self, *NetworkDataSets): + for obj in NetworkDataSets: + if self in obj._Documents: + obj._Documents.remove(self) + self._NetworkDataSets.remove(obj) + + def getFromDocumentRoles(self): + + return self._FromDocumentRoles + + def setFromDocumentRoles(self, value): + for x in self._FromDocumentRoles: + x.ToDocument = None + for y in value: + y._ToDocument = self + self._FromDocumentRoles = value + + FromDocumentRoles = property(getFromDocumentRoles, setFromDocumentRoles) + + def addFromDocumentRoles(self, *FromDocumentRoles): + for obj in FromDocumentRoles: + obj.ToDocument = self + + def removeFromDocumentRoles(self, *FromDocumentRoles): + for obj in FromDocumentRoles: + obj.ToDocument = None + + def getScheduleParameterInfos(self): + + return self._ScheduleParameterInfos + + def setScheduleParameterInfos(self, value): + for p in self._ScheduleParameterInfos: + filtered = [q for q in p.Documents if q != self] + self._ScheduleParameterInfos._Documents = filtered + for r in value: + if self not in r._Documents: + r._Documents.append(self) + self._ScheduleParameterInfos = value + + ScheduleParameterInfos = property(getScheduleParameterInfos, setScheduleParameterInfos) + + def addScheduleParameterInfos(self, *ScheduleParameterInfos): + for obj in ScheduleParameterInfos: + if self not in obj._Documents: + obj._Documents.append(self) + self._ScheduleParameterInfos.append(obj) + + def removeScheduleParameterInfos(self, *ScheduleParameterInfos): + for obj in ScheduleParameterInfos: + if self in obj._Documents: + obj._Documents.remove(self) + self._ScheduleParameterInfos.remove(obj) + + def getErpOrganisationRoles(self): + + return self._ErpOrganisationRoles + + def setErpOrganisationRoles(self, value): + for x in self._ErpOrganisationRoles: + x.Document = None + for y in value: + y._Document = self + self._ErpOrganisationRoles = value + + ErpOrganisationRoles = property(getErpOrganisationRoles, setErpOrganisationRoles) + + def addErpOrganisationRoles(self, *ErpOrganisationRoles): + for obj in ErpOrganisationRoles: + obj.Document = self + + def removeErpOrganisationRoles(self, *ErpOrganisationRoles): + for obj in ErpOrganisationRoles: + obj.Document = None + + def getMeasurements(self): + """Measurements are specified in types of documents, such as procedures. + """ + return self._Measurements + + def setMeasurements(self, value): + for p in self._Measurements: + filtered = [q for q in p.Documents if q != self] + self._Measurements._Documents = filtered + for r in value: + if self not in r._Documents: + r._Documents.append(self) + self._Measurements = value + + Measurements = property(getMeasurements, setMeasurements) + + def addMeasurements(self, *Measurements): + for obj in Measurements: + if self not in obj._Documents: + obj._Documents.append(self) + self._Measurements.append(obj) + + def removeMeasurements(self, *Measurements): + for obj in Measurements: + if self in obj._Documents: + obj._Documents.remove(self) + self._Measurements.remove(obj) + + def getActivityRecords(self): + """All activity records created for this document. + """ + return self._ActivityRecords + + def setActivityRecords(self, value): + for p in self._ActivityRecords: + filtered = [q for q in p.Documents if q != self] + self._ActivityRecords._Documents = filtered + for r in value: + if self not in r._Documents: + r._Documents.append(self) + self._ActivityRecords = value + + ActivityRecords = property(getActivityRecords, setActivityRecords) + + def addActivityRecords(self, *ActivityRecords): + for obj in ActivityRecords: + if self not in obj._Documents: + obj._Documents.append(self) + self._ActivityRecords.append(obj) + + def removeActivityRecords(self, *ActivityRecords): + for obj in ActivityRecords: + if self in obj._Documents: + obj._Documents.remove(self) + self._ActivityRecords.remove(obj) + + def getChangeSets(self): + + return self._ChangeSets + + def setChangeSets(self, value): + for p in self._ChangeSets: + filtered = [q for q in p.Documents if q != self] + self._ChangeSets._Documents = filtered + for r in value: + if self not in r._Documents: + r._Documents.append(self) + self._ChangeSets = value + + ChangeSets = property(getChangeSets, setChangeSets) + + def addChangeSets(self, *ChangeSets): + for obj in ChangeSets: + if self not in obj._Documents: + obj._Documents.append(self) + self._ChangeSets.append(obj) + + def removeChangeSets(self, *ChangeSets): + for obj in ChangeSets: + if self in obj._Documents: + obj._Documents.remove(self) + self._ChangeSets.remove(obj) + + def getErpPersonRoles(self): + + return self._ErpPersonRoles + + def setErpPersonRoles(self, value): + for x in self._ErpPersonRoles: + x.Document = None + for y in value: + y._Document = self + self._ErpPersonRoles = value + + ErpPersonRoles = property(getErpPersonRoles, setErpPersonRoles) + + def addErpPersonRoles(self, *ErpPersonRoles): + for obj in ErpPersonRoles: + obj.Document = self + + def removeErpPersonRoles(self, *ErpPersonRoles): + for obj in ErpPersonRoles: + obj.Document = None + + def getScheduledEvents(self): + + return self._ScheduledEvents + + def setScheduledEvents(self, value): + for x in self._ScheduledEvents: + x.Document = None + for y in value: + y._Document = self + self._ScheduledEvents = value + + ScheduledEvents = property(getScheduledEvents, setScheduledEvents) + + def addScheduledEvents(self, *ScheduledEvents): + for obj in ScheduledEvents: + obj.Document = self + + def removeScheduledEvents(self, *ScheduledEvents): + for obj in ScheduledEvents: + obj.Document = None + + # Status of this document. For status of subject matter this document represents (e.g., Agreement, Work), use 'status' attribute. Example values for 'docStatus.status' are draft, approved, cancelled, etc. + docStatus = None + + def getAssetRoles(self): + + return self._AssetRoles + + def setAssetRoles(self, value): + for x in self._AssetRoles: + x.Document = None + for y in value: + y._Document = self + self._AssetRoles = value + + AssetRoles = property(getAssetRoles, setAssetRoles) + + def addAssetRoles(self, *AssetRoles): + for obj in AssetRoles: + obj.Document = self + + def removeAssetRoles(self, *AssetRoles): + for obj in AssetRoles: + obj.Document = None + + # Status of subject matter (e.g., Agreement, Work) this document represents. For status of the document itself, use 'docStatus' attribute. + status = None + + def getPowerSystemResourceRoles(self): + + return self._PowerSystemResourceRoles + + def setPowerSystemResourceRoles(self, value): + for x in self._PowerSystemResourceRoles: + x.Document = None + for y in value: + y._Document = self + self._PowerSystemResourceRoles = value + + PowerSystemResourceRoles = property(getPowerSystemResourceRoles, setPowerSystemResourceRoles) + + def addPowerSystemResourceRoles(self, *PowerSystemResourceRoles): + for obj in PowerSystemResourceRoles: + obj.Document = self + + def removePowerSystemResourceRoles(self, *PowerSystemResourceRoles): + for obj in PowerSystemResourceRoles: + obj.Document = None + diff --git a/CIM16/IEC61968/Common/ElectronicAddress.py b/CIM16/IEC61968/Common/ElectronicAddress.py new file mode 100755 index 00000000..0507d7c0 --- /dev/null +++ b/CIM16/IEC61968/Common/ElectronicAddress.py @@ -0,0 +1,67 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class ElectronicAddress(object): + """Electronic address information.Electronic address information. + """ + + def __init__(self, radio='', password='', lan='', userID='', email='', web='', status=None): + """Initialises a new 'ElectronicAddress' instance. + + @param radio: Radio address. + @param password: Password needed to log in. + @param lan: Address on local area network. + @param userID: User ID needed to log in, which can be for an individual person, an organisation, a location, etc. + @param email: Email address. + @param web: World wide web address. + @param status: Status of this electronic address. + """ + #: Radio address. + self.radio = radio + + #: Password needed to log in. + self.password = password + + #: Address on local area network. + self.lan = lan + + #: User ID needed to log in, which can be for an individual person, an organisation, a location, etc. + self.userID = userID + + #: Email address. + self.email = email + + #: World wide web address. + self.web = web + + self.status = status + + + _attrs = ["radio", "password", "lan", "userID", "email", "web"] + _attr_types = {"radio": str, "password": str, "lan": str, "userID": str, "email": str, "web": str} + _defaults = {"radio": '', "password": '', "lan": '', "userID": '', "email": '', "web": ''} + _enums = {} + _refs = ["status"] + _many_refs = [] + + # Status of this electronic address. + status = None + diff --git a/CIM16/IEC61968/Common/Location.py b/CIM16/IEC61968/Common/Location.py new file mode 100755 index 00000000..ea5ff2ba --- /dev/null +++ b/CIM16/IEC61968/Common/Location.py @@ -0,0 +1,477 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Location(IdentifiedObject): + """The place, scene, or point of something where someone or something has been, is, and/or will be at a given moment in time. It can be defined with one or more postition points (coordinates) in a given coordinate system.The place, scene, or point of something where someone or something has been, is, and/or will be at a given moment in time. It can be defined with one or more postition points (coordinates) in a given coordinate system. + """ + + def __init__(self, category='', geoInfoReference='', corporateCode='', direction='', mainAddress=None, phone1=None, phone2=None, PowerSystemResources=None, secondaryAddress=None, ChangeItems=None, RedLines=None, DimensionsInfo=None, LandProperties=None, Assets=None, Hazards=None, status=None, Crews=None, PositionPoints=None, electronicAddress=None, Directions=None, Measurements=None, Routes=None, CoordinateSystem=None, ErpOrganisations=None, *args, **kw_args): + """Initialises a new 'Location' instance. + + @param category: Category by utility's corporate standards and practices, relative to the location itself (e.g., geographical, functional accounting, etc., not a given property that happens to exist at that location). + @param geoInfoReference: (if applicable) Reference to geographical information source, often external to the utility. + @param corporateCode: Utility-specific code for the location. + @param direction: (if applicable) Direction that allows field crews to quickly find a given asset. For a given location, such as a street address, this is the relative direction in which to find the asset. For example, a Streetlight may be located at the 'NW' (northwest) corner of the customer's site, or a ServiceDeliveryPoint may be located on the second floor of an apartment building. + @param mainAddress: Main address of the location. + @param phone1: Phone number. + @param phone2: Additional phone number. + @param PowerSystemResources: All power system resources at this location. + @param secondaryAddress: Secondary address of the location. For example, PO Box address may have different ZIP code than that in the 'mainAddress'. + @param ChangeItems: + @param RedLines: + @param DimensionsInfo: + @param LandProperties: + @param Assets: All assets at this location. + @param Hazards: + @param status: Status of this location. + @param Crews: + @param PositionPoints: Sequence of position points describing this location, expressed in coordinate system 'Location.CoordinateSystem'. + @param electronicAddress: Electronic address. + @param Directions: + @param Measurements: + @param Routes: + @param CoordinateSystem: Coordinate system used to describe position points of this location. + @param ErpOrganisations: + """ + #: Category by utility's corporate standards and practices, relative to the location itself (e.g., geographical, functional accounting, etc., not a given property that happens to exist at that location). + self.category = category + + #: (if applicable) Reference to geographical information source, often external to the utility. + self.geoInfoReference = geoInfoReference + + #: Utility-specific code for the location. + self.corporateCode = corporateCode + + #: (if applicable) Direction that allows field crews to quickly find a given asset. For a given location, such as a street address, this is the relative direction in which to find the asset. For example, a Streetlight may be located at the 'NW' (northwest) corner of the customer's site, or a ServiceDeliveryPoint may be located on the second floor of an apartment building. + self.direction = direction + + self.mainAddress = mainAddress + + self.phone1 = phone1 + + self.phone2 = phone2 + + self._PowerSystemResources = [] + self.PowerSystemResources = [] if PowerSystemResources is None else PowerSystemResources + + self.secondaryAddress = secondaryAddress + + self._ChangeItems = [] + self.ChangeItems = [] if ChangeItems is None else ChangeItems + + self._RedLines = [] + self.RedLines = [] if RedLines is None else RedLines + + self._DimensionsInfo = None + self.DimensionsInfo = DimensionsInfo + + self._LandProperties = [] + self.LandProperties = [] if LandProperties is None else LandProperties + + self._Assets = [] + self.Assets = [] if Assets is None else Assets + + self._Hazards = [] + self.Hazards = [] if Hazards is None else Hazards + + self.status = status + + self._Crews = [] + self.Crews = [] if Crews is None else Crews + + self._PositionPoints = [] + self.PositionPoints = [] if PositionPoints is None else PositionPoints + + self.electronicAddress = electronicAddress + + self._Directions = [] + self.Directions = [] if Directions is None else Directions + + self._Measurements = [] + self.Measurements = [] if Measurements is None else Measurements + + self._Routes = [] + self.Routes = [] if Routes is None else Routes + + self._CoordinateSystem = None + self.CoordinateSystem = CoordinateSystem + + self._ErpOrganisations = [] + self.ErpOrganisations = [] if ErpOrganisations is None else ErpOrganisations + + super(Location, self).__init__(*args, **kw_args) + + _attrs = ["category", "geoInfoReference", "corporateCode", "direction"] + _attr_types = {"category": str, "geoInfoReference": str, "corporateCode": str, "direction": str} + _defaults = {"category": '', "geoInfoReference": '', "corporateCode": '', "direction": ''} + _enums = {} + _refs = ["mainAddress", "phone1", "phone2", "PowerSystemResources", "secondaryAddress", "ChangeItems", "RedLines", "DimensionsInfo", "LandProperties", "Assets", "Hazards", "status", "Crews", "PositionPoints", "electronicAddress", "Directions", "Measurements", "Routes", "CoordinateSystem", "ErpOrganisations"] + _many_refs = ["PowerSystemResources", "ChangeItems", "RedLines", "LandProperties", "Assets", "Hazards", "Crews", "PositionPoints", "Directions", "Measurements", "Routes", "ErpOrganisations"] + + # Main address of the location. + mainAddress = None + + # Phone number. + phone1 = None + + # Additional phone number. + phone2 = None + + def getPowerSystemResources(self): + """All power system resources at this location. + """ + return self._PowerSystemResources + + def setPowerSystemResources(self, value): + for x in self._PowerSystemResources: + x.Location = None + for y in value: + y._Location = self + self._PowerSystemResources = value + + PowerSystemResources = property(getPowerSystemResources, setPowerSystemResources) + + def addPowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + obj.Location = self + + def removePowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + obj.Location = None + + # Secondary address of the location. For example, PO Box address may have different ZIP code than that in the 'mainAddress'. + secondaryAddress = None + + def getChangeItems(self): + + return self._ChangeItems + + def setChangeItems(self, value): + for x in self._ChangeItems: + x.Location = None + for y in value: + y._Location = self + self._ChangeItems = value + + ChangeItems = property(getChangeItems, setChangeItems) + + def addChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.Location = self + + def removeChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.Location = None + + def getRedLines(self): + + return self._RedLines + + def setRedLines(self, value): + for p in self._RedLines: + filtered = [q for q in p.Locations if q != self] + self._RedLines._Locations = filtered + for r in value: + if self not in r._Locations: + r._Locations.append(self) + self._RedLines = value + + RedLines = property(getRedLines, setRedLines) + + def addRedLines(self, *RedLines): + for obj in RedLines: + if self not in obj._Locations: + obj._Locations.append(self) + self._RedLines.append(obj) + + def removeRedLines(self, *RedLines): + for obj in RedLines: + if self in obj._Locations: + obj._Locations.remove(self) + self._RedLines.remove(obj) + + def getDimensionsInfo(self): + + return self._DimensionsInfo + + def setDimensionsInfo(self, value): + if self._DimensionsInfo is not None: + filtered = [x for x in self.DimensionsInfo.Locations if x != self] + self._DimensionsInfo._Locations = filtered + + self._DimensionsInfo = value + if self._DimensionsInfo is not None: + if self not in self._DimensionsInfo._Locations: + self._DimensionsInfo._Locations.append(self) + + DimensionsInfo = property(getDimensionsInfo, setDimensionsInfo) + + def getLandProperties(self): + + return self._LandProperties + + def setLandProperties(self, value): + for p in self._LandProperties: + filtered = [q for q in p.Locations if q != self] + self._LandProperties._Locations = filtered + for r in value: + if self not in r._Locations: + r._Locations.append(self) + self._LandProperties = value + + LandProperties = property(getLandProperties, setLandProperties) + + def addLandProperties(self, *LandProperties): + for obj in LandProperties: + if self not in obj._Locations: + obj._Locations.append(self) + self._LandProperties.append(obj) + + def removeLandProperties(self, *LandProperties): + for obj in LandProperties: + if self in obj._Locations: + obj._Locations.remove(self) + self._LandProperties.remove(obj) + + def getAssets(self): + """All assets at this location. + """ + return self._Assets + + def setAssets(self, value): + for x in self._Assets: + x.Location = None + for y in value: + y._Location = self + self._Assets = value + + Assets = property(getAssets, setAssets) + + def addAssets(self, *Assets): + for obj in Assets: + obj.Location = self + + def removeAssets(self, *Assets): + for obj in Assets: + obj.Location = None + + def getHazards(self): + + return self._Hazards + + def setHazards(self, value): + for p in self._Hazards: + filtered = [q for q in p.Locations if q != self] + self._Hazards._Locations = filtered + for r in value: + if self not in r._Locations: + r._Locations.append(self) + self._Hazards = value + + Hazards = property(getHazards, setHazards) + + def addHazards(self, *Hazards): + for obj in Hazards: + if self not in obj._Locations: + obj._Locations.append(self) + self._Hazards.append(obj) + + def removeHazards(self, *Hazards): + for obj in Hazards: + if self in obj._Locations: + obj._Locations.remove(self) + self._Hazards.remove(obj) + + # Status of this location. + status = None + + def getCrews(self): + + return self._Crews + + def setCrews(self, value): + for p in self._Crews: + filtered = [q for q in p.Locations if q != self] + self._Crews._Locations = filtered + for r in value: + if self not in r._Locations: + r._Locations.append(self) + self._Crews = value + + Crews = property(getCrews, setCrews) + + def addCrews(self, *Crews): + for obj in Crews: + if self not in obj._Locations: + obj._Locations.append(self) + self._Crews.append(obj) + + def removeCrews(self, *Crews): + for obj in Crews: + if self in obj._Locations: + obj._Locations.remove(self) + self._Crews.remove(obj) + + def getPositionPoints(self): + """Sequence of position points describing this location, expressed in coordinate system 'Location.CoordinateSystem'. + """ + return self._PositionPoints + + def setPositionPoints(self, value): + for x in self._PositionPoints: + x.Location = None + for y in value: + y._Location = self + self._PositionPoints = value + + PositionPoints = property(getPositionPoints, setPositionPoints) + + def addPositionPoints(self, *PositionPoints): + for obj in PositionPoints: + obj.Location = self + + def removePositionPoints(self, *PositionPoints): + for obj in PositionPoints: + obj.Location = None + + # Electronic address. + electronicAddress = None + + def getDirections(self): + + return self._Directions + + def setDirections(self, value): + for x in self._Directions: + x.Location = None + for y in value: + y._Location = self + self._Directions = value + + Directions = property(getDirections, setDirections) + + def addDirections(self, *Directions): + for obj in Directions: + obj.Location = self + + def removeDirections(self, *Directions): + for obj in Directions: + obj.Location = None + + def getMeasurements(self): + + return self._Measurements + + def setMeasurements(self, value): + for p in self._Measurements: + filtered = [q for q in p.Locations if q != self] + self._Measurements._Locations = filtered + for r in value: + if self not in r._Locations: + r._Locations.append(self) + self._Measurements = value + + Measurements = property(getMeasurements, setMeasurements) + + def addMeasurements(self, *Measurements): + for obj in Measurements: + if self not in obj._Locations: + obj._Locations.append(self) + self._Measurements.append(obj) + + def removeMeasurements(self, *Measurements): + for obj in Measurements: + if self in obj._Locations: + obj._Locations.remove(self) + self._Measurements.remove(obj) + + def getRoutes(self): + + return self._Routes + + def setRoutes(self, value): + for p in self._Routes: + filtered = [q for q in p.Locations if q != self] + self._Routes._Locations = filtered + for r in value: + if self not in r._Locations: + r._Locations.append(self) + self._Routes = value + + Routes = property(getRoutes, setRoutes) + + def addRoutes(self, *Routes): + for obj in Routes: + if self not in obj._Locations: + obj._Locations.append(self) + self._Routes.append(obj) + + def removeRoutes(self, *Routes): + for obj in Routes: + if self in obj._Locations: + obj._Locations.remove(self) + self._Routes.remove(obj) + + def getCoordinateSystem(self): + """Coordinate system used to describe position points of this location. + """ + return self._CoordinateSystem + + def setCoordinateSystem(self, value): + if self._CoordinateSystem is not None: + filtered = [x for x in self.CoordinateSystem.Location if x != self] + self._CoordinateSystem._Location = filtered + + self._CoordinateSystem = value + if self._CoordinateSystem is not None: + if self not in self._CoordinateSystem._Location: + self._CoordinateSystem._Location.append(self) + + CoordinateSystem = property(getCoordinateSystem, setCoordinateSystem) + + def getErpOrganisations(self): + + return self._ErpOrganisations + + def setErpOrganisations(self, value): + for p in self._ErpOrganisations: + filtered = [q for q in p.Locations if q != self] + self._ErpOrganisations._Locations = filtered + for r in value: + if self not in r._Locations: + r._Locations.append(self) + self._ErpOrganisations = value + + ErpOrganisations = property(getErpOrganisations, setErpOrganisations) + + def addErpOrganisations(self, *ErpOrganisations): + for obj in ErpOrganisations: + if self not in obj._Locations: + obj._Locations.append(self) + self._ErpOrganisations.append(obj) + + def removeErpOrganisations(self, *ErpOrganisations): + for obj in ErpOrganisations: + if self in obj._Locations: + obj._Locations.remove(self) + self._ErpOrganisations.remove(obj) + diff --git a/CIM16/IEC61968/Common/Organisation.py b/CIM16/IEC61968/Common/Organisation.py new file mode 100755 index 00000000..8974a7a3 --- /dev/null +++ b/CIM16/IEC61968/Common/Organisation.py @@ -0,0 +1,100 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Organisation(IdentifiedObject): + """Organisation that might have roles as utility, contractor, supplier, manufacturer, customer, etc.Organisation that might have roles as utility, contractor, supplier, manufacturer, customer, etc. + """ + + def __init__(self, phone2=None, phone1=None, streetAddress=None, postalAddress=None, electronicAddress=None, BusinessRoles=None, *args, **kw_args): + """Initialises a new 'Organisation' instance. + + @param phone2: Additional phone number. + @param phone1: Phone number. + @param streetAddress: Street address. + @param postalAddress: Postal address, potentially different than 'streetAddress' (e.g., another city). + @param electronicAddress: Electronic address. + @param BusinessRoles: + """ + self.phone2 = phone2 + + self.phone1 = phone1 + + self.streetAddress = streetAddress + + self.postalAddress = postalAddress + + self.electronicAddress = electronicAddress + + self._BusinessRoles = [] + self.BusinessRoles = [] if BusinessRoles is None else BusinessRoles + + super(Organisation, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["phone2", "phone1", "streetAddress", "postalAddress", "electronicAddress", "BusinessRoles"] + _many_refs = ["BusinessRoles"] + + # Additional phone number. + phone2 = None + + # Phone number. + phone1 = None + + # Street address. + streetAddress = None + + # Postal address, potentially different than 'streetAddress' (e.g., another city). + postalAddress = None + + # Electronic address. + electronicAddress = None + + def getBusinessRoles(self): + + return self._BusinessRoles + + def setBusinessRoles(self, value): + for p in self._BusinessRoles: + filtered = [q for q in p.Organisations if q != self] + self._BusinessRoles._Organisations = filtered + for r in value: + if self not in r._Organisations: + r._Organisations.append(self) + self._BusinessRoles = value + + BusinessRoles = property(getBusinessRoles, setBusinessRoles) + + def addBusinessRoles(self, *BusinessRoles): + for obj in BusinessRoles: + if self not in obj._Organisations: + obj._Organisations.append(self) + self._BusinessRoles.append(obj) + + def removeBusinessRoles(self, *BusinessRoles): + for obj in BusinessRoles: + if self in obj._Organisations: + obj._Organisations.remove(self) + self._BusinessRoles.remove(obj) + diff --git a/CIM16/IEC61968/Common/PositionPoint.py b/CIM16/IEC61968/Common/PositionPoint.py new file mode 100755 index 00000000..2cef2ea0 --- /dev/null +++ b/CIM16/IEC61968/Common/PositionPoint.py @@ -0,0 +1,76 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class PositionPoint(Element): + """Set of spatial coordinates that determine a point, defined in coordinate system specified in 'Location.CoordinateSystem'. Use a single position point instance to desribe a point-oriented location. Use a sequence of position points to describe a line-oriented object (physical location of non-point oriented objects like cables or lines), or area of an object (like a substation or a geographical zone - in this case, have first and last position point with the same values).Set of spatial coordinates that determine a point, defined in coordinate system specified in 'Location.CoordinateSystem'. Use a single position point instance to desribe a point-oriented location. Use a sequence of position points to describe a line-oriented object (physical location of non-point oriented objects like cables or lines), or area of an object (like a substation or a geographical zone - in this case, have first and last position point with the same values). + """ + + def __init__(self, xPosition='', zPosition='', sequenceNumber=0, yPosition='', Location=None, *args, **kw_args): + """Initialises a new 'PositionPoint' instance. + + @param xPosition: X axis position. + @param zPosition: (if applicable) Z axis position. + @param sequenceNumber: Zero-relative sequence number of this point within a series of points. + @param yPosition: Y axis position. + @param Location: Location described by this position point. + """ + #: X axis position. + self.xPosition = xPosition + + #: (if applicable) Z axis position. + self.zPosition = zPosition + + #: Zero-relative sequence number of this point within a series of points. + self.sequenceNumber = sequenceNumber + + #: Y axis position. + self.yPosition = yPosition + + self._Location = None + self.Location = Location + + super(PositionPoint, self).__init__(*args, **kw_args) + + _attrs = ["xPosition", "zPosition", "sequenceNumber", "yPosition"] + _attr_types = {"xPosition": str, "zPosition": str, "sequenceNumber": int, "yPosition": str} + _defaults = {"xPosition": '', "zPosition": '', "sequenceNumber": 0, "yPosition": ''} + _enums = {} + _refs = ["Location"] + _many_refs = [] + + def getLocation(self): + """Location described by this position point. + """ + return self._Location + + def setLocation(self, value): + if self._Location is not None: + filtered = [x for x in self.Location.PositionPoints if x != self] + self._Location._PositionPoints = filtered + + self._Location = value + if self._Location is not None: + if self not in self._Location._PositionPoints: + self._Location._PositionPoints.append(self) + + Location = property(getLocation, setLocation) + diff --git a/CIM16/IEC61968/Common/PostalAddress.py b/CIM16/IEC61968/Common/PostalAddress.py new file mode 100755 index 00000000..af0d4e26 --- /dev/null +++ b/CIM16/IEC61968/Common/PostalAddress.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class PostalAddress(object): + """General purpose postal address information.General purpose postal address information. + """ + + def __init__(self, poBox='', postalCode='', streetDetail=None, townDetail=None): + """Initialises a new 'PostalAddress' instance. + + @param poBox: Post office box. + @param postalCode: Postal code for the address. + @param streetDetail: Street detail. + @param townDetail: Town detail. + """ + #: Post office box. + self.poBox = poBox + + #: Postal code for the address. + self.postalCode = postalCode + + self.streetDetail = streetDetail + + self.townDetail = townDetail + + + _attrs = ["poBox", "postalCode"] + _attr_types = {"poBox": str, "postalCode": str} + _defaults = {"poBox": '', "postalCode": ''} + _enums = {} + _refs = ["streetDetail", "townDetail"] + _many_refs = [] + + # Street detail. + streetDetail = None + + # Town detail. + townDetail = None + diff --git a/CIM16/IEC61968/Common/Status.py b/CIM16/IEC61968/Common/Status.py new file mode 100755 index 00000000..2f2928ac --- /dev/null +++ b/CIM16/IEC61968/Common/Status.py @@ -0,0 +1,53 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class Status(object): + """Current status information relevant to an entity.Current status information relevant to an entity. + """ + + def __init__(self, reason='', dateTime='', value='', remark=''): + """Initialises a new 'Status' instance. + + @param reason: Reason code or explanation for why an object went to the current status 'value'. + @param dateTime: Date and time for which status 'value' applies. + @param value: Status value at 'dateTime'; prior status changes may have been kept in instances of activity records associated with the object to which this status applies. + @param remark: Pertinent information regarding the current 'value', as free form text. + """ + #: Reason code or explanation for why an object went to the current status 'value'. + self.reason = reason + + #: Date and time for which status 'value' applies. + self.dateTime = dateTime + + #: Status value at 'dateTime'; prior status changes may have been kept in instances of activity records associated with the object to which this status applies. + self.value = value + + #: Pertinent information regarding the current 'value', as free form text. + self.remark = remark + + + _attrs = ["reason", "dateTime", "value", "remark"] + _attr_types = {"reason": str, "dateTime": str, "value": str, "remark": str} + _defaults = {"reason": '', "dateTime": '', "value": '', "remark": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/Common/StreetAddress.py b/CIM16/IEC61968/Common/StreetAddress.py new file mode 100755 index 00000000..c2535e1e --- /dev/null +++ b/CIM16/IEC61968/Common/StreetAddress.py @@ -0,0 +1,55 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class StreetAddress(object): + """General purpose street address information.General purpose street address information. + """ + + def __init__(self, status=None, streetDetail=None, townDetail=None): + """Initialises a new 'StreetAddress' instance. + + @param status: Status of this address. + @param streetDetail: Street detail. + @param townDetail: Town detail. + """ + self.status = status + + self.streetDetail = streetDetail + + self.townDetail = townDetail + + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["status", "streetDetail", "townDetail"] + _many_refs = [] + + # Status of this address. + status = None + + # Street detail. + streetDetail = None + + # Town detail. + townDetail = None + diff --git a/CIM16/IEC61968/Common/StreetDetail.py b/CIM16/IEC61968/Common/StreetDetail.py new file mode 100755 index 00000000..e7684679 --- /dev/null +++ b/CIM16/IEC61968/Common/StreetDetail.py @@ -0,0 +1,77 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class StreetDetail(object): + """Street details, in the context of address.Street details, in the context of address. + """ + + def __init__(self, withinTownLimits=False, name='', type='', prefix='', buildingName='', suiteNumber='', suffix='', addressGeneral='', code='', number=''): + """Initialises a new 'StreetDetail' instance. + + @param withinTownLimits: True if this street is within the legal geographical boundaries of the specified town (default). + @param name: Name of the street. + @param type: Type of street. Examples include: street, circle, boulevard, avenue, road, drive, etc. + @param prefix: Prefix to the street name. For example: North, South, East, West. + @param buildingName: (if applicable) In certain cases the physical location of the place of interest does not have a direct point of entry from the street, but may be located inside a larger structure such as a building, complex, office block, apartment, etc. + @param suiteNumber: Number of the apartment or suite. + @param suffix: Suffix to the street name. For example: North, South, East, West. + @param addressGeneral: Additional address information, for example a mailstop. + @param code: (if applicable) Utilities often make use of external reference systems, such as those of the town-planner's department or surveyor general's mapping system, that allocate global reference codes to streets. + @param number: Designator of the specific location on the street. + """ + #: True if this street is within the legal geographical boundaries of the specified town (default). + self.withinTownLimits = withinTownLimits + + #: Name of the street. + self.name = name + + #: Type of street. Examples include: street, circle, boulevard, avenue, road, drive, etc. + self.type = type + + #: Prefix to the street name. For example: North, South, East, West. + self.prefix = prefix + + #: (if applicable) In certain cases the physical location of the place of interest does not have a direct point of entry from the street, but may be located inside a larger structure such as a building, complex, office block, apartment, etc. + self.buildingName = buildingName + + #: Number of the apartment or suite. + self.suiteNumber = suiteNumber + + #: Suffix to the street name. For example: North, South, East, West. + self.suffix = suffix + + #: Additional address information, for example a mailstop. + self.addressGeneral = addressGeneral + + #: (if applicable) Utilities often make use of external reference systems, such as those of the town-planner's department or surveyor general's mapping system, that allocate global reference codes to streets. + self.code = code + + #: Designator of the specific location on the street. + self.number = number + + + _attrs = ["withinTownLimits", "name", "type", "prefix", "buildingName", "suiteNumber", "suffix", "addressGeneral", "code", "number"] + _attr_types = {"withinTownLimits": bool, "name": str, "type": str, "prefix": str, "buildingName": str, "suiteNumber": str, "suffix": str, "addressGeneral": str, "code": str, "number": str} + _defaults = {"withinTownLimits": False, "name": '', "type": '', "prefix": '', "buildingName": '', "suiteNumber": '', "suffix": '', "addressGeneral": '', "code": '', "number": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/Common/TelephoneNumber.py b/CIM16/IEC61968/Common/TelephoneNumber.py new file mode 100755 index 00000000..2a7635f0 --- /dev/null +++ b/CIM16/IEC61968/Common/TelephoneNumber.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class TelephoneNumber(object): + """Telephone number.Telephone number. + """ + + def __init__(self, cityCode='', localNumber='', extension='', areaCode='', countryCode=''): + """Initialises a new 'TelephoneNumber' instance. + + @param cityCode: (if applicable) City code. + @param localNumber: Main (local) part of this telephone number. + @param extension: (if applicable) Extension for this telephone number. + @param areaCode: Area or region code. + @param countryCode: Country code. + """ + #: (if applicable) City code. + self.cityCode = cityCode + + #: Main (local) part of this telephone number. + self.localNumber = localNumber + + #: (if applicable) Extension for this telephone number. + self.extension = extension + + #: Area or region code. + self.areaCode = areaCode + + #: Country code. + self.countryCode = countryCode + + + _attrs = ["cityCode", "localNumber", "extension", "areaCode", "countryCode"] + _attr_types = {"cityCode": str, "localNumber": str, "extension": str, "areaCode": str, "countryCode": str} + _defaults = {"cityCode": '', "localNumber": '', "extension": '', "areaCode": '', "countryCode": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/Common/TimePoint.py b/CIM16/IEC61968/Common/TimePoint.py new file mode 100755 index 00000000..ab41c9c7 --- /dev/null +++ b/CIM16/IEC61968/Common/TimePoint.py @@ -0,0 +1,109 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TimePoint(IdentifiedObject): + """A point in time within a sequence of points in time relative to a TimeSchedule.A point in time within a sequence of points in time relative to a TimeSchedule. + """ + + def __init__(self, dateTime='', sequenceNumber=0, relativeTimeInterval=0.0, status=None, window=None, TimeSchedule=None, ScheduledEvents=None, *args, **kw_args): + """Initialises a new 'TimePoint' instance. + + @param dateTime: Absolute date and time for this time point. For calendar-based time point, it is typically manually entered, while for interval-based or sequence-based time point it is derived. + @param sequenceNumber: (if sequence-based) Relative sequence number for this time point. + @param relativeTimeInterval: (if interval-based) A point in time relative to scheduled start time in 'TimeSchedule.scheduleInterval.start'. + @param status: Status of this time point. + @param window: Interval defining the window of time that this time point is valid (for example, seasonal, only on weekends, not on weekends, only 8:00 to 5:00, etc.). + @param TimeSchedule: Time schedule owning this time point. + @param ScheduledEvents: + """ + #: Absolute date and time for this time point. For calendar-based time point, it is typically manually entered, while for interval-based or sequence-based time point it is derived. + self.dateTime = dateTime + + #: (if sequence-based) Relative sequence number for this time point. + self.sequenceNumber = sequenceNumber + + #: (if interval-based) A point in time relative to scheduled start time in 'TimeSchedule.scheduleInterval.start'. + self.relativeTimeInterval = relativeTimeInterval + + self.status = status + + self.window = window + + self._TimeSchedule = None + self.TimeSchedule = TimeSchedule + + self._ScheduledEvents = [] + self.ScheduledEvents = [] if ScheduledEvents is None else ScheduledEvents + + super(TimePoint, self).__init__(*args, **kw_args) + + _attrs = ["dateTime", "sequenceNumber", "relativeTimeInterval"] + _attr_types = {"dateTime": str, "sequenceNumber": int, "relativeTimeInterval": float} + _defaults = {"dateTime": '', "sequenceNumber": 0, "relativeTimeInterval": 0.0} + _enums = {} + _refs = ["status", "window", "TimeSchedule", "ScheduledEvents"] + _many_refs = ["ScheduledEvents"] + + # Status of this time point. + status = None + + # Interval defining the window of time that this time point is valid (for example, seasonal, only on weekends, not on weekends, only 8:00 to 5:00, etc.). + window = None + + def getTimeSchedule(self): + """Time schedule owning this time point. + """ + return self._TimeSchedule + + def setTimeSchedule(self, value): + if self._TimeSchedule is not None: + filtered = [x for x in self.TimeSchedule.TimePoints if x != self] + self._TimeSchedule._TimePoints = filtered + + self._TimeSchedule = value + if self._TimeSchedule is not None: + if self not in self._TimeSchedule._TimePoints: + self._TimeSchedule._TimePoints.append(self) + + TimeSchedule = property(getTimeSchedule, setTimeSchedule) + + def getScheduledEvents(self): + + return self._ScheduledEvents + + def setScheduledEvents(self, value): + for x in self._ScheduledEvents: + x.TimePoint = None + for y in value: + y._TimePoint = self + self._ScheduledEvents = value + + ScheduledEvents = property(getScheduledEvents, setScheduledEvents) + + def addScheduledEvents(self, *ScheduledEvents): + for obj in ScheduledEvents: + obj.TimePoint = self + + def removeScheduledEvents(self, *ScheduledEvents): + for obj in ScheduledEvents: + obj.TimePoint = None + diff --git a/CIM16/IEC61968/Common/TimeSchedule.py b/CIM16/IEC61968/Common/TimeSchedule.py new file mode 100755 index 00000000..efd386c2 --- /dev/null +++ b/CIM16/IEC61968/Common/TimeSchedule.py @@ -0,0 +1,87 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class TimeSchedule(Document): + """Description of anything that changes through time. Time schedule is used to perform a single-valued function of time. Use inherited 'category' attribute to give additional information on this schedule, such as: periodic (hourly, daily, weekly, monthly, etc.), day of the month, by date, calendar (specific times and dates).Description of anything that changes through time. Time schedule is used to perform a single-valued function of time. Use inherited 'category' attribute to give additional information on this schedule, such as: periodic (hourly, daily, weekly, monthly, etc.), day of the month, by date, calendar (specific times and dates). + """ + + def __init__(self, recurrencePeriod=0.0, disabled=False, offset=0.0, recurrencePattern='', TimePoints=None, scheduleInterval=None, *args, **kw_args): + """Initialises a new 'TimeSchedule' instance. + + @param recurrencePeriod: Duration between time points, from the beginning of one period to the beginning of the next period. Note that a device like a meter may have multiple interval periods (e.g., 1 min, 5 min, 15 min, 30 min, or 60 min). + @param disabled: True if this schedule is deactivated (disabled). + @param offset: The offset from midnight (i.e., 0 h, 0 min, 0 s) for the periodic time points to begin. For example, for an interval meter that is set up for five minute intervals ('recurrencePeriod'=300=5 min), setting 'offset'=120=2 min would result in scheduled events to read the meter executing at 2 min, 7 min, 12 min, 17 min, 22 min, 27 min, 32 min, 37 min, 42 min, 47 min, 52 min, and 57 min past each hour. + @param recurrencePattern: Interval at which the scheduled action repeats (e.g., first Monday of every month, last day of the month, etc.). + @param TimePoints: Sequence of time points belonging to this time schedule. + @param scheduleInterval: Schedule date and time interval. + """ + #: Duration between time points, from the beginning of one period to the beginning of the next period. Note that a device like a meter may have multiple interval periods (e.g., 1 min, 5 min, 15 min, 30 min, or 60 min). + self.recurrencePeriod = recurrencePeriod + + #: True if this schedule is deactivated (disabled). + self.disabled = disabled + + #: The offset from midnight (i.e., 0 h, 0 min, 0 s) for the periodic time points to begin. For example, for an interval meter that is set up for five minute intervals ('recurrencePeriod'=300=5 min), setting 'offset'=120=2 min would result in scheduled events to read the meter executing at 2 min, 7 min, 12 min, 17 min, 22 min, 27 min, 32 min, 37 min, 42 min, 47 min, 52 min, and 57 min past each hour. + self.offset = offset + + #: Interval at which the scheduled action repeats (e.g., first Monday of every month, last day of the month, etc.). + self.recurrencePattern = recurrencePattern + + self._TimePoints = [] + self.TimePoints = [] if TimePoints is None else TimePoints + + self.scheduleInterval = scheduleInterval + + super(TimeSchedule, self).__init__(*args, **kw_args) + + _attrs = ["recurrencePeriod", "disabled", "offset", "recurrencePattern"] + _attr_types = {"recurrencePeriod": float, "disabled": bool, "offset": float, "recurrencePattern": str} + _defaults = {"recurrencePeriod": 0.0, "disabled": False, "offset": 0.0, "recurrencePattern": ''} + _enums = {} + _refs = ["TimePoints", "scheduleInterval"] + _many_refs = ["TimePoints"] + + def getTimePoints(self): + """Sequence of time points belonging to this time schedule. + """ + return self._TimePoints + + def setTimePoints(self, value): + for x in self._TimePoints: + x.TimeSchedule = None + for y in value: + y._TimeSchedule = self + self._TimePoints = value + + TimePoints = property(getTimePoints, setTimePoints) + + def addTimePoints(self, *TimePoints): + for obj in TimePoints: + obj.TimeSchedule = self + + def removeTimePoints(self, *TimePoints): + for obj in TimePoints: + obj.TimeSchedule = None + + # Schedule date and time interval. + scheduleInterval = None + diff --git a/CIM16/IEC61968/Common/TownDetail.py b/CIM16/IEC61968/Common/TownDetail.py new file mode 100755 index 00000000..cfd98b9e --- /dev/null +++ b/CIM16/IEC61968/Common/TownDetail.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class TownDetail(object): + """Town details, in the context of address.Town details, in the context of address. + """ + + def __init__(self, name='', stateOrProvince='', section='', code='', country=''): + """Initialises a new 'TownDetail' instance. + + @param name: Town name. + @param stateOrProvince: Name of the state or province. + @param section: Town section. For example, it is common for there to be 36 sections per township. + @param code: Town code. + @param country: Name of the country. + """ + #: Town name. + self.name = name + + #: Name of the state or province. + self.stateOrProvince = stateOrProvince + + #: Town section. For example, it is common for there to be 36 sections per township. + self.section = section + + #: Town code. + self.code = code + + #: Name of the country. + self.country = country + + + _attrs = ["name", "stateOrProvince", "section", "code", "country"] + _attr_types = {"name": str, "stateOrProvince": str, "section": str, "code": str, "country": str} + _defaults = {"name": '', "stateOrProvince": '', "section": '', "code": '', "country": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/Common/UserAttribute.py b/CIM16/IEC61968/Common/UserAttribute.py new file mode 100755 index 00000000..250902a7 --- /dev/null +++ b/CIM16/IEC61968/Common/UserAttribute.py @@ -0,0 +1,287 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class UserAttribute(Element): + """Generic name-value pair class, with optional sequence number and units for value; can be used to model parts of information exchange when concrete types are not known in advance.Generic name-value pair class, with optional sequence number and units for value; can be used to model parts of information exchange when concrete types are not known in advance. + """ + + def __init__(self, name='', value='', sequenceNumber=0, ErpLedgerEntries=None, ProcedureDataSets=None, Transaction=None, PropertySpecification=None, Procedure=None, PropertyAssets=None, RatingSpecification=None, ErpInvoiceLineItems=None, RatingAssets=None, *args, **kw_args): + """Initialises a new 'UserAttribute' instance. + + @param name: Name of an attribute. + @param value: Value of an attribute, including unit information. + @param sequenceNumber: Sequence number for this attribute in a list of attributes. + @param ErpLedgerEntries: + @param ProcedureDataSets: + @param Transaction: Transaction for which this snapshot has been recorded. + @param PropertySpecification: + @param Procedure: + @param PropertyAssets: + @param RatingSpecification: + @param ErpInvoiceLineItems: + @param RatingAssets: + """ + #: Name of an attribute. + self.name = name + + #: Value of an attribute, including unit information. + self.value = value + + #: Sequence number for this attribute in a list of attributes. + self.sequenceNumber = sequenceNumber + + self._ErpLedgerEntries = [] + self.ErpLedgerEntries = [] if ErpLedgerEntries is None else ErpLedgerEntries + + self._ProcedureDataSets = [] + self.ProcedureDataSets = [] if ProcedureDataSets is None else ProcedureDataSets + + self._Transaction = None + self.Transaction = Transaction + + self._PropertySpecification = None + self.PropertySpecification = PropertySpecification + + self._Procedure = None + self.Procedure = Procedure + + self._PropertyAssets = [] + self.PropertyAssets = [] if PropertyAssets is None else PropertyAssets + + self._RatingSpecification = None + self.RatingSpecification = RatingSpecification + + self._ErpInvoiceLineItems = [] + self.ErpInvoiceLineItems = [] if ErpInvoiceLineItems is None else ErpInvoiceLineItems + + self._RatingAssets = [] + self.RatingAssets = [] if RatingAssets is None else RatingAssets + + super(UserAttribute, self).__init__(*args, **kw_args) + + _attrs = ["name", "value", "sequenceNumber"] + _attr_types = {"name": str, "value": str, "sequenceNumber": int} + _defaults = {"name": '', "value": '', "sequenceNumber": 0} + _enums = {} + _refs = ["ErpLedgerEntries", "ProcedureDataSets", "Transaction", "PropertySpecification", "Procedure", "PropertyAssets", "RatingSpecification", "ErpInvoiceLineItems", "RatingAssets"] + _many_refs = ["ErpLedgerEntries", "ProcedureDataSets", "PropertyAssets", "ErpInvoiceLineItems", "RatingAssets"] + + def getErpLedgerEntries(self): + + return self._ErpLedgerEntries + + def setErpLedgerEntries(self, value): + for p in self._ErpLedgerEntries: + filtered = [q for q in p.UserAttributes if q != self] + self._ErpLedgerEntries._UserAttributes = filtered + for r in value: + if self not in r._UserAttributes: + r._UserAttributes.append(self) + self._ErpLedgerEntries = value + + ErpLedgerEntries = property(getErpLedgerEntries, setErpLedgerEntries) + + def addErpLedgerEntries(self, *ErpLedgerEntries): + for obj in ErpLedgerEntries: + if self not in obj._UserAttributes: + obj._UserAttributes.append(self) + self._ErpLedgerEntries.append(obj) + + def removeErpLedgerEntries(self, *ErpLedgerEntries): + for obj in ErpLedgerEntries: + if self in obj._UserAttributes: + obj._UserAttributes.remove(self) + self._ErpLedgerEntries.remove(obj) + + def getProcedureDataSets(self): + + return self._ProcedureDataSets + + def setProcedureDataSets(self, value): + for p in self._ProcedureDataSets: + filtered = [q for q in p.Properties if q != self] + self._ProcedureDataSets._Properties = filtered + for r in value: + if self not in r._Properties: + r._Properties.append(self) + self._ProcedureDataSets = value + + ProcedureDataSets = property(getProcedureDataSets, setProcedureDataSets) + + def addProcedureDataSets(self, *ProcedureDataSets): + for obj in ProcedureDataSets: + if self not in obj._Properties: + obj._Properties.append(self) + self._ProcedureDataSets.append(obj) + + def removeProcedureDataSets(self, *ProcedureDataSets): + for obj in ProcedureDataSets: + if self in obj._Properties: + obj._Properties.remove(self) + self._ProcedureDataSets.remove(obj) + + def getTransaction(self): + """Transaction for which this snapshot has been recorded. + """ + return self._Transaction + + def setTransaction(self, value): + if self._Transaction is not None: + filtered = [x for x in self.Transaction.UserAttributes if x != self] + self._Transaction._UserAttributes = filtered + + self._Transaction = value + if self._Transaction is not None: + if self not in self._Transaction._UserAttributes: + self._Transaction._UserAttributes.append(self) + + Transaction = property(getTransaction, setTransaction) + + def getPropertySpecification(self): + + return self._PropertySpecification + + def setPropertySpecification(self, value): + if self._PropertySpecification is not None: + filtered = [x for x in self.PropertySpecification.AssetProperites if x != self] + self._PropertySpecification._AssetProperites = filtered + + self._PropertySpecification = value + if self._PropertySpecification is not None: + if self not in self._PropertySpecification._AssetProperites: + self._PropertySpecification._AssetProperites.append(self) + + PropertySpecification = property(getPropertySpecification, setPropertySpecification) + + def getProcedure(self): + + return self._Procedure + + def setProcedure(self, value): + if self._Procedure is not None: + filtered = [x for x in self.Procedure.ProcedureValues if x != self] + self._Procedure._ProcedureValues = filtered + + self._Procedure = value + if self._Procedure is not None: + if self not in self._Procedure._ProcedureValues: + self._Procedure._ProcedureValues.append(self) + + Procedure = property(getProcedure, setProcedure) + + def getPropertyAssets(self): + + return self._PropertyAssets + + def setPropertyAssets(self, value): + for p in self._PropertyAssets: + filtered = [q for q in p.Properties if q != self] + self._PropertyAssets._Properties = filtered + for r in value: + if self not in r._Properties: + r._Properties.append(self) + self._PropertyAssets = value + + PropertyAssets = property(getPropertyAssets, setPropertyAssets) + + def addPropertyAssets(self, *PropertyAssets): + for obj in PropertyAssets: + if self not in obj._Properties: + obj._Properties.append(self) + self._PropertyAssets.append(obj) + + def removePropertyAssets(self, *PropertyAssets): + for obj in PropertyAssets: + if self in obj._Properties: + obj._Properties.remove(self) + self._PropertyAssets.remove(obj) + + def getRatingSpecification(self): + + return self._RatingSpecification + + def setRatingSpecification(self, value): + if self._RatingSpecification is not None: + filtered = [x for x in self.RatingSpecification.Ratings if x != self] + self._RatingSpecification._Ratings = filtered + + self._RatingSpecification = value + if self._RatingSpecification is not None: + if self not in self._RatingSpecification._Ratings: + self._RatingSpecification._Ratings.append(self) + + RatingSpecification = property(getRatingSpecification, setRatingSpecification) + + def getErpInvoiceLineItems(self): + + return self._ErpInvoiceLineItems + + def setErpInvoiceLineItems(self, value): + for p in self._ErpInvoiceLineItems: + filtered = [q for q in p.UserAttributes if q != self] + self._ErpInvoiceLineItems._UserAttributes = filtered + for r in value: + if self not in r._UserAttributes: + r._UserAttributes.append(self) + self._ErpInvoiceLineItems = value + + ErpInvoiceLineItems = property(getErpInvoiceLineItems, setErpInvoiceLineItems) + + def addErpInvoiceLineItems(self, *ErpInvoiceLineItems): + for obj in ErpInvoiceLineItems: + if self not in obj._UserAttributes: + obj._UserAttributes.append(self) + self._ErpInvoiceLineItems.append(obj) + + def removeErpInvoiceLineItems(self, *ErpInvoiceLineItems): + for obj in ErpInvoiceLineItems: + if self in obj._UserAttributes: + obj._UserAttributes.remove(self) + self._ErpInvoiceLineItems.remove(obj) + + def getRatingAssets(self): + + return self._RatingAssets + + def setRatingAssets(self, value): + for p in self._RatingAssets: + filtered = [q for q in p.Ratings if q != self] + self._RatingAssets._Ratings = filtered + for r in value: + if self not in r._Ratings: + r._Ratings.append(self) + self._RatingAssets = value + + RatingAssets = property(getRatingAssets, setRatingAssets) + + def addRatingAssets(self, *RatingAssets): + for obj in RatingAssets: + if self not in obj._Ratings: + obj._Ratings.append(self) + self._RatingAssets.append(obj) + + def removeRatingAssets(self, *RatingAssets): + for obj in RatingAssets: + if self in obj._Ratings: + obj._Ratings.remove(self) + self._RatingAssets.remove(obj) + diff --git a/CIM16/IEC61968/Common/__init__.py b/CIM16/IEC61968/Common/__init__.py new file mode 100755 index 00000000..4e610dca --- /dev/null +++ b/CIM16/IEC61968/Common/__init__.py @@ -0,0 +1,44 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package contains the information classes that support distribution management in general. +""" + +from CIM16.IEC61968.Common.PostalAddress import PostalAddress +from CIM16.IEC61968.Common.Status import Status +from CIM16.IEC61968.Common.ElectronicAddress import ElectronicAddress +from CIM16.IEC61968.Common.Location import Location +from CIM16.IEC61968.Common.TownDetail import TownDetail +from CIM16.IEC61968.Common.CoordinateSystem import CoordinateSystem +from CIM16.IEC61968.Common.Document import Document +from CIM16.IEC61968.Common.PositionPoint import PositionPoint +from CIM16.IEC61968.Common.UserAttribute import UserAttribute +from CIM16.IEC61968.Common.StreetAddress import StreetAddress +from CIM16.IEC61968.Common.StreetDetail import StreetDetail +from CIM16.IEC61968.Common.TimeSchedule import TimeSchedule +from CIM16.IEC61968.Common.ActivityRecord import ActivityRecord +from CIM16.IEC61968.Common.TimePoint import TimePoint +from CIM16.IEC61968.Common.Organisation import Organisation +from CIM16.IEC61968.Common.TelephoneNumber import TelephoneNumber +from CIM16.IEC61968.Common.Agreement import Agreement + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Common" +nsPrefix = "cimCommon" + diff --git a/CIM16/IEC61968/Customers/Customer.py b/CIM16/IEC61968/Customers/Customer.py new file mode 100755 index 00000000..77c84e5f --- /dev/null +++ b/CIM16/IEC61968/Customers/Customer.py @@ -0,0 +1,246 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Organisation import Organisation + +class Customer(Organisation): + """Organisation receiving services from ServiceSupplier.Organisation receiving services from ServiceSupplier. + """ + + def __init__(self, vip=False, pucNumber='', specialNeed='', kind="windMachine", CustomerAgreements=None, ErpPersons=None, EndDevices=None, Works=None, status=None, PlannedOutage=None, OutageNotifications=None, TroubleTickets=None, *args, **kw_args): + """Initialises a new 'Customer' instance. + + @param vip: True if this is an important customer. Importance is for matters different than those in 'specialNeed' attribute. + @param pucNumber: (if applicable) Public utility commission (PUC) identification number. + @param specialNeed: True if customer organisation has special service needs such as life support, hospitals, etc. + @param kind: Kind of customer. Values are: "windMachine", "residentialAndCommercial", "internalUse", "energyServiceScheduler", "residentialAndStreetlight", "residential", "pumpingLoad", "other", "commercialIndustrial", "energyServiceSupplier", "residentialStreetlightOthers", "residentialFarmService" + @param CustomerAgreements: All agreements of this customer. + @param ErpPersons: + @param EndDevices: All end devices of this customer. + @param Works: All the works performed for this customer. + @param status: Status of this customer. + @param PlannedOutage: + @param OutageNotifications: + @param TroubleTickets: + """ + #: True if this is an important customer. Importance is for matters different than those in 'specialNeed' attribute. + self.vip = vip + + #: (if applicable) Public utility commission (PUC) identification number. + self.pucNumber = pucNumber + + #: True if customer organisation has special service needs such as life support, hospitals, etc. + self.specialNeed = specialNeed + + #: Kind of customer. Values are: "windMachine", "residentialAndCommercial", "internalUse", "energyServiceScheduler", "residentialAndStreetlight", "residential", "pumpingLoad", "other", "commercialIndustrial", "energyServiceSupplier", "residentialStreetlightOthers", "residentialFarmService" + self.kind = kind + + self._CustomerAgreements = [] + self.CustomerAgreements = [] if CustomerAgreements is None else CustomerAgreements + + self._ErpPersons = [] + self.ErpPersons = [] if ErpPersons is None else ErpPersons + + self._EndDevices = [] + self.EndDevices = [] if EndDevices is None else EndDevices + + self._Works = [] + self.Works = [] if Works is None else Works + + self.status = status + + self._PlannedOutage = None + self.PlannedOutage = PlannedOutage + + self._OutageNotifications = [] + self.OutageNotifications = [] if OutageNotifications is None else OutageNotifications + + self._TroubleTickets = [] + self.TroubleTickets = [] if TroubleTickets is None else TroubleTickets + + super(Customer, self).__init__(*args, **kw_args) + + _attrs = ["vip", "pucNumber", "specialNeed", "kind"] + _attr_types = {"vip": bool, "pucNumber": str, "specialNeed": str, "kind": str} + _defaults = {"vip": False, "pucNumber": '', "specialNeed": '', "kind": "windMachine"} + _enums = {"kind": "CustomerKind"} + _refs = ["CustomerAgreements", "ErpPersons", "EndDevices", "Works", "status", "PlannedOutage", "OutageNotifications", "TroubleTickets"] + _many_refs = ["CustomerAgreements", "ErpPersons", "EndDevices", "Works", "OutageNotifications", "TroubleTickets"] + + def getCustomerAgreements(self): + """All agreements of this customer. + """ + return self._CustomerAgreements + + def setCustomerAgreements(self, value): + for x in self._CustomerAgreements: + x.Customer = None + for y in value: + y._Customer = self + self._CustomerAgreements = value + + CustomerAgreements = property(getCustomerAgreements, setCustomerAgreements) + + def addCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + obj.Customer = self + + def removeCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + obj.Customer = None + + def getErpPersons(self): + + return self._ErpPersons + + def setErpPersons(self, value): + for x in self._ErpPersons: + x.CustomerData = None + for y in value: + y._CustomerData = self + self._ErpPersons = value + + ErpPersons = property(getErpPersons, setErpPersons) + + def addErpPersons(self, *ErpPersons): + for obj in ErpPersons: + obj.CustomerData = self + + def removeErpPersons(self, *ErpPersons): + for obj in ErpPersons: + obj.CustomerData = None + + def getEndDevices(self): + """All end devices of this customer. + """ + return self._EndDevices + + def setEndDevices(self, value): + for x in self._EndDevices: + x.Customer = None + for y in value: + y._Customer = self + self._EndDevices = value + + EndDevices = property(getEndDevices, setEndDevices) + + def addEndDevices(self, *EndDevices): + for obj in EndDevices: + obj.Customer = self + + def removeEndDevices(self, *EndDevices): + for obj in EndDevices: + obj.Customer = None + + def getWorks(self): + """All the works performed for this customer. + """ + return self._Works + + def setWorks(self, value): + for p in self._Works: + filtered = [q for q in p.Customers if q != self] + self._Works._Customers = filtered + for r in value: + if self not in r._Customers: + r._Customers.append(self) + self._Works = value + + Works = property(getWorks, setWorks) + + def addWorks(self, *Works): + for obj in Works: + if self not in obj._Customers: + obj._Customers.append(self) + self._Works.append(obj) + + def removeWorks(self, *Works): + for obj in Works: + if self in obj._Customers: + obj._Customers.remove(self) + self._Works.remove(obj) + + # Status of this customer. + status = None + + def getPlannedOutage(self): + + return self._PlannedOutage + + def setPlannedOutage(self, value): + if self._PlannedOutage is not None: + filtered = [x for x in self.PlannedOutage.CustomerDatas if x != self] + self._PlannedOutage._CustomerDatas = filtered + + self._PlannedOutage = value + if self._PlannedOutage is not None: + if self not in self._PlannedOutage._CustomerDatas: + self._PlannedOutage._CustomerDatas.append(self) + + PlannedOutage = property(getPlannedOutage, setPlannedOutage) + + def getOutageNotifications(self): + + return self._OutageNotifications + + def setOutageNotifications(self, value): + for p in self._OutageNotifications: + filtered = [q for q in p.CustomerDatas if q != self] + self._OutageNotifications._CustomerDatas = filtered + for r in value: + if self not in r._CustomerDatas: + r._CustomerDatas.append(self) + self._OutageNotifications = value + + OutageNotifications = property(getOutageNotifications, setOutageNotifications) + + def addOutageNotifications(self, *OutageNotifications): + for obj in OutageNotifications: + if self not in obj._CustomerDatas: + obj._CustomerDatas.append(self) + self._OutageNotifications.append(obj) + + def removeOutageNotifications(self, *OutageNotifications): + for obj in OutageNotifications: + if self in obj._CustomerDatas: + obj._CustomerDatas.remove(self) + self._OutageNotifications.remove(obj) + + def getTroubleTickets(self): + + return self._TroubleTickets + + def setTroubleTickets(self, value): + for x in self._TroubleTickets: + x.CustomerData = None + for y in value: + y._CustomerData = self + self._TroubleTickets = value + + TroubleTickets = property(getTroubleTickets, setTroubleTickets) + + def addTroubleTickets(self, *TroubleTickets): + for obj in TroubleTickets: + obj.CustomerData = self + + def removeTroubleTickets(self, *TroubleTickets): + for obj in TroubleTickets: + obj.CustomerData = None + diff --git a/CIM16/IEC61968/Customers/CustomerAccount.py b/CIM16/IEC61968/Customers/CustomerAccount.py new file mode 100755 index 00000000..708dfa21 --- /dev/null +++ b/CIM16/IEC61968/Customers/CustomerAccount.py @@ -0,0 +1,166 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class CustomerAccount(Document): + """Assignment of a group of products and services purchased by the customer through a customer agreement, used as a mechanism for customer billing and payment. It contains common information from the various types of customer agreements to create billings (invoices) for a customer and receive payment.Assignment of a group of products and services purchased by the customer through a customer agreement, used as a mechanism for customer billing and payment. It contains common information from the various types of customer agreements to create billings (invoices) for a customer and receive payment. + """ + + def __init__(self, WorkBillingInfos=None, CustomerAgreements=None, ErpInvoicees=None, PaymentTransactions=None, CustomerBillingInfos=None, *args, **kw_args): + """Initialises a new 'CustomerAccount' instance. + + @param WorkBillingInfos: + @param CustomerAgreements: All agreements for this customer account. + @param ErpInvoicees: + @param PaymentTransactions: All payment transactions for this customer account. + @param CustomerBillingInfos: + """ + self._WorkBillingInfos = [] + self.WorkBillingInfos = [] if WorkBillingInfos is None else WorkBillingInfos + + self._CustomerAgreements = [] + self.CustomerAgreements = [] if CustomerAgreements is None else CustomerAgreements + + self._ErpInvoicees = [] + self.ErpInvoicees = [] if ErpInvoicees is None else ErpInvoicees + + self._PaymentTransactions = [] + self.PaymentTransactions = [] if PaymentTransactions is None else PaymentTransactions + + self._CustomerBillingInfos = [] + self.CustomerBillingInfos = [] if CustomerBillingInfos is None else CustomerBillingInfos + + super(CustomerAccount, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["WorkBillingInfos", "CustomerAgreements", "ErpInvoicees", "PaymentTransactions", "CustomerBillingInfos"] + _many_refs = ["WorkBillingInfos", "CustomerAgreements", "ErpInvoicees", "PaymentTransactions", "CustomerBillingInfos"] + + def getWorkBillingInfos(self): + + return self._WorkBillingInfos + + def setWorkBillingInfos(self, value): + for x in self._WorkBillingInfos: + x.CustomerAccount = None + for y in value: + y._CustomerAccount = self + self._WorkBillingInfos = value + + WorkBillingInfos = property(getWorkBillingInfos, setWorkBillingInfos) + + def addWorkBillingInfos(self, *WorkBillingInfos): + for obj in WorkBillingInfos: + obj.CustomerAccount = self + + def removeWorkBillingInfos(self, *WorkBillingInfos): + for obj in WorkBillingInfos: + obj.CustomerAccount = None + + def getCustomerAgreements(self): + """All agreements for this customer account. + """ + return self._CustomerAgreements + + def setCustomerAgreements(self, value): + for x in self._CustomerAgreements: + x.CustomerAccount = None + for y in value: + y._CustomerAccount = self + self._CustomerAgreements = value + + CustomerAgreements = property(getCustomerAgreements, setCustomerAgreements) + + def addCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + obj.CustomerAccount = self + + def removeCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + obj.CustomerAccount = None + + def getErpInvoicees(self): + + return self._ErpInvoicees + + def setErpInvoicees(self, value): + for x in self._ErpInvoicees: + x.CustomerAccount = None + for y in value: + y._CustomerAccount = self + self._ErpInvoicees = value + + ErpInvoicees = property(getErpInvoicees, setErpInvoicees) + + def addErpInvoicees(self, *ErpInvoicees): + for obj in ErpInvoicees: + obj.CustomerAccount = self + + def removeErpInvoicees(self, *ErpInvoicees): + for obj in ErpInvoicees: + obj.CustomerAccount = None + + def getPaymentTransactions(self): + """All payment transactions for this customer account. + """ + return self._PaymentTransactions + + def setPaymentTransactions(self, value): + for x in self._PaymentTransactions: + x.CustomerAccount = None + for y in value: + y._CustomerAccount = self + self._PaymentTransactions = value + + PaymentTransactions = property(getPaymentTransactions, setPaymentTransactions) + + def addPaymentTransactions(self, *PaymentTransactions): + for obj in PaymentTransactions: + obj.CustomerAccount = self + + def removePaymentTransactions(self, *PaymentTransactions): + for obj in PaymentTransactions: + obj.CustomerAccount = None + + def getCustomerBillingInfos(self): + + return self._CustomerBillingInfos + + def setCustomerBillingInfos(self, value): + for x in self._CustomerBillingInfos: + x.CustomerAccount = None + for y in value: + y._CustomerAccount = self + self._CustomerBillingInfos = value + + CustomerBillingInfos = property(getCustomerBillingInfos, setCustomerBillingInfos) + + def addCustomerBillingInfos(self, *CustomerBillingInfos): + for obj in CustomerBillingInfos: + obj.CustomerAccount = self + + def removeCustomerBillingInfos(self, *CustomerBillingInfos): + for obj in CustomerBillingInfos: + obj.CustomerAccount = None + diff --git a/CIM16/IEC61968/Customers/CustomerAgreement.py b/CIM16/IEC61968/Customers/CustomerAgreement.py new file mode 100755 index 00000000..bae5ec09 --- /dev/null +++ b/CIM16/IEC61968/Customers/CustomerAgreement.py @@ -0,0 +1,354 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Agreement import Agreement + +class CustomerAgreement(Agreement): + """Agreement between the customer and the service supplier to pay for service at a specific service location. It records certain billing information about the type of service provided at the service location and is used during charge creation to determine the type of service.Agreement between the customer and the service supplier to pay for service at a specific service location. It records certain billing information about the type of service provided at the service location and is used during charge creation to determine the type of service. + """ + + def __init__(self, billingCycle='', loadMgmt='', budgetBill='', PricingStructures=None, CustomerAccount=None, StandardIndustryCode=None, AuxiliaryAgreements=None, MeterReadings=None, Equipments=None, ServiceSupplier=None, ServiceLocations=None, DemandResponseProgram=None, ServiceDeliveryPoints=None, Customer=None, EndDeviceControls=None, *args, **kw_args): + """Initialises a new 'CustomerAgreement' instance. + + @param billingCycle: Cycle day on which the associated customer account will normally be billed, used to determine when to produce the billing. + @param loadMgmt: Load management code. + @param budgetBill: Budget bill code. + @param PricingStructures: All pricing structures applicable to this customer agreement. + @param CustomerAccount: Customer account owning this agreement. + @param StandardIndustryCode: + @param AuxiliaryAgreements: All (non-service related) auxiliary agreements that refer to this customer agreement. + @param MeterReadings: (could be deprecated in the future) All meter readings for this customer agreement. + @param Equipments: + @param ServiceSupplier: Service supplier for this customer agreement. + @param ServiceLocations: All service locations regulated by this customer agreement. + @param DemandResponseProgram: Demand response program for this customer agreement. + @param ServiceDeliveryPoints: All service delivery points regulated by this customer agreement. + @param Customer: Customer for this agreement. + @param EndDeviceControls: Could be deprecated in the future. + """ + #: Cycle day on which the associated customer account will normally be billed, used to determine when to produce the billing. + self.billingCycle = billingCycle + + #: Load management code. + self.loadMgmt = loadMgmt + + #: Budget bill code. + self.budgetBill = budgetBill + + self._PricingStructures = [] + self.PricingStructures = [] if PricingStructures is None else PricingStructures + + self._CustomerAccount = None + self.CustomerAccount = CustomerAccount + + self._StandardIndustryCode = None + self.StandardIndustryCode = StandardIndustryCode + + self._AuxiliaryAgreements = [] + self.AuxiliaryAgreements = [] if AuxiliaryAgreements is None else AuxiliaryAgreements + + self._MeterReadings = [] + self.MeterReadings = [] if MeterReadings is None else MeterReadings + + self._Equipments = [] + self.Equipments = [] if Equipments is None else Equipments + + self._ServiceSupplier = None + self.ServiceSupplier = ServiceSupplier + + self._ServiceLocations = [] + self.ServiceLocations = [] if ServiceLocations is None else ServiceLocations + + self._DemandResponseProgram = None + self.DemandResponseProgram = DemandResponseProgram + + self._ServiceDeliveryPoints = [] + self.ServiceDeliveryPoints = [] if ServiceDeliveryPoints is None else ServiceDeliveryPoints + + self._Customer = None + self.Customer = Customer + + self._EndDeviceControls = [] + self.EndDeviceControls = [] if EndDeviceControls is None else EndDeviceControls + + super(CustomerAgreement, self).__init__(*args, **kw_args) + + _attrs = ["billingCycle", "loadMgmt", "budgetBill"] + _attr_types = {"billingCycle": str, "loadMgmt": str, "budgetBill": str} + _defaults = {"billingCycle": '', "loadMgmt": '', "budgetBill": ''} + _enums = {} + _refs = ["PricingStructures", "CustomerAccount", "StandardIndustryCode", "AuxiliaryAgreements", "MeterReadings", "Equipments", "ServiceSupplier", "ServiceLocations", "DemandResponseProgram", "ServiceDeliveryPoints", "Customer", "EndDeviceControls"] + _many_refs = ["PricingStructures", "AuxiliaryAgreements", "MeterReadings", "Equipments", "ServiceLocations", "ServiceDeliveryPoints", "EndDeviceControls"] + + def getPricingStructures(self): + """All pricing structures applicable to this customer agreement. + """ + return self._PricingStructures + + def setPricingStructures(self, value): + for p in self._PricingStructures: + filtered = [q for q in p.CustomerAgreements if q != self] + self._PricingStructures._CustomerAgreements = filtered + for r in value: + if self not in r._CustomerAgreements: + r._CustomerAgreements.append(self) + self._PricingStructures = value + + PricingStructures = property(getPricingStructures, setPricingStructures) + + def addPricingStructures(self, *PricingStructures): + for obj in PricingStructures: + if self not in obj._CustomerAgreements: + obj._CustomerAgreements.append(self) + self._PricingStructures.append(obj) + + def removePricingStructures(self, *PricingStructures): + for obj in PricingStructures: + if self in obj._CustomerAgreements: + obj._CustomerAgreements.remove(self) + self._PricingStructures.remove(obj) + + def getCustomerAccount(self): + """Customer account owning this agreement. + """ + return self._CustomerAccount + + def setCustomerAccount(self, value): + if self._CustomerAccount is not None: + filtered = [x for x in self.CustomerAccount.CustomerAgreements if x != self] + self._CustomerAccount._CustomerAgreements = filtered + + self._CustomerAccount = value + if self._CustomerAccount is not None: + if self not in self._CustomerAccount._CustomerAgreements: + self._CustomerAccount._CustomerAgreements.append(self) + + CustomerAccount = property(getCustomerAccount, setCustomerAccount) + + def getStandardIndustryCode(self): + + return self._StandardIndustryCode + + def setStandardIndustryCode(self, value): + if self._StandardIndustryCode is not None: + filtered = [x for x in self.StandardIndustryCode.CustomerAgreements if x != self] + self._StandardIndustryCode._CustomerAgreements = filtered + + self._StandardIndustryCode = value + if self._StandardIndustryCode is not None: + if self not in self._StandardIndustryCode._CustomerAgreements: + self._StandardIndustryCode._CustomerAgreements.append(self) + + StandardIndustryCode = property(getStandardIndustryCode, setStandardIndustryCode) + + def getAuxiliaryAgreements(self): + """All (non-service related) auxiliary agreements that refer to this customer agreement. + """ + return self._AuxiliaryAgreements + + def setAuxiliaryAgreements(self, value): + for x in self._AuxiliaryAgreements: + x.CustomerAgreement = None + for y in value: + y._CustomerAgreement = self + self._AuxiliaryAgreements = value + + AuxiliaryAgreements = property(getAuxiliaryAgreements, setAuxiliaryAgreements) + + def addAuxiliaryAgreements(self, *AuxiliaryAgreements): + for obj in AuxiliaryAgreements: + obj.CustomerAgreement = self + + def removeAuxiliaryAgreements(self, *AuxiliaryAgreements): + for obj in AuxiliaryAgreements: + obj.CustomerAgreement = None + + def getMeterReadings(self): + """(could be deprecated in the future) All meter readings for this customer agreement. + """ + return self._MeterReadings + + def setMeterReadings(self, value): + for x in self._MeterReadings: + x.CustomerAgreement = None + for y in value: + y._CustomerAgreement = self + self._MeterReadings = value + + MeterReadings = property(getMeterReadings, setMeterReadings) + + def addMeterReadings(self, *MeterReadings): + for obj in MeterReadings: + obj.CustomerAgreement = self + + def removeMeterReadings(self, *MeterReadings): + for obj in MeterReadings: + obj.CustomerAgreement = None + + def getEquipments(self): + + return self._Equipments + + def setEquipments(self, value): + for p in self._Equipments: + filtered = [q for q in p.CustomerAgreements if q != self] + self._Equipments._CustomerAgreements = filtered + for r in value: + if self not in r._CustomerAgreements: + r._CustomerAgreements.append(self) + self._Equipments = value + + Equipments = property(getEquipments, setEquipments) + + def addEquipments(self, *Equipments): + for obj in Equipments: + if self not in obj._CustomerAgreements: + obj._CustomerAgreements.append(self) + self._Equipments.append(obj) + + def removeEquipments(self, *Equipments): + for obj in Equipments: + if self in obj._CustomerAgreements: + obj._CustomerAgreements.remove(self) + self._Equipments.remove(obj) + + def getServiceSupplier(self): + """Service supplier for this customer agreement. + """ + return self._ServiceSupplier + + def setServiceSupplier(self, value): + if self._ServiceSupplier is not None: + filtered = [x for x in self.ServiceSupplier.CustomerAgreements if x != self] + self._ServiceSupplier._CustomerAgreements = filtered + + self._ServiceSupplier = value + if self._ServiceSupplier is not None: + if self not in self._ServiceSupplier._CustomerAgreements: + self._ServiceSupplier._CustomerAgreements.append(self) + + ServiceSupplier = property(getServiceSupplier, setServiceSupplier) + + def getServiceLocations(self): + """All service locations regulated by this customer agreement. + """ + return self._ServiceLocations + + def setServiceLocations(self, value): + for p in self._ServiceLocations: + filtered = [q for q in p.CustomerAgreements if q != self] + self._ServiceLocations._CustomerAgreements = filtered + for r in value: + if self not in r._CustomerAgreements: + r._CustomerAgreements.append(self) + self._ServiceLocations = value + + ServiceLocations = property(getServiceLocations, setServiceLocations) + + def addServiceLocations(self, *ServiceLocations): + for obj in ServiceLocations: + if self not in obj._CustomerAgreements: + obj._CustomerAgreements.append(self) + self._ServiceLocations.append(obj) + + def removeServiceLocations(self, *ServiceLocations): + for obj in ServiceLocations: + if self in obj._CustomerAgreements: + obj._CustomerAgreements.remove(self) + self._ServiceLocations.remove(obj) + + def getDemandResponseProgram(self): + """Demand response program for this customer agreement. + """ + return self._DemandResponseProgram + + def setDemandResponseProgram(self, value): + if self._DemandResponseProgram is not None: + filtered = [x for x in self.DemandResponseProgram.CustomerAgreements if x != self] + self._DemandResponseProgram._CustomerAgreements = filtered + + self._DemandResponseProgram = value + if self._DemandResponseProgram is not None: + if self not in self._DemandResponseProgram._CustomerAgreements: + self._DemandResponseProgram._CustomerAgreements.append(self) + + DemandResponseProgram = property(getDemandResponseProgram, setDemandResponseProgram) + + def getServiceDeliveryPoints(self): + """All service delivery points regulated by this customer agreement. + """ + return self._ServiceDeliveryPoints + + def setServiceDeliveryPoints(self, value): + for x in self._ServiceDeliveryPoints: + x.CustomerAgreement = None + for y in value: + y._CustomerAgreement = self + self._ServiceDeliveryPoints = value + + ServiceDeliveryPoints = property(getServiceDeliveryPoints, setServiceDeliveryPoints) + + def addServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + obj.CustomerAgreement = self + + def removeServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + obj.CustomerAgreement = None + + def getCustomer(self): + """Customer for this agreement. + """ + return self._Customer + + def setCustomer(self, value): + if self._Customer is not None: + filtered = [x for x in self.Customer.CustomerAgreements if x != self] + self._Customer._CustomerAgreements = filtered + + self._Customer = value + if self._Customer is not None: + if self not in self._Customer._CustomerAgreements: + self._Customer._CustomerAgreements.append(self) + + Customer = property(getCustomer, setCustomer) + + def getEndDeviceControls(self): + """Could be deprecated in the future. + """ + return self._EndDeviceControls + + def setEndDeviceControls(self, value): + for x in self._EndDeviceControls: + x.CustomerAgreement = None + for y in value: + y._CustomerAgreement = self + self._EndDeviceControls = value + + EndDeviceControls = property(getEndDeviceControls, setEndDeviceControls) + + def addEndDeviceControls(self, *EndDeviceControls): + for obj in EndDeviceControls: + obj.CustomerAgreement = self + + def removeEndDeviceControls(self, *EndDeviceControls): + for obj in EndDeviceControls: + obj.CustomerAgreement = None + diff --git a/CIM16/IEC61968/Customers/PricingStructure.py b/CIM16/IEC61968/Customers/PricingStructure.py new file mode 100755 index 00000000..7801d1ff --- /dev/null +++ b/CIM16/IEC61968/Customers/PricingStructure.py @@ -0,0 +1,206 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class PricingStructure(Document): + """Grouping of pricing components and prices used in the creation of customer charges and the eligibility criteria under which these terms may be offered to a customer. The reasons for grouping include state, customer classification, site characteristics, classification (i.e. fee price structure, deposit price structure, electric service price structure, etc.) and accounting requirements.Grouping of pricing components and prices used in the creation of customer charges and the eligibility criteria under which these terms may be offered to a customer. The reasons for grouping include state, customer classification, site characteristics, classification (i.e. fee price structure, deposit price structure, electric service price structure, etc.) and accounting requirements. + """ + + def __init__(self, dailyFloorUsage=0, dailyCeilingUsage=0, taxExemption=False, code='', dailyEstimatedUsage=0, revenueKind="irrigation", ServiceCategory=None, CustomerAgreements=None, ServiceDeliveryPoints=None, Tariffs=None, Transactions=None, *args, **kw_args): + """Initialises a new 'PricingStructure' instance. + + @param dailyFloorUsage: Absolute minimum valid non-demand usage quantity used in validating a customer's billed non-demand usage. + @param dailyCeilingUsage: Absolute maximum valid non-demand usage quantity used in validating a customer's billed non-demand usage. + @param taxExemption: True if this pricing structure is not taxable. + @param code: Unique user-allocated key for this pricing structure, used by company representatives to identify the correct price structure for allocating to a customer. For rate schedules it is often prefixed by a state code. + @param dailyEstimatedUsage: Used in place of actual computed estimated average when history of usage is not available, and typically manually entered by customer accounting. + @param revenueKind: (Accounting) Kind of revenue, often used to determine the grace period allowed, before collection actions are taken on a customer (grace periods vary between revenue classes). Values are: "irrigation", "residential", "nonResidential", "industrial", "other", "commercial", "streetLight" + @param ServiceCategory: Service category to which this pricing structure applies. + @param CustomerAgreements: All customer agreements with this pricing structure. + @param ServiceDeliveryPoints: All service delivery points (with prepayment meter running as a stand-alone device, with no CustomerAgreement or Customer) to which this pricing structure applies. + @param Tariffs: All tariffs used by this pricing structure. + @param Transactions: All transactions applying this pricing structure. + """ + #: Absolute minimum valid non-demand usage quantity used in validating a customer's billed non-demand usage. + self.dailyFloorUsage = dailyFloorUsage + + #: Absolute maximum valid non-demand usage quantity used in validating a customer's billed non-demand usage. + self.dailyCeilingUsage = dailyCeilingUsage + + #: True if this pricing structure is not taxable. + self.taxExemption = taxExemption + + #: Unique user-allocated key for this pricing structure, used by company representatives to identify the correct price structure for allocating to a customer. For rate schedules it is often prefixed by a state code. + self.code = code + + #: Used in place of actual computed estimated average when history of usage is not available, and typically manually entered by customer accounting. + self.dailyEstimatedUsage = dailyEstimatedUsage + + #: (Accounting) Kind of revenue, often used to determine the grace period allowed, before collection actions are taken on a customer (grace periods vary between revenue classes). Values are: "irrigation", "residential", "nonResidential", "industrial", "other", "commercial", "streetLight" + self.revenueKind = revenueKind + + self._ServiceCategory = None + self.ServiceCategory = ServiceCategory + + self._CustomerAgreements = [] + self.CustomerAgreements = [] if CustomerAgreements is None else CustomerAgreements + + self._ServiceDeliveryPoints = [] + self.ServiceDeliveryPoints = [] if ServiceDeliveryPoints is None else ServiceDeliveryPoints + + self._Tariffs = [] + self.Tariffs = [] if Tariffs is None else Tariffs + + self._Transactions = [] + self.Transactions = [] if Transactions is None else Transactions + + super(PricingStructure, self).__init__(*args, **kw_args) + + _attrs = ["dailyFloorUsage", "dailyCeilingUsage", "taxExemption", "code", "dailyEstimatedUsage", "revenueKind"] + _attr_types = {"dailyFloorUsage": int, "dailyCeilingUsage": int, "taxExemption": bool, "code": str, "dailyEstimatedUsage": int, "revenueKind": str} + _defaults = {"dailyFloorUsage": 0, "dailyCeilingUsage": 0, "taxExemption": False, "code": '', "dailyEstimatedUsage": 0, "revenueKind": "irrigation"} + _enums = {"revenueKind": "RevenueKind"} + _refs = ["ServiceCategory", "CustomerAgreements", "ServiceDeliveryPoints", "Tariffs", "Transactions"] + _many_refs = ["CustomerAgreements", "ServiceDeliveryPoints", "Tariffs", "Transactions"] + + def getServiceCategory(self): + """Service category to which this pricing structure applies. + """ + return self._ServiceCategory + + def setServiceCategory(self, value): + if self._ServiceCategory is not None: + filtered = [x for x in self.ServiceCategory.PricingStructures if x != self] + self._ServiceCategory._PricingStructures = filtered + + self._ServiceCategory = value + if self._ServiceCategory is not None: + if self not in self._ServiceCategory._PricingStructures: + self._ServiceCategory._PricingStructures.append(self) + + ServiceCategory = property(getServiceCategory, setServiceCategory) + + def getCustomerAgreements(self): + """All customer agreements with this pricing structure. + """ + return self._CustomerAgreements + + def setCustomerAgreements(self, value): + for p in self._CustomerAgreements: + filtered = [q for q in p.PricingStructures if q != self] + self._CustomerAgreements._PricingStructures = filtered + for r in value: + if self not in r._PricingStructures: + r._PricingStructures.append(self) + self._CustomerAgreements = value + + CustomerAgreements = property(getCustomerAgreements, setCustomerAgreements) + + def addCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + if self not in obj._PricingStructures: + obj._PricingStructures.append(self) + self._CustomerAgreements.append(obj) + + def removeCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + if self in obj._PricingStructures: + obj._PricingStructures.remove(self) + self._CustomerAgreements.remove(obj) + + def getServiceDeliveryPoints(self): + """All service delivery points (with prepayment meter running as a stand-alone device, with no CustomerAgreement or Customer) to which this pricing structure applies. + """ + return self._ServiceDeliveryPoints + + def setServiceDeliveryPoints(self, value): + for p in self._ServiceDeliveryPoints: + filtered = [q for q in p.PricingStructures if q != self] + self._ServiceDeliveryPoints._PricingStructures = filtered + for r in value: + if self not in r._PricingStructures: + r._PricingStructures.append(self) + self._ServiceDeliveryPoints = value + + ServiceDeliveryPoints = property(getServiceDeliveryPoints, setServiceDeliveryPoints) + + def addServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + if self not in obj._PricingStructures: + obj._PricingStructures.append(self) + self._ServiceDeliveryPoints.append(obj) + + def removeServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + if self in obj._PricingStructures: + obj._PricingStructures.remove(self) + self._ServiceDeliveryPoints.remove(obj) + + def getTariffs(self): + """All tariffs used by this pricing structure. + """ + return self._Tariffs + + def setTariffs(self, value): + for p in self._Tariffs: + filtered = [q for q in p.PricingStructures if q != self] + self._Tariffs._PricingStructures = filtered + for r in value: + if self not in r._PricingStructures: + r._PricingStructures.append(self) + self._Tariffs = value + + Tariffs = property(getTariffs, setTariffs) + + def addTariffs(self, *Tariffs): + for obj in Tariffs: + if self not in obj._PricingStructures: + obj._PricingStructures.append(self) + self._Tariffs.append(obj) + + def removeTariffs(self, *Tariffs): + for obj in Tariffs: + if self in obj._PricingStructures: + obj._PricingStructures.remove(self) + self._Tariffs.remove(obj) + + def getTransactions(self): + """All transactions applying this pricing structure. + """ + return self._Transactions + + def setTransactions(self, value): + for x in self._Transactions: + x.PricingStructure = None + for y in value: + y._PricingStructure = self + self._Transactions = value + + Transactions = property(getTransactions, setTransactions) + + def addTransactions(self, *Transactions): + for obj in Transactions: + obj.PricingStructure = self + + def removeTransactions(self, *Transactions): + for obj in Transactions: + obj.PricingStructure = None + diff --git a/CIM16/IEC61968/Customers/ServiceCategory.py b/CIM16/IEC61968/Customers/ServiceCategory.py new file mode 100755 index 00000000..b66b5344 --- /dev/null +++ b/CIM16/IEC61968/Customers/ServiceCategory.py @@ -0,0 +1,95 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ServiceCategory(IdentifiedObject): + """Category of service provided to the customer.Category of service provided to the customer. + """ + + def __init__(self, kind="other", PricingStructures=None, ServiceDeliveryPoints=None, *args, **kw_args): + """Initialises a new 'ServiceCategory' instance. + + @param kind: Kind of service. Values are: "other", "refuse", "sewerage", "electricity", "heat", "internet", "rates", "time", "water", "gas", "tvLicence" + @param PricingStructures: All pricing structures applicable to this service category. + @param ServiceDeliveryPoints: All service delivery points that deliver this category of service. + """ + #: Kind of service. Values are: "other", "refuse", "sewerage", "electricity", "heat", "internet", "rates", "time", "water", "gas", "tvLicence" + self.kind = kind + + self._PricingStructures = [] + self.PricingStructures = [] if PricingStructures is None else PricingStructures + + self._ServiceDeliveryPoints = [] + self.ServiceDeliveryPoints = [] if ServiceDeliveryPoints is None else ServiceDeliveryPoints + + super(ServiceCategory, self).__init__(*args, **kw_args) + + _attrs = ["kind"] + _attr_types = {"kind": str} + _defaults = {"kind": "other"} + _enums = {"kind": "ServiceKind"} + _refs = ["PricingStructures", "ServiceDeliveryPoints"] + _many_refs = ["PricingStructures", "ServiceDeliveryPoints"] + + def getPricingStructures(self): + """All pricing structures applicable to this service category. + """ + return self._PricingStructures + + def setPricingStructures(self, value): + for x in self._PricingStructures: + x.ServiceCategory = None + for y in value: + y._ServiceCategory = self + self._PricingStructures = value + + PricingStructures = property(getPricingStructures, setPricingStructures) + + def addPricingStructures(self, *PricingStructures): + for obj in PricingStructures: + obj.ServiceCategory = self + + def removePricingStructures(self, *PricingStructures): + for obj in PricingStructures: + obj.ServiceCategory = None + + def getServiceDeliveryPoints(self): + """All service delivery points that deliver this category of service. + """ + return self._ServiceDeliveryPoints + + def setServiceDeliveryPoints(self, value): + for x in self._ServiceDeliveryPoints: + x.ServiceCategory = None + for y in value: + y._ServiceCategory = self + self._ServiceDeliveryPoints = value + + ServiceDeliveryPoints = property(getServiceDeliveryPoints, setServiceDeliveryPoints) + + def addServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + obj.ServiceCategory = self + + def removeServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + obj.ServiceCategory = None + diff --git a/CIM16/IEC61968/Customers/ServiceLocation.py b/CIM16/IEC61968/Customers/ServiceLocation.py new file mode 100755 index 00000000..20dc732b --- /dev/null +++ b/CIM16/IEC61968/Customers/ServiceLocation.py @@ -0,0 +1,160 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Location import Location + +class ServiceLocation(Location): + """A customer service location has one or more service delivery points, which in turn relate to Meters. The location may be a point or a polygon, depending on the specific circumstances. For distribution, the service location is typically the location of the utility customer's premise. Because a customer's premise may have one or more meters, the service delivery point is used to define the actual conducting equipment that the end device attaches to at the utility customer's service location. For transmission, it is the point(s) of interconnection on the transmission provider's transmission system where capacity and/or energy transmitted by the transmission provider is made available to the receiving party.A customer service location has one or more service delivery points, which in turn relate to Meters. The location may be a point or a polygon, depending on the specific circumstances. For distribution, the service location is typically the location of the utility customer's premise. Because a customer's premise may have one or more meters, the service delivery point is used to define the actual conducting equipment that the end device attaches to at the utility customer's service location. For transmission, it is the point(s) of interconnection on the transmission provider's transmission system where capacity and/or energy transmitted by the transmission provider is made available to the receiving party. + """ + + def __init__(self, siteAccessProblem='', accessMethod='', needsInspection=False, EndDevices=None, ErpPersons=None, ServiceDeliveryPoints=None, CustomerAgreements=None, *args, **kw_args): + """Initialises a new 'ServiceLocation' instance. + + @param siteAccessProblem: Problems previously encountered when visiting or performing work on this site. Examples include: bad dog, violent customer, verbally abusive occupant, obstructions, safety hazards, etc. + @param accessMethod: Method for the service person to access the appropriate service locations. For example, a description of where to obtain a key if the facility is unmanned and secured. + @param needsInspection: True if inspection is needed of facilities at this service location. This could be requested by a customer, due to suspected tampering, environmental concerns (e.g., a fire in the vicinity), or to correct incompatible data. + @param EndDevices: All end devices that measure the service delivered to this service location. + @param ErpPersons: + @param ServiceDeliveryPoints: All service delivery points delivering service (of the same type) to this service location. + @param CustomerAgreements: All customer agreements regulating this service location. + """ + #: Problems previously encountered when visiting or performing work on this site. Examples include: bad dog, violent customer, verbally abusive occupant, obstructions, safety hazards, etc. + self.siteAccessProblem = siteAccessProblem + + #: Method for the service person to access the appropriate service locations. For example, a description of where to obtain a key if the facility is unmanned and secured. + self.accessMethod = accessMethod + + #: True if inspection is needed of facilities at this service location. This could be requested by a customer, due to suspected tampering, environmental concerns (e.g., a fire in the vicinity), or to correct incompatible data. + self.needsInspection = needsInspection + + self._EndDevices = [] + self.EndDevices = [] if EndDevices is None else EndDevices + + self._ErpPersons = [] + self.ErpPersons = [] if ErpPersons is None else ErpPersons + + self._ServiceDeliveryPoints = [] + self.ServiceDeliveryPoints = [] if ServiceDeliveryPoints is None else ServiceDeliveryPoints + + self._CustomerAgreements = [] + self.CustomerAgreements = [] if CustomerAgreements is None else CustomerAgreements + + super(ServiceLocation, self).__init__(*args, **kw_args) + + _attrs = ["siteAccessProblem", "accessMethod", "needsInspection"] + _attr_types = {"siteAccessProblem": str, "accessMethod": str, "needsInspection": bool} + _defaults = {"siteAccessProblem": '', "accessMethod": '', "needsInspection": False} + _enums = {} + _refs = ["EndDevices", "ErpPersons", "ServiceDeliveryPoints", "CustomerAgreements"] + _many_refs = ["EndDevices", "ErpPersons", "ServiceDeliveryPoints", "CustomerAgreements"] + + def getEndDevices(self): + """All end devices that measure the service delivered to this service location. + """ + return self._EndDevices + + def setEndDevices(self, value): + for x in self._EndDevices: + x.ServiceLocation = None + for y in value: + y._ServiceLocation = self + self._EndDevices = value + + EndDevices = property(getEndDevices, setEndDevices) + + def addEndDevices(self, *EndDevices): + for obj in EndDevices: + obj.ServiceLocation = self + + def removeEndDevices(self, *EndDevices): + for obj in EndDevices: + obj.ServiceLocation = None + + def getErpPersons(self): + + return self._ErpPersons + + def setErpPersons(self, value): + for x in self._ErpPersons: + x.ServiceLocation = None + for y in value: + y._ServiceLocation = self + self._ErpPersons = value + + ErpPersons = property(getErpPersons, setErpPersons) + + def addErpPersons(self, *ErpPersons): + for obj in ErpPersons: + obj.ServiceLocation = self + + def removeErpPersons(self, *ErpPersons): + for obj in ErpPersons: + obj.ServiceLocation = None + + def getServiceDeliveryPoints(self): + """All service delivery points delivering service (of the same type) to this service location. + """ + return self._ServiceDeliveryPoints + + def setServiceDeliveryPoints(self, value): + for x in self._ServiceDeliveryPoints: + x.ServiceLocation = None + for y in value: + y._ServiceLocation = self + self._ServiceDeliveryPoints = value + + ServiceDeliveryPoints = property(getServiceDeliveryPoints, setServiceDeliveryPoints) + + def addServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + obj.ServiceLocation = self + + def removeServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + obj.ServiceLocation = None + + def getCustomerAgreements(self): + """All customer agreements regulating this service location. + """ + return self._CustomerAgreements + + def setCustomerAgreements(self, value): + for p in self._CustomerAgreements: + filtered = [q for q in p.ServiceLocations if q != self] + self._CustomerAgreements._ServiceLocations = filtered + for r in value: + if self not in r._ServiceLocations: + r._ServiceLocations.append(self) + self._CustomerAgreements = value + + CustomerAgreements = property(getCustomerAgreements, setCustomerAgreements) + + def addCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + if self not in obj._ServiceLocations: + obj._ServiceLocations.append(self) + self._CustomerAgreements.append(obj) + + def removeCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + if self in obj._ServiceLocations: + obj._ServiceLocations.remove(self) + self._CustomerAgreements.remove(obj) + diff --git a/CIM16/IEC61968/Customers/Tariff.py b/CIM16/IEC61968/Customers/Tariff.py new file mode 100755 index 00000000..6dedc38f --- /dev/null +++ b/CIM16/IEC61968/Customers/Tariff.py @@ -0,0 +1,111 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class Tariff(Document): + """Document, approved by the responsible regulatory agency, listing the terms and conditions, including a schedule of prices, under which utility services will be provided. It has a unique number within the state or province. For rate schedules it is frequently allocated by the affiliated Public utilities commission (PUC).Document, approved by the responsible regulatory agency, listing the terms and conditions, including a schedule of prices, under which utility services will be provided. It has a unique number within the state or province. For rate schedules it is frequently allocated by the affiliated Public utilities commission (PUC). + """ + + def __init__(self, startDate='', endDate='', PricingStructures=None, TariffProfiles=None, *args, **kw_args): + """Initialises a new 'Tariff' instance. + + @param startDate: Date tariff was activated. + @param endDate: (if tariff became inactive) Date tariff was terminated. + @param PricingStructures: All pricing structures using this tariff. + @param TariffProfiles: All tariff profiles using this tariff. + """ + #: Date tariff was activated. + self.startDate = startDate + + #: (if tariff became inactive) Date tariff was terminated. + self.endDate = endDate + + self._PricingStructures = [] + self.PricingStructures = [] if PricingStructures is None else PricingStructures + + self._TariffProfiles = [] + self.TariffProfiles = [] if TariffProfiles is None else TariffProfiles + + super(Tariff, self).__init__(*args, **kw_args) + + _attrs = ["startDate", "endDate"] + _attr_types = {"startDate": str, "endDate": str} + _defaults = {"startDate": '', "endDate": ''} + _enums = {} + _refs = ["PricingStructures", "TariffProfiles"] + _many_refs = ["PricingStructures", "TariffProfiles"] + + def getPricingStructures(self): + """All pricing structures using this tariff. + """ + return self._PricingStructures + + def setPricingStructures(self, value): + for p in self._PricingStructures: + filtered = [q for q in p.Tariffs if q != self] + self._PricingStructures._Tariffs = filtered + for r in value: + if self not in r._Tariffs: + r._Tariffs.append(self) + self._PricingStructures = value + + PricingStructures = property(getPricingStructures, setPricingStructures) + + def addPricingStructures(self, *PricingStructures): + for obj in PricingStructures: + if self not in obj._Tariffs: + obj._Tariffs.append(self) + self._PricingStructures.append(obj) + + def removePricingStructures(self, *PricingStructures): + for obj in PricingStructures: + if self in obj._Tariffs: + obj._Tariffs.remove(self) + self._PricingStructures.remove(obj) + + def getTariffProfiles(self): + """All tariff profiles using this tariff. + """ + return self._TariffProfiles + + def setTariffProfiles(self, value): + for p in self._TariffProfiles: + filtered = [q for q in p.Tariffs if q != self] + self._TariffProfiles._Tariffs = filtered + for r in value: + if self not in r._Tariffs: + r._Tariffs.append(self) + self._TariffProfiles = value + + TariffProfiles = property(getTariffProfiles, setTariffProfiles) + + def addTariffProfiles(self, *TariffProfiles): + for obj in TariffProfiles: + if self not in obj._Tariffs: + obj._Tariffs.append(self) + self._TariffProfiles.append(obj) + + def removeTariffProfiles(self, *TariffProfiles): + for obj in TariffProfiles: + if self in obj._Tariffs: + obj._Tariffs.remove(self) + self._TariffProfiles.remove(obj) + diff --git a/CIM16/IEC61968/Customers/__init__.py b/CIM16/IEC61968/Customers/__init__.py new file mode 100755 index 00000000..9aa28b17 --- /dev/null +++ b/CIM16/IEC61968/Customers/__init__.py @@ -0,0 +1,49 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package contains the core information classes that support customer billing applications. +""" + +from CIM16.IEC61968.Customers.Tariff import Tariff +from CIM16.IEC61968.Customers.CustomerAccount import CustomerAccount +from CIM16.IEC61968.Customers.ServiceLocation import ServiceLocation +from CIM16.IEC61968.Customers.CustomerAgreement import CustomerAgreement +from CIM16.IEC61968.Customers.ServiceCategory import ServiceCategory +from CIM16.IEC61968.Customers.PricingStructure import PricingStructure +from CIM16.IEC61968.Customers.Customer import Customer + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Customers" +nsPrefix = "cimCustomers" + + +class CustomerKind(str): + """Values are: windMachine, residentialAndCommercial, internalUse, energyServiceScheduler, residentialAndStreetlight, residential, pumpingLoad, other, commercialIndustrial, energyServiceSupplier, residentialStreetlightOthers, residentialFarmService + """ + pass + +class RevenueKind(str): + """Values are: irrigation, residential, nonResidential, industrial, other, commercial, streetLight + """ + pass + +class ServiceKind(str): + """Values are: other, refuse, sewerage, electricity, heat, internet, rates, time, water, gas, tvLicence + """ + pass diff --git a/CIM16/IEC61968/IEC61968CIMVersion.py b/CIM16/IEC61968/IEC61968CIMVersion.py new file mode 100755 index 00000000..d9c67e2d --- /dev/null +++ b/CIM16/IEC61968/IEC61968CIMVersion.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class IEC61968CIMVersion(Element): + """IEC 61968 version number assigned to this UML model.IEC 61968 version number assigned to this UML model. + """ + + def __init__(self, version='', date='', *args, **kw_args): + """Initialises a new 'IEC61968CIMVersion' instance. + + @param version: Form is IEC61968CIMXXvYY where XX is the major CIM package version and the YY is the minor version. For example IEC61968CIM10v17. + @param date: Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. + """ + #: Form is IEC61968CIMXXvYY where XX is the major CIM package version and the YY is the minor version. For example IEC61968CIM10v17. + self.version = version + + #: Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. + self.date = date + + super(IEC61968CIMVersion, self).__init__(*args, **kw_args) + + _attrs = ["version", "date"] + _attr_types = {"version": str, "date": str} + _defaults = {"version": '', "date": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/LoadControl/ConnectDisconnectFunction.py b/CIM16/IEC61968/LoadControl/ConnectDisconnectFunction.py new file mode 100755 index 00000000..49acdf86 --- /dev/null +++ b/CIM16/IEC61968/LoadControl/ConnectDisconnectFunction.py @@ -0,0 +1,104 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Metering.EndDeviceFunction import EndDeviceFunction + +class ConnectDisconnectFunction(EndDeviceFunction): + """A function that will disconnect or reconnect the customer's load under defined conditions.A function that will disconnect or reconnect the customer's load under defined conditions. + """ + + def __init__(self, isDelayedDiscon=False, eventCount=0, isRemoteAutoReconOp=False, isRemoteAutoDisconOp=False, isLocalAutoDisconOp=False, isLocalAutoReconOp=False, isConnected=False, rcdInfo=None, Switches=None, *args, **kw_args): + """Initialises a new 'ConnectDisconnectFunction' instance. + + @param isDelayedDiscon: If set true, the switch may disconnect the service at the end of a specified time delay after the disconnect signal had been given. If set false, the switch may disconnect the service immediately after the disconnect signal had been given. This is typically the case for over current circuit-breakers which are classified as either instantaneous or slow acting. + @param eventCount: Running cumulative count of (connect or disconnect) events, for the lifetime of this function or until the value is cleared. + @param isRemoteAutoReconOp: If set true and if reconnection can be operated remotely, then the operation happens automatically. If false and if reconnection can be operated remotely, then the operation happens manually. + @param isRemoteAutoDisconOp: If set true and if disconnection can be operated remotely, then the operation happens automatically. If set false and if disconnection can be operated remotely, then the operation happens manually. + @param isLocalAutoDisconOp: (if disconnection can be operated locally) If set true, the operation happens automatically, otherwise it happens manually. + @param isLocalAutoReconOp: If set true and if reconnection can be operated locally, then the operation happens automatically. Otherwise, it is manually. + @param isConnected: True if this function is in the connected state. + @param rcdInfo: Information on remote connect disconnect switch. + @param Switches: + """ + #: If set true, the switch may disconnect the service at the end of a specified time delay after the disconnect signal had been given. If set false, the switch may disconnect the service immediately after the disconnect signal had been given. This is typically the case for over current circuit-breakers which are classified as either instantaneous or slow acting. + self.isDelayedDiscon = isDelayedDiscon + + #: Running cumulative count of (connect or disconnect) events, for the lifetime of this function or until the value is cleared. + self.eventCount = eventCount + + #: If set true and if reconnection can be operated remotely, then the operation happens automatically. If false and if reconnection can be operated remotely, then the operation happens manually. + self.isRemoteAutoReconOp = isRemoteAutoReconOp + + #: If set true and if disconnection can be operated remotely, then the operation happens automatically. If set false and if disconnection can be operated remotely, then the operation happens manually. + self.isRemoteAutoDisconOp = isRemoteAutoDisconOp + + #: (if disconnection can be operated locally) If set true, the operation happens automatically, otherwise it happens manually. + self.isLocalAutoDisconOp = isLocalAutoDisconOp + + #: If set true and if reconnection can be operated locally, then the operation happens automatically. Otherwise, it is manually. + self.isLocalAutoReconOp = isLocalAutoReconOp + + #: True if this function is in the connected state. + self.isConnected = isConnected + + self.rcdInfo = rcdInfo + + self._Switches = [] + self.Switches = [] if Switches is None else Switches + + super(ConnectDisconnectFunction, self).__init__(*args, **kw_args) + + _attrs = ["isDelayedDiscon", "eventCount", "isRemoteAutoReconOp", "isRemoteAutoDisconOp", "isLocalAutoDisconOp", "isLocalAutoReconOp", "isConnected"] + _attr_types = {"isDelayedDiscon": bool, "eventCount": int, "isRemoteAutoReconOp": bool, "isRemoteAutoDisconOp": bool, "isLocalAutoDisconOp": bool, "isLocalAutoReconOp": bool, "isConnected": bool} + _defaults = {"isDelayedDiscon": False, "eventCount": 0, "isRemoteAutoReconOp": False, "isRemoteAutoDisconOp": False, "isLocalAutoDisconOp": False, "isLocalAutoReconOp": False, "isConnected": False} + _enums = {} + _refs = ["rcdInfo", "Switches"] + _many_refs = ["Switches"] + + # Information on remote connect disconnect switch. + rcdInfo = None + + def getSwitches(self): + + return self._Switches + + def setSwitches(self, value): + for p in self._Switches: + filtered = [q for q in p.ConnectDisconnectFunctions if q != self] + self._Switches._ConnectDisconnectFunctions = filtered + for r in value: + if self not in r._ConnectDisconnectFunctions: + r._ConnectDisconnectFunctions.append(self) + self._Switches = value + + Switches = property(getSwitches, setSwitches) + + def addSwitches(self, *Switches): + for obj in Switches: + if self not in obj._ConnectDisconnectFunctions: + obj._ConnectDisconnectFunctions.append(self) + self._Switches.append(obj) + + def removeSwitches(self, *Switches): + for obj in Switches: + if self in obj._ConnectDisconnectFunctions: + obj._ConnectDisconnectFunctions.remove(self) + self._Switches.remove(obj) + diff --git a/CIM16/IEC61968/LoadControl/RemoteConnectDisconnectInfo.py b/CIM16/IEC61968/LoadControl/RemoteConnectDisconnectInfo.py new file mode 100755 index 00000000..057efb42 --- /dev/null +++ b/CIM16/IEC61968/LoadControl/RemoteConnectDisconnectInfo.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class RemoteConnectDisconnectInfo(object): + """Details of remote connect disconnect function.Details of remote connect disconnect function. + """ + + def __init__(self, isArmConnect=False, energyUsageWarning=0.0, needsVoltageLimitCheck=False, customerVoltageLimit=0.0, isArmDisconnect=False, isEnergyLimiting=False, armedTimeout=0.0, powerLimit=0.0, needsPowerLimitCheck=False, usePushbutton=False, energyLimit=0.0, energyUsageStartDateTime=''): + """Initialises a new 'RemoteConnectDisconnectInfo' instance. + + @param isArmConnect: True if the RCD switch must be armed before a connect action can be initiated. + @param energyUsageWarning: Warning energy limit, used to trigger event code that energy usage is nearing limit. + @param needsVoltageLimitCheck: True if voltage limit must be checked to prevent connect if voltage is over the limit. + @param customerVoltageLimit: Voltage limit on customer side of RCD switch above which the connect should not be made. + @param isArmDisconnect: True if the RCD switch must be armed before a disconnect action can be initiated. + @param isEnergyLimiting: True if the energy usage is limited and the customer will be disconnected if they go over the limit. + @param armedTimeout: Setting of the timeout elapsed time. + @param powerLimit: Load limit above which the connect should either not take place or should cause an immediate disconnect. + @param needsPowerLimitCheck: True if load limit must be checked to issue an immediate disconnect (after a connect) if load is over the limit. + @param usePushbutton: True if pushbutton must be used for connect. + @param energyLimit: Limit of energy before disconnect. + @param energyUsageStartDateTime: Start date and time to accumulate energy for energy usage limiting. + """ + #: True if the RCD switch must be armed before a connect action can be initiated. + self.isArmConnect = isArmConnect + + #: Warning energy limit, used to trigger event code that energy usage is nearing limit. + self.energyUsageWarning = energyUsageWarning + + #: True if voltage limit must be checked to prevent connect if voltage is over the limit. + self.needsVoltageLimitCheck = needsVoltageLimitCheck + + #: Voltage limit on customer side of RCD switch above which the connect should not be made. + self.customerVoltageLimit = customerVoltageLimit + + #: True if the RCD switch must be armed before a disconnect action can be initiated. + self.isArmDisconnect = isArmDisconnect + + #: True if the energy usage is limited and the customer will be disconnected if they go over the limit. + self.isEnergyLimiting = isEnergyLimiting + + #: Setting of the timeout elapsed time. + self.armedTimeout = armedTimeout + + #: Load limit above which the connect should either not take place or should cause an immediate disconnect. + self.powerLimit = powerLimit + + #: True if load limit must be checked to issue an immediate disconnect (after a connect) if load is over the limit. + self.needsPowerLimitCheck = needsPowerLimitCheck + + #: True if pushbutton must be used for connect. + self.usePushbutton = usePushbutton + + #: Limit of energy before disconnect. + self.energyLimit = energyLimit + + #: Start date and time to accumulate energy for energy usage limiting. + self.energyUsageStartDateTime = energyUsageStartDateTime + + + _attrs = ["isArmConnect", "energyUsageWarning", "needsVoltageLimitCheck", "customerVoltageLimit", "isArmDisconnect", "isEnergyLimiting", "armedTimeout", "powerLimit", "needsPowerLimitCheck", "usePushbutton", "energyLimit", "energyUsageStartDateTime"] + _attr_types = {"isArmConnect": bool, "energyUsageWarning": float, "needsVoltageLimitCheck": bool, "customerVoltageLimit": float, "isArmDisconnect": bool, "isEnergyLimiting": bool, "armedTimeout": float, "powerLimit": float, "needsPowerLimitCheck": bool, "usePushbutton": bool, "energyLimit": float, "energyUsageStartDateTime": str} + _defaults = {"isArmConnect": False, "energyUsageWarning": 0.0, "needsVoltageLimitCheck": False, "customerVoltageLimit": 0.0, "isArmDisconnect": False, "isEnergyLimiting": False, "armedTimeout": 0.0, "powerLimit": 0.0, "needsPowerLimitCheck": False, "usePushbutton": False, "energyLimit": 0.0, "energyUsageStartDateTime": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/LoadControl/__init__.py b/CIM16/IEC61968/LoadControl/__init__.py new file mode 100755 index 00000000..201dc6a2 --- /dev/null +++ b/CIM16/IEC61968/LoadControl/__init__.py @@ -0,0 +1,29 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package is an extension of the Metering package and contains the information classes that support specialised applications such as demand-side management using load control equipment. These classes are generally associated with the point where a service is delivered to the customer. +""" + +from CIM16.IEC61968.LoadControl.ConnectDisconnectFunction import ConnectDisconnectFunction +from CIM16.IEC61968.LoadControl.RemoteConnectDisconnectInfo import RemoteConnectDisconnectInfo + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#LoadControl" +nsPrefix = "cimLoadControl" + diff --git a/CIM16/IEC61968/Metering/ComFunction.py b/CIM16/IEC61968/Metering/ComFunction.py new file mode 100755 index 00000000..5e3b9360 --- /dev/null +++ b/CIM16/IEC61968/Metering/ComFunction.py @@ -0,0 +1,51 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Metering.EndDeviceFunction import EndDeviceFunction + +class ComFunction(EndDeviceFunction): + """Communication function of communication equipment or a device such as a meter.Communication function of communication equipment or a device such as a meter. + """ + + def __init__(self, amrRouter='', amrAddress='', twoWay=False, *args, **kw_args): + """Initialises a new 'ComFunction' instance. + + @param amrRouter: Communication ID number (e.g. port number, serial number, data collector ID, etc.) of the parent device associated to this AMR module. Note: If someone swaps out a meter, they may inadvertently disrupt the AMR system. Some technologies route readings from nearby meters through a common collection point on an electricity meter. Removal of such a meter disrupts AMR for numerous nearby meters. + @param amrAddress: Communication ID number (e.g. serial number, IP address, telephone number, etc.) of the AMR module which serves this meter. + @param twoWay: True when the AMR module can both send and receive messages. Default is false (i.e., module can only send). + """ + #: Communication ID number (e.g. port number, serial number, data collector ID, etc.) of the parent device associated to this AMR module. Note: If someone swaps out a meter, they may inadvertently disrupt the AMR system. Some technologies route readings from nearby meters through a common collection point on an electricity meter. Removal of such a meter disrupts AMR for numerous nearby meters. + self.amrRouter = amrRouter + + #: Communication ID number (e.g. serial number, IP address, telephone number, etc.) of the AMR module which serves this meter. + self.amrAddress = amrAddress + + #: True when the AMR module can both send and receive messages. Default is false (i.e., module can only send). + self.twoWay = twoWay + + super(ComFunction, self).__init__(*args, **kw_args) + + _attrs = ["amrRouter", "amrAddress", "twoWay"] + _attr_types = {"amrRouter": str, "amrAddress": str, "twoWay": bool} + _defaults = {"amrRouter": '', "amrAddress": '', "twoWay": False} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/Metering/DemandResponseProgram.py b/CIM16/IEC61968/Metering/DemandResponseProgram.py new file mode 100755 index 00000000..ac30169b --- /dev/null +++ b/CIM16/IEC61968/Metering/DemandResponseProgram.py @@ -0,0 +1,127 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class DemandResponseProgram(IdentifiedObject): + """Demand response program.Demand response program. + """ + + def __init__(self, type='', EndDeviceControls=None, validityInterval=None, CustomerAgreements=None, EndDeviceGroups=None, *args, **kw_args): + """Initialises a new 'DemandResponseProgram' instance. + + @param type: Type of demand response program; examples are CPP (critical-peak pricing), RTP (real-time pricing), DLC (direct load control), DBP (demand bidding program), BIP (base interruptible program). Note that possible types change a lot and it would be impossible to enumerate them all. + @param EndDeviceControls: All end device controls with this demand response program. + @param validityInterval: Interval within which the program is valid. + @param CustomerAgreements: All customer agreements with this demand response program. + @param EndDeviceGroups: All groups of end devices with this demand response program. + """ + #: Type of demand response program; examples are CPP (critical-peak pricing), RTP (real-time pricing), DLC (direct load control), DBP (demand bidding program), BIP (base interruptible program). Note that possible types change a lot and it would be impossible to enumerate them all. + self.type = type + + self._EndDeviceControls = [] + self.EndDeviceControls = [] if EndDeviceControls is None else EndDeviceControls + + self.validityInterval = validityInterval + + self._CustomerAgreements = [] + self.CustomerAgreements = [] if CustomerAgreements is None else CustomerAgreements + + self._EndDeviceGroups = [] + self.EndDeviceGroups = [] if EndDeviceGroups is None else EndDeviceGroups + + super(DemandResponseProgram, self).__init__(*args, **kw_args) + + _attrs = ["type"] + _attr_types = {"type": str} + _defaults = {"type": ''} + _enums = {} + _refs = ["EndDeviceControls", "validityInterval", "CustomerAgreements", "EndDeviceGroups"] + _many_refs = ["EndDeviceControls", "CustomerAgreements", "EndDeviceGroups"] + + def getEndDeviceControls(self): + """All end device controls with this demand response program. + """ + return self._EndDeviceControls + + def setEndDeviceControls(self, value): + for x in self._EndDeviceControls: + x.DemandResponseProgram = None + for y in value: + y._DemandResponseProgram = self + self._EndDeviceControls = value + + EndDeviceControls = property(getEndDeviceControls, setEndDeviceControls) + + def addEndDeviceControls(self, *EndDeviceControls): + for obj in EndDeviceControls: + obj.DemandResponseProgram = self + + def removeEndDeviceControls(self, *EndDeviceControls): + for obj in EndDeviceControls: + obj.DemandResponseProgram = None + + # Interval within which the program is valid. + validityInterval = None + + def getCustomerAgreements(self): + """All customer agreements with this demand response program. + """ + return self._CustomerAgreements + + def setCustomerAgreements(self, value): + for x in self._CustomerAgreements: + x.DemandResponseProgram = None + for y in value: + y._DemandResponseProgram = self + self._CustomerAgreements = value + + CustomerAgreements = property(getCustomerAgreements, setCustomerAgreements) + + def addCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + obj.DemandResponseProgram = self + + def removeCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + obj.DemandResponseProgram = None + + def getEndDeviceGroups(self): + """All groups of end devices with this demand response program. + """ + return self._EndDeviceGroups + + def setEndDeviceGroups(self, value): + for x in self._EndDeviceGroups: + x.DemandResponseProgram = None + for y in value: + y._DemandResponseProgram = self + self._EndDeviceGroups = value + + EndDeviceGroups = property(getEndDeviceGroups, setEndDeviceGroups) + + def addEndDeviceGroups(self, *EndDeviceGroups): + for obj in EndDeviceGroups: + obj.DemandResponseProgram = self + + def removeEndDeviceGroups(self, *EndDeviceGroups): + for obj in EndDeviceGroups: + obj.DemandResponseProgram = None + diff --git a/CIM16/IEC61968/Metering/DynamicDemand.py b/CIM16/IEC61968/Metering/DynamicDemand.py new file mode 100755 index 00000000..ac404269 --- /dev/null +++ b/CIM16/IEC61968/Metering/DynamicDemand.py @@ -0,0 +1,49 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class DynamicDemand(object): + """Dynamic demand description. The formula by which demand is measured is an important underlying definition to the measurement. Generally speaking, all of the meters in a given utility will be configured to measure demand the same way. Nevertheless, it must be defined. An 'interval' of 60 min, 30 min, 15 min, 10 min or 5 min must be defined to describe the interval of time over which usage is measured. When demand is defined to be DemandKind.rollingBlock, both an 'interval' and a 'subinterval' must be defined, where the 'subinterval' must be a multiple of the 'interval' which contains it. A common setting is '15-minute rolling block with 5-minute subintervals.'Dynamic demand description. The formula by which demand is measured is an important underlying definition to the measurement. Generally speaking, all of the meters in a given utility will be configured to measure demand the same way. Nevertheless, it must be defined. An 'interval' of 60 min, 30 min, 15 min, 10 min or 5 min must be defined to describe the interval of time over which usage is measured. When demand is defined to be DemandKind.rollingBlock, both an 'interval' and a 'subinterval' must be defined, where the 'subinterval' must be a multiple of the 'interval' which contains it. A common setting is '15-minute rolling block with 5-minute subintervals.' + """ + + def __init__(self, subInterval=0.0, interval=0.0, kind="fixedBlock"): + """Initialises a new 'DynamicDemand' instance. + + @param subInterval: (if 'kind'=rollingBlock) Subinterval, must be multiple of 'interval' that contains it. + @param interval: Demand interval. + @param kind: Kind of demand. Values are: "fixedBlock", "rollingBlock", "logarithmic" + """ + #: (if 'kind'=rollingBlock) Subinterval, must be multiple of 'interval' that contains it. + self.subInterval = subInterval + + #: Demand interval. + self.interval = interval + + #: Kind of demand. Values are: "fixedBlock", "rollingBlock", "logarithmic" + self.kind = kind + + + _attrs = ["subInterval", "interval", "kind"] + _attr_types = {"subInterval": float, "interval": float, "kind": str} + _defaults = {"subInterval": 0.0, "interval": 0.0, "kind": "fixedBlock"} + _enums = {"kind": "DemandKind"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/Metering/ElectricMeteringFunction.py b/CIM16/IEC61968/Metering/ElectricMeteringFunction.py new file mode 100755 index 00000000..5f494225 --- /dev/null +++ b/CIM16/IEC61968/Metering/ElectricMeteringFunction.py @@ -0,0 +1,71 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Metering.EndDeviceFunction import EndDeviceFunction + +class ElectricMeteringFunction(EndDeviceFunction): + """Functionality performed by an electric meter.Functionality performed by an electric meter. + """ + + def __init__(self, kWMultiplier=0, kWhMultiplier=0, ctRatioMultiplier=None, billingMultiplier=None, vtRatioMultiplier=None, demandMultiplier=None, *args, **kw_args): + """Initialises a new 'ElectricMeteringFunction' instance. + + @param kWMultiplier: Meter kW (pulse) multiplier, used as a multiplier for a meter register reading to determine the actual amount of usage for which to bill a customer. + @param kWhMultiplier: Meter kWh multiplier, used as a multiplier for a meter register reading to determine the actual amount of usage for which to bill a customer. + @param ctRatioMultiplier: Current transformer ratio used to convert associated quantities to real measurements. + @param billingMultiplier: Customer billing value = meter multiplier * transformer ratios * reading value. The multiplier identifies the scaling value to apply to the reported value after delivery of the tagged item. + @param vtRatioMultiplier: Voltage transformer ratio used to convert associated quantities to real measurements. + @param demandMultiplier: An additional multiplier that may be used for normalization of the demand value to an hourly value. For example, if the demand interval were set to 15 min, the demand multiplier would be 4. If the meter design is such that the demand value reported and displayed is compensated for by the meter itself and no additional scaling is required outside of the meter, the value of the demand multiplier should be '1'. + """ + #: Meter kW (pulse) multiplier, used as a multiplier for a meter register reading to determine the actual amount of usage for which to bill a customer. + self.kWMultiplier = kWMultiplier + + #: Meter kWh multiplier, used as a multiplier for a meter register reading to determine the actual amount of usage for which to bill a customer. + self.kWhMultiplier = kWhMultiplier + + self.ctRatioMultiplier = ctRatioMultiplier + + self.billingMultiplier = billingMultiplier + + self.vtRatioMultiplier = vtRatioMultiplier + + self.demandMultiplier = demandMultiplier + + super(ElectricMeteringFunction, self).__init__(*args, **kw_args) + + _attrs = ["kWMultiplier", "kWhMultiplier"] + _attr_types = {"kWMultiplier": int, "kWhMultiplier": int} + _defaults = {"kWMultiplier": 0, "kWhMultiplier": 0} + _enums = {} + _refs = ["ctRatioMultiplier", "billingMultiplier", "vtRatioMultiplier", "demandMultiplier"] + _many_refs = [] + + # Current transformer ratio used to convert associated quantities to real measurements. + ctRatioMultiplier = None + + # Customer billing value = meter multiplier * transformer ratios * reading value. The multiplier identifies the scaling value to apply to the reported value after delivery of the tagged item. + billingMultiplier = None + + # Voltage transformer ratio used to convert associated quantities to real measurements. + vtRatioMultiplier = None + + # An additional multiplier that may be used for normalization of the demand value to an hourly value. For example, if the demand interval were set to 15 min, the demand multiplier would be 4. If the meter design is such that the demand value reported and displayed is compensated for by the meter itself and no additional scaling is required outside of the meter, the value of the demand multiplier should be '1'. + demandMultiplier = None + diff --git a/CIM16/IEC61968/Metering/EndDevice.py b/CIM16/IEC61968/Metering/EndDevice.py new file mode 100755 index 00000000..81d862be --- /dev/null +++ b/CIM16/IEC61968/Metering/EndDevice.py @@ -0,0 +1,215 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetContainer import AssetContainer + +class EndDevice(AssetContainer): + """Asset container that performs one or more end device functions. One type of end device is a meter which can perform metering, load management, connect/disconnect, accounting functions, etc. Some end devices, such as ones monitoring and controlling air conditioner, refrigerator, pool pumps may be connected to a meter. All end devices may have communication capability defined by the associated communication function(s). An end device may be owned by a consumer, a service provider, utility or otherwise. There may be a related end device function that identifies a sensor or control point within a metering application or communications systems (e.g., water, gas, electricity). Some devices may use an optical port that conforms to the ANSI C12.18 standard for communications.Asset container that performs one or more end device functions. One type of end device is a meter which can perform metering, load management, connect/disconnect, accounting functions, etc. Some end devices, such as ones monitoring and controlling air conditioner, refrigerator, pool pumps may be connected to a meter. All end devices may have communication capability defined by the associated communication function(s). An end device may be owned by a consumer, a service provider, utility or otherwise. There may be a related end device function that identifies a sensor or control point within a metering application or communications systems (e.g., water, gas, electricity). Some devices may use an optical port that conforms to the ANSI C12.18 standard for communications. + """ + + def __init__(self, timeZoneOffset=0.0, amrSystem='', EndDeviceInfo=None, ServiceDeliveryPoint=None, ServiceLocation=None, EndDeviceFunctions=None, EndDeviceControls=None, Customer=None, EndDeviceGroups=None, *args, **kw_args): + """Initialises a new 'EndDevice' instance. + + @param timeZoneOffset: Time zone offset relative to GMT for the location of this end device. + @param amrSystem: Automated meter reading (AMR) system responsible for communications to this end device. + @param EndDeviceInfo: End device data. + @param ServiceDeliveryPoint: Service delivery point to which this end device belongs. + @param ServiceLocation: Service location whose service delivery is measured by this end device. + @param EndDeviceFunctions: All end device functions this end device performs. + @param EndDeviceControls: All end device controls sending commands to this end device. + @param Customer: Customer owning this end device. + @param EndDeviceGroups: All end device groups referring to this end device. + """ + #: Time zone offset relative to GMT for the location of this end device. + self.timeZoneOffset = timeZoneOffset + + #: Automated meter reading (AMR) system responsible for communications to this end device. + self.amrSystem = amrSystem + + self._EndDeviceInfo = None + self.EndDeviceInfo = EndDeviceInfo + + self._ServiceDeliveryPoint = None + self.ServiceDeliveryPoint = ServiceDeliveryPoint + + self._ServiceLocation = None + self.ServiceLocation = ServiceLocation + + self._EndDeviceFunctions = [] + self.EndDeviceFunctions = [] if EndDeviceFunctions is None else EndDeviceFunctions + + self._EndDeviceControls = [] + self.EndDeviceControls = [] if EndDeviceControls is None else EndDeviceControls + + self._Customer = None + self.Customer = Customer + + self._EndDeviceGroups = [] + self.EndDeviceGroups = [] if EndDeviceGroups is None else EndDeviceGroups + + super(EndDevice, self).__init__(*args, **kw_args) + + _attrs = ["timeZoneOffset", "amrSystem"] + _attr_types = {"timeZoneOffset": float, "amrSystem": str} + _defaults = {"timeZoneOffset": 0.0, "amrSystem": ''} + _enums = {} + _refs = ["EndDeviceInfo", "ServiceDeliveryPoint", "ServiceLocation", "EndDeviceFunctions", "EndDeviceControls", "Customer", "EndDeviceGroups"] + _many_refs = ["EndDeviceFunctions", "EndDeviceControls", "EndDeviceGroups"] + + def getEndDeviceInfo(self): + """End device data. + """ + return self._EndDeviceInfo + + def setEndDeviceInfo(self, value): + if self._EndDeviceInfo is not None: + filtered = [x for x in self.EndDeviceInfo.EndDevices if x != self] + self._EndDeviceInfo._EndDevices = filtered + + self._EndDeviceInfo = value + if self._EndDeviceInfo is not None: + if self not in self._EndDeviceInfo._EndDevices: + self._EndDeviceInfo._EndDevices.append(self) + + EndDeviceInfo = property(getEndDeviceInfo, setEndDeviceInfo) + + def getServiceDeliveryPoint(self): + """Service delivery point to which this end device belongs. + """ + return self._ServiceDeliveryPoint + + def setServiceDeliveryPoint(self, value): + if self._ServiceDeliveryPoint is not None: + filtered = [x for x in self.ServiceDeliveryPoint.EndDevices if x != self] + self._ServiceDeliveryPoint._EndDevices = filtered + + self._ServiceDeliveryPoint = value + if self._ServiceDeliveryPoint is not None: + if self not in self._ServiceDeliveryPoint._EndDevices: + self._ServiceDeliveryPoint._EndDevices.append(self) + + ServiceDeliveryPoint = property(getServiceDeliveryPoint, setServiceDeliveryPoint) + + def getServiceLocation(self): + """Service location whose service delivery is measured by this end device. + """ + return self._ServiceLocation + + def setServiceLocation(self, value): + if self._ServiceLocation is not None: + filtered = [x for x in self.ServiceLocation.EndDevices if x != self] + self._ServiceLocation._EndDevices = filtered + + self._ServiceLocation = value + if self._ServiceLocation is not None: + if self not in self._ServiceLocation._EndDevices: + self._ServiceLocation._EndDevices.append(self) + + ServiceLocation = property(getServiceLocation, setServiceLocation) + + def getEndDeviceFunctions(self): + """All end device functions this end device performs. + """ + return self._EndDeviceFunctions + + def setEndDeviceFunctions(self, value): + for x in self._EndDeviceFunctions: + x.EndDevice = None + for y in value: + y._EndDevice = self + self._EndDeviceFunctions = value + + EndDeviceFunctions = property(getEndDeviceFunctions, setEndDeviceFunctions) + + def addEndDeviceFunctions(self, *EndDeviceFunctions): + for obj in EndDeviceFunctions: + obj.EndDevice = self + + def removeEndDeviceFunctions(self, *EndDeviceFunctions): + for obj in EndDeviceFunctions: + obj.EndDevice = None + + def getEndDeviceControls(self): + """All end device controls sending commands to this end device. + """ + return self._EndDeviceControls + + def setEndDeviceControls(self, value): + for x in self._EndDeviceControls: + x.EndDevice = None + for y in value: + y._EndDevice = self + self._EndDeviceControls = value + + EndDeviceControls = property(getEndDeviceControls, setEndDeviceControls) + + def addEndDeviceControls(self, *EndDeviceControls): + for obj in EndDeviceControls: + obj.EndDevice = self + + def removeEndDeviceControls(self, *EndDeviceControls): + for obj in EndDeviceControls: + obj.EndDevice = None + + def getCustomer(self): + """Customer owning this end device. + """ + return self._Customer + + def setCustomer(self, value): + if self._Customer is not None: + filtered = [x for x in self.Customer.EndDevices if x != self] + self._Customer._EndDevices = filtered + + self._Customer = value + if self._Customer is not None: + if self not in self._Customer._EndDevices: + self._Customer._EndDevices.append(self) + + Customer = property(getCustomer, setCustomer) + + def getEndDeviceGroups(self): + """All end device groups referring to this end device. + """ + return self._EndDeviceGroups + + def setEndDeviceGroups(self, value): + for p in self._EndDeviceGroups: + filtered = [q for q in p.EndDevices if q != self] + self._EndDeviceGroups._EndDevices = filtered + for r in value: + if self not in r._EndDevices: + r._EndDevices.append(self) + self._EndDeviceGroups = value + + EndDeviceGroups = property(getEndDeviceGroups, setEndDeviceGroups) + + def addEndDeviceGroups(self, *EndDeviceGroups): + for obj in EndDeviceGroups: + if self not in obj._EndDevices: + obj._EndDevices.append(self) + self._EndDeviceGroups.append(obj) + + def removeEndDeviceGroups(self, *EndDeviceGroups): + for obj in EndDeviceGroups: + if self in obj._EndDevices: + obj._EndDevices.remove(self) + self._EndDeviceGroups.remove(obj) + diff --git a/CIM16/IEC61968/Metering/EndDeviceControl.py b/CIM16/IEC61968/Metering/EndDeviceControl.py new file mode 100755 index 00000000..2d047fce --- /dev/null +++ b/CIM16/IEC61968/Metering/EndDeviceControl.py @@ -0,0 +1,145 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class EndDeviceControl(IdentifiedObject): + """Instructs an end device (or an end device group) to perform a specified action.Instructs an end device (or an end device group) to perform a specified action. + """ + + def __init__(self, drProgramLevel=0, drProgramMandatory=False, type='', priceSignal=0.0, DemandResponseProgram=None, CustomerAgreement=None, scheduledInterval=None, EndDeviceGroup=None, EndDevice=None, *args, **kw_args): + """Initialises a new 'EndDeviceControl' instance. + + @param drProgramLevel: Level of a demand response program request, where 0=emergency. Note: Attribute is not defined on DemandResponseProgram as it is not its inherent property (it serves to control it). + @param drProgramMandatory: Whether a demand response program request is mandatory. Note: Attribute is not defined on DemandResponseProgram as it is not its inherent property (it serves to control it). + @param type: Type of control. + @param priceSignal: (if applicable) Price signal used as parameter for this end device control. + @param DemandResponseProgram: Demand response program for this end device control. + @param CustomerAgreement: Could be deprecated in the future. + @param scheduledInterval: (if control has scheduled duration) Date and time interval the control has been scheduled to execute within. + @param EndDeviceGroup: End device group receiving commands from this end device control. + @param EndDevice: End device receiving commands from this end device control. + """ + #: Level of a demand response program request, where 0=emergency. Note: Attribute is not defined on DemandResponseProgram as it is not its inherent property (it serves to control it). + self.drProgramLevel = drProgramLevel + + #: Whether a demand response program request is mandatory. Note: Attribute is not defined on DemandResponseProgram as it is not its inherent property (it serves to control it). + self.drProgramMandatory = drProgramMandatory + + #: Type of control. + self.type = type + + #: (if applicable) Price signal used as parameter for this end device control. + self.priceSignal = priceSignal + + self._DemandResponseProgram = None + self.DemandResponseProgram = DemandResponseProgram + + self._CustomerAgreement = None + self.CustomerAgreement = CustomerAgreement + + self.scheduledInterval = scheduledInterval + + self._EndDeviceGroup = None + self.EndDeviceGroup = EndDeviceGroup + + self._EndDevice = None + self.EndDevice = EndDevice + + super(EndDeviceControl, self).__init__(*args, **kw_args) + + _attrs = ["drProgramLevel", "drProgramMandatory", "type", "priceSignal"] + _attr_types = {"drProgramLevel": int, "drProgramMandatory": bool, "type": str, "priceSignal": float} + _defaults = {"drProgramLevel": 0, "drProgramMandatory": False, "type": '', "priceSignal": 0.0} + _enums = {} + _refs = ["DemandResponseProgram", "CustomerAgreement", "scheduledInterval", "EndDeviceGroup", "EndDevice"] + _many_refs = [] + + def getDemandResponseProgram(self): + """Demand response program for this end device control. + """ + return self._DemandResponseProgram + + def setDemandResponseProgram(self, value): + if self._DemandResponseProgram is not None: + filtered = [x for x in self.DemandResponseProgram.EndDeviceControls if x != self] + self._DemandResponseProgram._EndDeviceControls = filtered + + self._DemandResponseProgram = value + if self._DemandResponseProgram is not None: + if self not in self._DemandResponseProgram._EndDeviceControls: + self._DemandResponseProgram._EndDeviceControls.append(self) + + DemandResponseProgram = property(getDemandResponseProgram, setDemandResponseProgram) + + def getCustomerAgreement(self): + """Could be deprecated in the future. + """ + return self._CustomerAgreement + + def setCustomerAgreement(self, value): + if self._CustomerAgreement is not None: + filtered = [x for x in self.CustomerAgreement.EndDeviceControls if x != self] + self._CustomerAgreement._EndDeviceControls = filtered + + self._CustomerAgreement = value + if self._CustomerAgreement is not None: + if self not in self._CustomerAgreement._EndDeviceControls: + self._CustomerAgreement._EndDeviceControls.append(self) + + CustomerAgreement = property(getCustomerAgreement, setCustomerAgreement) + + # (if control has scheduled duration) Date and time interval the control has been scheduled to execute within. + scheduledInterval = None + + def getEndDeviceGroup(self): + """End device group receiving commands from this end device control. + """ + return self._EndDeviceGroup + + def setEndDeviceGroup(self, value): + if self._EndDeviceGroup is not None: + filtered = [x for x in self.EndDeviceGroup.EndDeviceControls if x != self] + self._EndDeviceGroup._EndDeviceControls = filtered + + self._EndDeviceGroup = value + if self._EndDeviceGroup is not None: + if self not in self._EndDeviceGroup._EndDeviceControls: + self._EndDeviceGroup._EndDeviceControls.append(self) + + EndDeviceGroup = property(getEndDeviceGroup, setEndDeviceGroup) + + def getEndDevice(self): + """End device receiving commands from this end device control. + """ + return self._EndDevice + + def setEndDevice(self, value): + if self._EndDevice is not None: + filtered = [x for x in self.EndDevice.EndDeviceControls if x != self] + self._EndDevice._EndDeviceControls = filtered + + self._EndDevice = value + if self._EndDevice is not None: + if self not in self._EndDevice._EndDeviceControls: + self._EndDevice._EndDeviceControls.append(self) + + EndDevice = property(getEndDevice, setEndDevice) + diff --git a/CIM16/IEC61968/Metering/EndDeviceEvent.py b/CIM16/IEC61968/Metering/EndDeviceEvent.py new file mode 100755 index 00000000..07b710f6 --- /dev/null +++ b/CIM16/IEC61968/Metering/EndDeviceEvent.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.ActivityRecord import ActivityRecord + +class EndDeviceEvent(ActivityRecord): + """Event detected by a device function associated with end device.Event detected by a device function associated with end device. + """ + + def __init__(self, userID='', EndDeviceFunction=None, MeterReading=None, *args, **kw_args): + """Initialises a new 'EndDeviceEvent' instance. + + @param userID: (if user initiated) ID of user who initiated this end device event. + @param EndDeviceFunction: End device function that reported this end device event. + @param MeterReading: Set of measured values to which this event applies. + """ + #: (if user initiated) ID of user who initiated this end device event. + self.userID = userID + + self._EndDeviceFunction = None + self.EndDeviceFunction = EndDeviceFunction + + self._MeterReading = None + self.MeterReading = MeterReading + + super(EndDeviceEvent, self).__init__(*args, **kw_args) + + _attrs = ["userID"] + _attr_types = {"userID": str} + _defaults = {"userID": ''} + _enums = {} + _refs = ["EndDeviceFunction", "MeterReading"] + _many_refs = [] + + def getEndDeviceFunction(self): + """End device function that reported this end device event. + """ + return self._EndDeviceFunction + + def setEndDeviceFunction(self, value): + if self._EndDeviceFunction is not None: + filtered = [x for x in self.EndDeviceFunction.EndDeviceEvents if x != self] + self._EndDeviceFunction._EndDeviceEvents = filtered + + self._EndDeviceFunction = value + if self._EndDeviceFunction is not None: + if self not in self._EndDeviceFunction._EndDeviceEvents: + self._EndDeviceFunction._EndDeviceEvents.append(self) + + EndDeviceFunction = property(getEndDeviceFunction, setEndDeviceFunction) + + def getMeterReading(self): + """Set of measured values to which this event applies. + """ + return self._MeterReading + + def setMeterReading(self, value): + if self._MeterReading is not None: + filtered = [x for x in self.MeterReading.EndDeviceEvents if x != self] + self._MeterReading._EndDeviceEvents = filtered + + self._MeterReading = value + if self._MeterReading is not None: + if self not in self._MeterReading._EndDeviceEvents: + self._MeterReading._EndDeviceEvents.append(self) + + MeterReading = property(getMeterReading, setMeterReading) + diff --git a/CIM16/IEC61968/Metering/EndDeviceFunction.py b/CIM16/IEC61968/Metering/EndDeviceFunction.py new file mode 100755 index 00000000..9a3b8aee --- /dev/null +++ b/CIM16/IEC61968/Metering/EndDeviceFunction.py @@ -0,0 +1,141 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetFunction import AssetFunction + +class EndDeviceFunction(AssetFunction): + """Function performed by an end device such as a meter, communication equipment, controllers, etc.Function performed by an end device such as a meter, communication equipment, controllers, etc. + """ + + def __init__(self, enabled=False, supported=False, Registers=None, ComEquipment=None, EndDeviceEvents=None, EndDevice=None, *args, **kw_args): + """Initialises a new 'EndDeviceFunction' instance. + + @param enabled: True if the function is enabled (current operating status; makes sense only if 'supported'=true). + @param supported: True if the function is supported (inherent property of the device). + @param Registers: All registers for quantities metered by this end device function. + @param ComEquipment: Communication equipment performing this device function. + @param EndDeviceEvents: All events reported by this end device function. + @param EndDevice: End device that performs this function. + """ + #: True if the function is enabled (current operating status; makes sense only if 'supported'=true). + self.enabled = enabled + + #: True if the function is supported (inherent property of the device). + self.supported = supported + + self._Registers = [] + self.Registers = [] if Registers is None else Registers + + self._ComEquipment = None + self.ComEquipment = ComEquipment + + self._EndDeviceEvents = [] + self.EndDeviceEvents = [] if EndDeviceEvents is None else EndDeviceEvents + + self._EndDevice = None + self.EndDevice = EndDevice + + super(EndDeviceFunction, self).__init__(*args, **kw_args) + + _attrs = ["enabled", "supported"] + _attr_types = {"enabled": bool, "supported": bool} + _defaults = {"enabled": False, "supported": False} + _enums = {} + _refs = ["Registers", "ComEquipment", "EndDeviceEvents", "EndDevice"] + _many_refs = ["Registers", "EndDeviceEvents"] + + def getRegisters(self): + """All registers for quantities metered by this end device function. + """ + return self._Registers + + def setRegisters(self, value): + for x in self._Registers: + x.EndDeviceFunction = None + for y in value: + y._EndDeviceFunction = self + self._Registers = value + + Registers = property(getRegisters, setRegisters) + + def addRegisters(self, *Registers): + for obj in Registers: + obj.EndDeviceFunction = self + + def removeRegisters(self, *Registers): + for obj in Registers: + obj.EndDeviceFunction = None + + def getComEquipment(self): + """Communication equipment performing this device function. + """ + return self._ComEquipment + + def setComEquipment(self, value): + if self._ComEquipment is not None: + filtered = [x for x in self.ComEquipment.EndDeviceFunctions if x != self] + self._ComEquipment._EndDeviceFunctions = filtered + + self._ComEquipment = value + if self._ComEquipment is not None: + if self not in self._ComEquipment._EndDeviceFunctions: + self._ComEquipment._EndDeviceFunctions.append(self) + + ComEquipment = property(getComEquipment, setComEquipment) + + def getEndDeviceEvents(self): + """All events reported by this end device function. + """ + return self._EndDeviceEvents + + def setEndDeviceEvents(self, value): + for x in self._EndDeviceEvents: + x.EndDeviceFunction = None + for y in value: + y._EndDeviceFunction = self + self._EndDeviceEvents = value + + EndDeviceEvents = property(getEndDeviceEvents, setEndDeviceEvents) + + def addEndDeviceEvents(self, *EndDeviceEvents): + for obj in EndDeviceEvents: + obj.EndDeviceFunction = self + + def removeEndDeviceEvents(self, *EndDeviceEvents): + for obj in EndDeviceEvents: + obj.EndDeviceFunction = None + + def getEndDevice(self): + """End device that performs this function. + """ + return self._EndDevice + + def setEndDevice(self, value): + if self._EndDevice is not None: + filtered = [x for x in self.EndDevice.EndDeviceFunctions if x != self] + self._EndDevice._EndDeviceFunctions = filtered + + self._EndDevice = value + if self._EndDevice is not None: + if self not in self._EndDevice._EndDeviceFunctions: + self._EndDevice._EndDeviceFunctions.append(self) + + EndDevice = property(getEndDevice, setEndDevice) + diff --git a/CIM16/IEC61968/Metering/EndDeviceGroup.py b/CIM16/IEC61968/Metering/EndDeviceGroup.py new file mode 100755 index 00000000..0aa03ff0 --- /dev/null +++ b/CIM16/IEC61968/Metering/EndDeviceGroup.py @@ -0,0 +1,122 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class EndDeviceGroup(IdentifiedObject): + """Abstraction for management of group communications within a two-way AMR system or the data for a group of related meters. Commands can be issued to all of the meters that belong to a meter group using a defined group address and the underlying AMR communication infrastructure.Abstraction for management of group communications within a two-way AMR system or the data for a group of related meters. Commands can be issued to all of the meters that belong to a meter group using a defined group address and the underlying AMR communication infrastructure. + """ + + def __init__(self, groupAddress=0, EndDeviceControls=None, EndDevices=None, DemandResponseProgram=None, *args, **kw_args): + """Initialises a new 'EndDeviceGroup' instance. + + @param groupAddress: Address of this end device group. + @param EndDeviceControls: All end device controls sending commands to this end device group. + @param EndDevices: All end devices this end device group refers to. + @param DemandResponseProgram: Demand response program for this group of end devices. + """ + #: Address of this end device group. + self.groupAddress = groupAddress + + self._EndDeviceControls = [] + self.EndDeviceControls = [] if EndDeviceControls is None else EndDeviceControls + + self._EndDevices = [] + self.EndDevices = [] if EndDevices is None else EndDevices + + self._DemandResponseProgram = None + self.DemandResponseProgram = DemandResponseProgram + + super(EndDeviceGroup, self).__init__(*args, **kw_args) + + _attrs = ["groupAddress"] + _attr_types = {"groupAddress": int} + _defaults = {"groupAddress": 0} + _enums = {} + _refs = ["EndDeviceControls", "EndDevices", "DemandResponseProgram"] + _many_refs = ["EndDeviceControls", "EndDevices"] + + def getEndDeviceControls(self): + """All end device controls sending commands to this end device group. + """ + return self._EndDeviceControls + + def setEndDeviceControls(self, value): + for x in self._EndDeviceControls: + x.EndDeviceGroup = None + for y in value: + y._EndDeviceGroup = self + self._EndDeviceControls = value + + EndDeviceControls = property(getEndDeviceControls, setEndDeviceControls) + + def addEndDeviceControls(self, *EndDeviceControls): + for obj in EndDeviceControls: + obj.EndDeviceGroup = self + + def removeEndDeviceControls(self, *EndDeviceControls): + for obj in EndDeviceControls: + obj.EndDeviceGroup = None + + def getEndDevices(self): + """All end devices this end device group refers to. + """ + return self._EndDevices + + def setEndDevices(self, value): + for p in self._EndDevices: + filtered = [q for q in p.EndDeviceGroups if q != self] + self._EndDevices._EndDeviceGroups = filtered + for r in value: + if self not in r._EndDeviceGroups: + r._EndDeviceGroups.append(self) + self._EndDevices = value + + EndDevices = property(getEndDevices, setEndDevices) + + def addEndDevices(self, *EndDevices): + for obj in EndDevices: + if self not in obj._EndDeviceGroups: + obj._EndDeviceGroups.append(self) + self._EndDevices.append(obj) + + def removeEndDevices(self, *EndDevices): + for obj in EndDevices: + if self in obj._EndDeviceGroups: + obj._EndDeviceGroups.remove(self) + self._EndDevices.remove(obj) + + def getDemandResponseProgram(self): + """Demand response program for this group of end devices. + """ + return self._DemandResponseProgram + + def setDemandResponseProgram(self, value): + if self._DemandResponseProgram is not None: + filtered = [x for x in self.DemandResponseProgram.EndDeviceGroups if x != self] + self._DemandResponseProgram._EndDeviceGroups = filtered + + self._DemandResponseProgram = value + if self._DemandResponseProgram is not None: + if self not in self._DemandResponseProgram._EndDeviceGroups: + self._DemandResponseProgram._EndDeviceGroups.append(self) + + DemandResponseProgram = property(getDemandResponseProgram, setDemandResponseProgram) + diff --git a/CIM16/IEC61968/Metering/IntervalBlock.py b/CIM16/IEC61968/Metering/IntervalBlock.py new file mode 100755 index 00000000..23a2ef92 --- /dev/null +++ b/CIM16/IEC61968/Metering/IntervalBlock.py @@ -0,0 +1,134 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class IntervalBlock(Element): + """Time sequence of Readings of the same ReadingType. Contained IntervalReadings may need conversion through the application of an offset and a scalar defined in associated Pending.Time sequence of Readings of the same ReadingType. Contained IntervalReadings may need conversion through the application of an offset and a scalar defined in associated Pending. + """ + + def __init__(self, ReadingType=None, IntervalReadings=None, MeterReading=None, PendingCalculation=None, *args, **kw_args): + """Initialises a new 'IntervalBlock' instance. + + @param ReadingType: Type information for interval reading values contained in this block. + @param IntervalReadings: Interval reading contained in this block. + @param MeterReading: Meter reading containing this interval block. + @param PendingCalculation: Pending conversion to apply to interval reading values contained by this block (after which the resulting reading type is different than the original because it reflects the conversion result). + """ + self._ReadingType = None + self.ReadingType = ReadingType + + self._IntervalReadings = [] + self.IntervalReadings = [] if IntervalReadings is None else IntervalReadings + + self._MeterReading = None + self.MeterReading = MeterReading + + self._PendingCalculation = None + self.PendingCalculation = PendingCalculation + + super(IntervalBlock, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ReadingType", "IntervalReadings", "MeterReading", "PendingCalculation"] + _many_refs = ["IntervalReadings"] + + def getReadingType(self): + """Type information for interval reading values contained in this block. + """ + return self._ReadingType + + def setReadingType(self, value): + if self._ReadingType is not None: + filtered = [x for x in self.ReadingType.IntervalBlocks if x != self] + self._ReadingType._IntervalBlocks = filtered + + self._ReadingType = value + if self._ReadingType is not None: + if self not in self._ReadingType._IntervalBlocks: + self._ReadingType._IntervalBlocks.append(self) + + ReadingType = property(getReadingType, setReadingType) + + def getIntervalReadings(self): + """Interval reading contained in this block. + """ + return self._IntervalReadings + + def setIntervalReadings(self, value): + for p in self._IntervalReadings: + filtered = [q for q in p.IntervalBlocks if q != self] + self._IntervalReadings._IntervalBlocks = filtered + for r in value: + if self not in r._IntervalBlocks: + r._IntervalBlocks.append(self) + self._IntervalReadings = value + + IntervalReadings = property(getIntervalReadings, setIntervalReadings) + + def addIntervalReadings(self, *IntervalReadings): + for obj in IntervalReadings: + if self not in obj._IntervalBlocks: + obj._IntervalBlocks.append(self) + self._IntervalReadings.append(obj) + + def removeIntervalReadings(self, *IntervalReadings): + for obj in IntervalReadings: + if self in obj._IntervalBlocks: + obj._IntervalBlocks.remove(self) + self._IntervalReadings.remove(obj) + + def getMeterReading(self): + """Meter reading containing this interval block. + """ + return self._MeterReading + + def setMeterReading(self, value): + if self._MeterReading is not None: + filtered = [x for x in self.MeterReading.IntervalBlocks if x != self] + self._MeterReading._IntervalBlocks = filtered + + self._MeterReading = value + if self._MeterReading is not None: + if self not in self._MeterReading._IntervalBlocks: + self._MeterReading._IntervalBlocks.append(self) + + MeterReading = property(getMeterReading, setMeterReading) + + def getPendingCalculation(self): + """Pending conversion to apply to interval reading values contained by this block (after which the resulting reading type is different than the original because it reflects the conversion result). + """ + return self._PendingCalculation + + def setPendingCalculation(self, value): + if self._PendingCalculation is not None: + filtered = [x for x in self.PendingCalculation.IntervalBlocks if x != self] + self._PendingCalculation._IntervalBlocks = filtered + + self._PendingCalculation = value + if self._PendingCalculation is not None: + if self not in self._PendingCalculation._IntervalBlocks: + self._PendingCalculation._IntervalBlocks.append(self) + + PendingCalculation = property(getPendingCalculation, setPendingCalculation) + diff --git a/CIM16/IEC61968/Metering/IntervalReading.py b/CIM16/IEC61968/Metering/IntervalReading.py new file mode 100755 index 00000000..c7c3f3b5 --- /dev/null +++ b/CIM16/IEC61968/Metering/IntervalReading.py @@ -0,0 +1,101 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.MeasurementValue import MeasurementValue + +class IntervalReading(MeasurementValue): + """Data captured at regular intervals of time. Interval data could be captured as incremental data, absolute data, or relative data. The source for the data is usually a tariff quantity or an engineering quantity. Data is typically captured in time-tagged, uniform, fixed-length intervals of 5 min, 10 min, 15 min, 30 min, or 60 min. Note: Interval Data is sometimes also called 'Interval Data Readings' (IDR).Data captured at regular intervals of time. Interval data could be captured as incremental data, absolute data, or relative data. The source for the data is usually a tariff quantity or an engineering quantity. Data is typically captured in time-tagged, uniform, fixed-length intervals of 5 min, 10 min, 15 min, 30 min, or 60 min. Note: Interval Data is sometimes also called 'Interval Data Readings' (IDR). + """ + + def __init__(self, value=0.0, IntervalBlocks=None, ReadingQualities=None, *args, **kw_args): + """Initialises a new 'IntervalReading' instance. + + @param value: Value of this interval reading. + @param IntervalBlocks: All blocks containing this interval reading. + @param ReadingQualities: Used only if quality of this interval reading value is different than 'Good'. + """ + #: Value of this interval reading. + self.value = value + + self._IntervalBlocks = [] + self.IntervalBlocks = [] if IntervalBlocks is None else IntervalBlocks + + self._ReadingQualities = [] + self.ReadingQualities = [] if ReadingQualities is None else ReadingQualities + + super(IntervalReading, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": float} + _defaults = {"value": 0.0} + _enums = {} + _refs = ["IntervalBlocks", "ReadingQualities"] + _many_refs = ["IntervalBlocks", "ReadingQualities"] + + def getIntervalBlocks(self): + """All blocks containing this interval reading. + """ + return self._IntervalBlocks + + def setIntervalBlocks(self, value): + for p in self._IntervalBlocks: + filtered = [q for q in p.IntervalReadings if q != self] + self._IntervalBlocks._IntervalReadings = filtered + for r in value: + if self not in r._IntervalReadings: + r._IntervalReadings.append(self) + self._IntervalBlocks = value + + IntervalBlocks = property(getIntervalBlocks, setIntervalBlocks) + + def addIntervalBlocks(self, *IntervalBlocks): + for obj in IntervalBlocks: + if self not in obj._IntervalReadings: + obj._IntervalReadings.append(self) + self._IntervalBlocks.append(obj) + + def removeIntervalBlocks(self, *IntervalBlocks): + for obj in IntervalBlocks: + if self in obj._IntervalReadings: + obj._IntervalReadings.remove(self) + self._IntervalBlocks.remove(obj) + + def getReadingQualities(self): + """Used only if quality of this interval reading value is different than 'Good'. + """ + return self._ReadingQualities + + def setReadingQualities(self, value): + for x in self._ReadingQualities: + x.IntervalReading = None + for y in value: + y._IntervalReading = self + self._ReadingQualities = value + + ReadingQualities = property(getReadingQualities, setReadingQualities) + + def addReadingQualities(self, *ReadingQualities): + for obj in ReadingQualities: + obj.IntervalReading = self + + def removeReadingQualities(self, *ReadingQualities): + for obj in ReadingQualities: + obj.IntervalReading = None + diff --git a/CIM16/IEC61968/Metering/Meter.py b/CIM16/IEC61968/Metering/Meter.py new file mode 100755 index 00000000..0597dc84 --- /dev/null +++ b/CIM16/IEC61968/Metering/Meter.py @@ -0,0 +1,155 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Metering.EndDevice import EndDevice + +class Meter(EndDevice): + """Physical asset that performs the metering role of the ServiceDeliveryPoint. Used for measuring consumption and detection of events.Physical asset that performs the metering role of the ServiceDeliveryPoint. Used for measuring consumption and detection of events. + """ + + def __init__(self, kR=0.0, kH=0.0, formNumber='', MeterReplacementWorks=None, MeterReadings=None, MeterServiceWorks=None, VendingTransactions=None, *args, **kw_args): + """Initialises a new 'Meter' instance. + + @param kR: Display multiplier used to produce a displayed value from a register value. + @param kH: Meter kh (watthour) constant. It is the number of watthours that must be applied to the meter to cause one disk revolution for an electromechanical meter or the number of watthours represented by one increment pulse for an electronic meter. + @param formNumber: Meter form designation per ANSI C12.10 or other applicable standard. An alphanumeric designation denoting the circuit arrangement for which the meter is applicable and its specific terminal arrangement. + @param MeterReplacementWorks: All works on replacement of this old meter. + @param MeterReadings: All meter readings provided by this meter. + @param MeterServiceWorks: All non-replacement works on this meter. + @param VendingTransactions: All vending transactions on this meter. + """ + #: Display multiplier used to produce a displayed value from a register value. + self.kR = kR + + #: Meter kh (watthour) constant. It is the number of watthours that must be applied to the meter to cause one disk revolution for an electromechanical meter or the number of watthours represented by one increment pulse for an electronic meter. + self.kH = kH + + #: Meter form designation per ANSI C12.10 or other applicable standard. An alphanumeric designation denoting the circuit arrangement for which the meter is applicable and its specific terminal arrangement. + self.formNumber = formNumber + + self._MeterReplacementWorks = [] + self.MeterReplacementWorks = [] if MeterReplacementWorks is None else MeterReplacementWorks + + self._MeterReadings = [] + self.MeterReadings = [] if MeterReadings is None else MeterReadings + + self._MeterServiceWorks = [] + self.MeterServiceWorks = [] if MeterServiceWorks is None else MeterServiceWorks + + self._VendingTransactions = [] + self.VendingTransactions = [] if VendingTransactions is None else VendingTransactions + + super(Meter, self).__init__(*args, **kw_args) + + _attrs = ["kR", "kH", "formNumber"] + _attr_types = {"kR": float, "kH": float, "formNumber": str} + _defaults = {"kR": 0.0, "kH": 0.0, "formNumber": ''} + _enums = {} + _refs = ["MeterReplacementWorks", "MeterReadings", "MeterServiceWorks", "VendingTransactions"] + _many_refs = ["MeterReplacementWorks", "MeterReadings", "MeterServiceWorks", "VendingTransactions"] + + def getMeterReplacementWorks(self): + """All works on replacement of this old meter. + """ + return self._MeterReplacementWorks + + def setMeterReplacementWorks(self, value): + for x in self._MeterReplacementWorks: + x.OldMeter = None + for y in value: + y._OldMeter = self + self._MeterReplacementWorks = value + + MeterReplacementWorks = property(getMeterReplacementWorks, setMeterReplacementWorks) + + def addMeterReplacementWorks(self, *MeterReplacementWorks): + for obj in MeterReplacementWorks: + obj.OldMeter = self + + def removeMeterReplacementWorks(self, *MeterReplacementWorks): + for obj in MeterReplacementWorks: + obj.OldMeter = None + + def getMeterReadings(self): + """All meter readings provided by this meter. + """ + return self._MeterReadings + + def setMeterReadings(self, value): + for x in self._MeterReadings: + x.Meter = None + for y in value: + y._Meter = self + self._MeterReadings = value + + MeterReadings = property(getMeterReadings, setMeterReadings) + + def addMeterReadings(self, *MeterReadings): + for obj in MeterReadings: + obj.Meter = self + + def removeMeterReadings(self, *MeterReadings): + for obj in MeterReadings: + obj.Meter = None + + def getMeterServiceWorks(self): + """All non-replacement works on this meter. + """ + return self._MeterServiceWorks + + def setMeterServiceWorks(self, value): + for x in self._MeterServiceWorks: + x.Meter = None + for y in value: + y._Meter = self + self._MeterServiceWorks = value + + MeterServiceWorks = property(getMeterServiceWorks, setMeterServiceWorks) + + def addMeterServiceWorks(self, *MeterServiceWorks): + for obj in MeterServiceWorks: + obj.Meter = self + + def removeMeterServiceWorks(self, *MeterServiceWorks): + for obj in MeterServiceWorks: + obj.Meter = None + + def getVendingTransactions(self): + """All vending transactions on this meter. + """ + return self._VendingTransactions + + def setVendingTransactions(self, value): + for x in self._VendingTransactions: + x.Meter = None + for y in value: + y._Meter = self + self._VendingTransactions = value + + VendingTransactions = property(getVendingTransactions, setVendingTransactions) + + def addVendingTransactions(self, *VendingTransactions): + for obj in VendingTransactions: + obj.Meter = self + + def removeVendingTransactions(self, *VendingTransactions): + for obj in VendingTransactions: + obj.Meter = None + diff --git a/CIM16/IEC61968/Metering/MeterReading.py b/CIM16/IEC61968/Metering/MeterReading.py new file mode 100755 index 00000000..25a35f92 --- /dev/null +++ b/CIM16/IEC61968/Metering/MeterReading.py @@ -0,0 +1,192 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class MeterReading(IdentifiedObject): + """Set of values obtained from the meter.Set of values obtained from the meter. + """ + + def __init__(self, ServiceDeliveryPoint=None, valuesInterval=None, EndDeviceEvents=None, Readings=None, CustomerAgreement=None, Meter=None, IntervalBlocks=None, *args, **kw_args): + """Initialises a new 'MeterReading' instance. + + @param ServiceDeliveryPoint: Service delivery point from which this meter reading (set of values) has been obtained. + @param valuesInterval: Date and time interval of the data items contained within this meter reading. + @param EndDeviceEvents: All end device events associated with this set of measured values. + @param Readings: All reading values contained within this meter reading. + @param CustomerAgreement: (could be deprecated in the future) Customer agreement for this meter reading. + @param Meter: Meter providing this reading. + @param IntervalBlocks: All interval blocks contained in this meter reading. + """ + self._ServiceDeliveryPoint = None + self.ServiceDeliveryPoint = ServiceDeliveryPoint + + self.valuesInterval = valuesInterval + + self._EndDeviceEvents = [] + self.EndDeviceEvents = [] if EndDeviceEvents is None else EndDeviceEvents + + self._Readings = [] + self.Readings = [] if Readings is None else Readings + + self._CustomerAgreement = None + self.CustomerAgreement = CustomerAgreement + + self._Meter = None + self.Meter = Meter + + self._IntervalBlocks = [] + self.IntervalBlocks = [] if IntervalBlocks is None else IntervalBlocks + + super(MeterReading, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ServiceDeliveryPoint", "valuesInterval", "EndDeviceEvents", "Readings", "CustomerAgreement", "Meter", "IntervalBlocks"] + _many_refs = ["EndDeviceEvents", "Readings", "IntervalBlocks"] + + def getServiceDeliveryPoint(self): + """Service delivery point from which this meter reading (set of values) has been obtained. + """ + return self._ServiceDeliveryPoint + + def setServiceDeliveryPoint(self, value): + if self._ServiceDeliveryPoint is not None: + filtered = [x for x in self.ServiceDeliveryPoint.MeterReadings if x != self] + self._ServiceDeliveryPoint._MeterReadings = filtered + + self._ServiceDeliveryPoint = value + if self._ServiceDeliveryPoint is not None: + if self not in self._ServiceDeliveryPoint._MeterReadings: + self._ServiceDeliveryPoint._MeterReadings.append(self) + + ServiceDeliveryPoint = property(getServiceDeliveryPoint, setServiceDeliveryPoint) + + # Date and time interval of the data items contained within this meter reading. + valuesInterval = None + + def getEndDeviceEvents(self): + """All end device events associated with this set of measured values. + """ + return self._EndDeviceEvents + + def setEndDeviceEvents(self, value): + for x in self._EndDeviceEvents: + x.MeterReading = None + for y in value: + y._MeterReading = self + self._EndDeviceEvents = value + + EndDeviceEvents = property(getEndDeviceEvents, setEndDeviceEvents) + + def addEndDeviceEvents(self, *EndDeviceEvents): + for obj in EndDeviceEvents: + obj.MeterReading = self + + def removeEndDeviceEvents(self, *EndDeviceEvents): + for obj in EndDeviceEvents: + obj.MeterReading = None + + def getReadings(self): + """All reading values contained within this meter reading. + """ + return self._Readings + + def setReadings(self, value): + for p in self._Readings: + filtered = [q for q in p.MeterReadings if q != self] + self._Readings._MeterReadings = filtered + for r in value: + if self not in r._MeterReadings: + r._MeterReadings.append(self) + self._Readings = value + + Readings = property(getReadings, setReadings) + + def addReadings(self, *Readings): + for obj in Readings: + if self not in obj._MeterReadings: + obj._MeterReadings.append(self) + self._Readings.append(obj) + + def removeReadings(self, *Readings): + for obj in Readings: + if self in obj._MeterReadings: + obj._MeterReadings.remove(self) + self._Readings.remove(obj) + + def getCustomerAgreement(self): + """(could be deprecated in the future) Customer agreement for this meter reading. + """ + return self._CustomerAgreement + + def setCustomerAgreement(self, value): + if self._CustomerAgreement is not None: + filtered = [x for x in self.CustomerAgreement.MeterReadings if x != self] + self._CustomerAgreement._MeterReadings = filtered + + self._CustomerAgreement = value + if self._CustomerAgreement is not None: + if self not in self._CustomerAgreement._MeterReadings: + self._CustomerAgreement._MeterReadings.append(self) + + CustomerAgreement = property(getCustomerAgreement, setCustomerAgreement) + + def getMeter(self): + """Meter providing this reading. + """ + return self._Meter + + def setMeter(self, value): + if self._Meter is not None: + filtered = [x for x in self.Meter.MeterReadings if x != self] + self._Meter._MeterReadings = filtered + + self._Meter = value + if self._Meter is not None: + if self not in self._Meter._MeterReadings: + self._Meter._MeterReadings.append(self) + + Meter = property(getMeter, setMeter) + + def getIntervalBlocks(self): + """All interval blocks contained in this meter reading. + """ + return self._IntervalBlocks + + def setIntervalBlocks(self, value): + for x in self._IntervalBlocks: + x.MeterReading = None + for y in value: + y._MeterReading = self + self._IntervalBlocks = value + + IntervalBlocks = property(getIntervalBlocks, setIntervalBlocks) + + def addIntervalBlocks(self, *IntervalBlocks): + for obj in IntervalBlocks: + obj.MeterReading = self + + def removeIntervalBlocks(self, *IntervalBlocks): + for obj in IntervalBlocks: + obj.MeterReading = None + diff --git a/CIM16/IEC61968/Metering/MeterServiceWork.py b/CIM16/IEC61968/Metering/MeterServiceWork.py new file mode 100755 index 00000000..3cf3cdb6 --- /dev/null +++ b/CIM16/IEC61968/Metering/MeterServiceWork.py @@ -0,0 +1,81 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Work.Work import Work + +class MeterServiceWork(Work): + """Work involving meters.Work involving meters. + """ + + def __init__(self, OldMeter=None, Meter=None, *args, **kw_args): + """Initialises a new 'MeterServiceWork' instance. + + @param OldMeter: Old meter replaced by this work. + @param Meter: Meter on which this non-replacement work is performed. + """ + self._OldMeter = None + self.OldMeter = OldMeter + + self._Meter = None + self.Meter = Meter + + super(MeterServiceWork, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["OldMeter", "Meter"] + _many_refs = [] + + def getOldMeter(self): + """Old meter replaced by this work. + """ + return self._OldMeter + + def setOldMeter(self, value): + if self._OldMeter is not None: + filtered = [x for x in self.OldMeter.MeterReplacementWorks if x != self] + self._OldMeter._MeterReplacementWorks = filtered + + self._OldMeter = value + if self._OldMeter is not None: + if self not in self._OldMeter._MeterReplacementWorks: + self._OldMeter._MeterReplacementWorks.append(self) + + OldMeter = property(getOldMeter, setOldMeter) + + def getMeter(self): + """Meter on which this non-replacement work is performed. + """ + return self._Meter + + def setMeter(self, value): + if self._Meter is not None: + filtered = [x for x in self.Meter.MeterServiceWorks if x != self] + self._Meter._MeterServiceWorks = filtered + + self._Meter = value + if self._Meter is not None: + if self not in self._Meter._MeterServiceWorks: + self._Meter._MeterServiceWorks.append(self) + + Meter = property(getMeter, setMeter) + diff --git a/CIM16/IEC61968/Metering/PendingCalculation.py b/CIM16/IEC61968/Metering/PendingCalculation.py new file mode 100755 index 00000000..f69d20fc --- /dev/null +++ b/CIM16/IEC61968/Metering/PendingCalculation.py @@ -0,0 +1,105 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class PendingCalculation(Element): + """When present, a scalar conversion that needs to be applied to every IntervalReading.value contained in IntervalBlock. This conversion results in a new associated ReadingType, reflecting the true dimensions of IntervalReading values after the conversion.When present, a scalar conversion that needs to be applied to every IntervalReading.value contained in IntervalBlock. This conversion results in a new associated ReadingType, reflecting the true dimensions of IntervalReading values after the conversion. + """ + + def __init__(self, scalarNumerator=0, multiplyBeforeAdd=False, scalarDenominator=0, scalarFloat=0.0, offset=0, IntervalBlocks=None, ReadingType=None, *args, **kw_args): + """Initialises a new 'PendingCalculation' instance. + + @param scalarNumerator: (if scalar is integer or rational number) When the scalar is a simple integer, and this attribute is presented alone and multiplied with 'IntervalReading.value', it causes a unit of measure conversion to occur, resulting in the 'ReadingType.unit'. It is never used in conjunction with 'scalarFloat', only with 'scalarDenominator'. + @param multiplyBeforeAdd: Whether scalars should be applied before adding the 'offset'. + @param scalarDenominator: (if scalar is rational number) When 'IntervalReading.value' is multiplied by this attribute and divided by 'scalarDenominator, it causes a unit of measure conversion to occur, resulting in the 'ReadingType.unit'. + @param scalarFloat: (if scalar is floating number) When multiplied with 'IntervalReading.value', it causes a unit of measure conversion to occur, resulting in the 'ReadingType.unit'. + @param offset: (if applicable) Offset to be added as well as multiplication using scalars. + @param IntervalBlocks: All blocks of interval reading values to which this pending conversion applies. + @param ReadingType: Reading type resulting from this pending conversion. + """ + #: (if scalar is integer or rational number) When the scalar is a simple integer, and this attribute is presented alone and multiplied with 'IntervalReading.value', it causes a unit of measure conversion to occur, resulting in the 'ReadingType.unit'. It is never used in conjunction with 'scalarFloat', only with 'scalarDenominator'. + self.scalarNumerator = scalarNumerator + + #: Whether scalars should be applied before adding the 'offset'. + self.multiplyBeforeAdd = multiplyBeforeAdd + + #: (if scalar is rational number) When 'IntervalReading.value' is multiplied by this attribute and divided by 'scalarDenominator, it causes a unit of measure conversion to occur, resulting in the 'ReadingType.unit'. + self.scalarDenominator = scalarDenominator + + #: (if scalar is floating number) When multiplied with 'IntervalReading.value', it causes a unit of measure conversion to occur, resulting in the 'ReadingType.unit'. + self.scalarFloat = scalarFloat + + #: (if applicable) Offset to be added as well as multiplication using scalars. + self.offset = offset + + self._IntervalBlocks = [] + self.IntervalBlocks = [] if IntervalBlocks is None else IntervalBlocks + + self._ReadingType = None + self.ReadingType = ReadingType + + super(PendingCalculation, self).__init__(*args, **kw_args) + + _attrs = ["scalarNumerator", "multiplyBeforeAdd", "scalarDenominator", "scalarFloat", "offset"] + _attr_types = {"scalarNumerator": int, "multiplyBeforeAdd": bool, "scalarDenominator": int, "scalarFloat": float, "offset": int} + _defaults = {"scalarNumerator": 0, "multiplyBeforeAdd": False, "scalarDenominator": 0, "scalarFloat": 0.0, "offset": 0} + _enums = {} + _refs = ["IntervalBlocks", "ReadingType"] + _many_refs = ["IntervalBlocks"] + + def getIntervalBlocks(self): + """All blocks of interval reading values to which this pending conversion applies. + """ + return self._IntervalBlocks + + def setIntervalBlocks(self, value): + for x in self._IntervalBlocks: + x.PendingCalculation = None + for y in value: + y._PendingCalculation = self + self._IntervalBlocks = value + + IntervalBlocks = property(getIntervalBlocks, setIntervalBlocks) + + def addIntervalBlocks(self, *IntervalBlocks): + for obj in IntervalBlocks: + obj.PendingCalculation = self + + def removeIntervalBlocks(self, *IntervalBlocks): + for obj in IntervalBlocks: + obj.PendingCalculation = None + + def getReadingType(self): + """Reading type resulting from this pending conversion. + """ + return self._ReadingType + + def setReadingType(self, value): + if self._ReadingType is not None: + self._ReadingType._PendingCalculation = None + + self._ReadingType = value + if self._ReadingType is not None: + self._ReadingType.PendingCalculation = None + self._ReadingType._PendingCalculation = self + + ReadingType = property(getReadingType, setReadingType) + diff --git a/CIM16/IEC61968/Metering/Reading.py b/CIM16/IEC61968/Metering/Reading.py new file mode 100755 index 00000000..4a5b8e45 --- /dev/null +++ b/CIM16/IEC61968/Metering/Reading.py @@ -0,0 +1,122 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.MeasurementValue import MeasurementValue + +class Reading(MeasurementValue): + """Specific value measured by a meter or other asset. Each Reading is associated with a specific ReadingType.Specific value measured by a meter or other asset. Each Reading is associated with a specific ReadingType. + """ + + def __init__(self, value=0.0, ReadingType=None, MeterReadings=None, ReadingQualities=None, *args, **kw_args): + """Initialises a new 'Reading' instance. + + @param value: Value of this reading. + @param ReadingType: Type information for this reading value. + @param MeterReadings: All meter readings (sets of values) containing this reading value. + @param ReadingQualities: Used only if quality of this reading value is different than 'Good'. + """ + #: Value of this reading. + self.value = value + + self._ReadingType = None + self.ReadingType = ReadingType + + self._MeterReadings = [] + self.MeterReadings = [] if MeterReadings is None else MeterReadings + + self._ReadingQualities = [] + self.ReadingQualities = [] if ReadingQualities is None else ReadingQualities + + super(Reading, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": float} + _defaults = {"value": 0.0} + _enums = {} + _refs = ["ReadingType", "MeterReadings", "ReadingQualities"] + _many_refs = ["MeterReadings", "ReadingQualities"] + + def getReadingType(self): + """Type information for this reading value. + """ + return self._ReadingType + + def setReadingType(self, value): + if self._ReadingType is not None: + filtered = [x for x in self.ReadingType.Readings if x != self] + self._ReadingType._Readings = filtered + + self._ReadingType = value + if self._ReadingType is not None: + if self not in self._ReadingType._Readings: + self._ReadingType._Readings.append(self) + + ReadingType = property(getReadingType, setReadingType) + + def getMeterReadings(self): + """All meter readings (sets of values) containing this reading value. + """ + return self._MeterReadings + + def setMeterReadings(self, value): + for p in self._MeterReadings: + filtered = [q for q in p.Readings if q != self] + self._MeterReadings._Readings = filtered + for r in value: + if self not in r._Readings: + r._Readings.append(self) + self._MeterReadings = value + + MeterReadings = property(getMeterReadings, setMeterReadings) + + def addMeterReadings(self, *MeterReadings): + for obj in MeterReadings: + if self not in obj._Readings: + obj._Readings.append(self) + self._MeterReadings.append(obj) + + def removeMeterReadings(self, *MeterReadings): + for obj in MeterReadings: + if self in obj._Readings: + obj._Readings.remove(self) + self._MeterReadings.remove(obj) + + def getReadingQualities(self): + """Used only if quality of this reading value is different than 'Good'. + """ + return self._ReadingQualities + + def setReadingQualities(self, value): + for x in self._ReadingQualities: + x.Reading = None + for y in value: + y._Reading = self + self._ReadingQualities = value + + ReadingQualities = property(getReadingQualities, setReadingQualities) + + def addReadingQualities(self, *ReadingQualities): + for obj in ReadingQualities: + obj.Reading = self + + def removeReadingQualities(self, *ReadingQualities): + for obj in ReadingQualities: + obj.Reading = None + diff --git a/CIM16/IEC61968/Metering/ReadingMultiplier.py b/CIM16/IEC61968/Metering/ReadingMultiplier.py new file mode 100755 index 00000000..b0559216 --- /dev/null +++ b/CIM16/IEC61968/Metering/ReadingMultiplier.py @@ -0,0 +1,45 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class ReadingMultiplier(object): + """The multiplier value with its application status.The multiplier value with its application status. + """ + + def __init__(self, value=0.0, isApplied=False): + """Initialises a new 'ReadingMultiplier' instance. + + @param value: Value of the multiplier. + @param isApplied: True if the multiplier has been applied to associated quantities. + """ + #: Value of the multiplier. + self.value = value + + #: True if the multiplier has been applied to associated quantities. + self.isApplied = isApplied + + + _attrs = ["value", "isApplied"] + _attr_types = {"value": float, "isApplied": bool} + _defaults = {"value": 0.0, "isApplied": False} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/Metering/ReadingQuality.py b/CIM16/IEC61968/Metering/ReadingQuality.py new file mode 100755 index 00000000..301d4ab4 --- /dev/null +++ b/CIM16/IEC61968/Metering/ReadingQuality.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class ReadingQuality(Element): + """Quality of a specific reading value or interval reading value. Note that more than one quality may be applicable to a given reading. Typically not used unless problems or unusual conditions occur (i.e., quality for each reading is assumed to be 'good' unless stated otherwise in associated reading quality).Quality of a specific reading value or interval reading value. Note that more than one quality may be applicable to a given reading. Typically not used unless problems or unusual conditions occur (i.e., quality for each reading is assumed to be 'good' unless stated otherwise in associated reading quality). + """ + + def __init__(self, quality='', Reading=None, IntervalReading=None, *args, **kw_args): + """Initialises a new 'ReadingQuality' instance. + + @param quality: Quality, to be specified if different than 'Good'. + @param Reading: Reading value to which this quality applies. + @param IntervalReading: Interval reading value to which this quality applies. + """ + #: Quality, to be specified if different than 'Good'. + self.quality = quality + + self._Reading = None + self.Reading = Reading + + self._IntervalReading = None + self.IntervalReading = IntervalReading + + super(ReadingQuality, self).__init__(*args, **kw_args) + + _attrs = ["quality"] + _attr_types = {"quality": str} + _defaults = {"quality": ''} + _enums = {} + _refs = ["Reading", "IntervalReading"] + _many_refs = [] + + def getReading(self): + """Reading value to which this quality applies. + """ + return self._Reading + + def setReading(self, value): + if self._Reading is not None: + filtered = [x for x in self.Reading.ReadingQualities if x != self] + self._Reading._ReadingQualities = filtered + + self._Reading = value + if self._Reading is not None: + if self not in self._Reading._ReadingQualities: + self._Reading._ReadingQualities.append(self) + + Reading = property(getReading, setReading) + + def getIntervalReading(self): + """Interval reading value to which this quality applies. + """ + return self._IntervalReading + + def setIntervalReading(self, value): + if self._IntervalReading is not None: + filtered = [x for x in self.IntervalReading.ReadingQualities if x != self] + self._IntervalReading._ReadingQualities = filtered + + self._IntervalReading = value + if self._IntervalReading is not None: + if self not in self._IntervalReading._ReadingQualities: + self._IntervalReading._ReadingQualities.append(self) + + IntervalReading = property(getIntervalReading, setIntervalReading) + diff --git a/CIM16/IEC61968/Metering/ReadingType.py b/CIM16/IEC61968/Metering/ReadingType.py new file mode 100755 index 00000000..8462646a --- /dev/null +++ b/CIM16/IEC61968/Metering/ReadingType.py @@ -0,0 +1,169 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ReadingType(IdentifiedObject): + """Type of data conveyed by a specific Reading.Type of data conveyed by a specific Reading. + """ + + def __init__(self, multiplier="M", unit="N", kind="phaseAngle", reverseChronology=False, defaultQuality='', intervalLength=0.0, channelNumber=0, defaultValueDataType='', IntervalBlocks=None, dynamicConfiguration=None, Readings=None, Register=None, PendingCalculation=None, *args, **kw_args): + """Initialises a new 'ReadingType' instance. + + @param multiplier: Multiplier for 'unit'. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param unit: Unit for the reading value. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param kind: Kind of reading. Values are: "phaseAngle", "volume", "frequency", "energy", "currentAngle", "powerFactor", "date", "other", "demand", "power", "pressure", "voltage", "voltageAngle", "time", "current" + @param reverseChronology: True for systems that must operate in 'reverse' chronological order. + @param defaultQuality: Characteristics of a data value conveyed by a specific Reading, which allow an application to understand how a specific Reading is to be interpreted. + @param intervalLength: (if incremental reading value) Length of increment interval. + @param channelNumber: Logical positioning of this measurement data. + @param defaultValueDataType: Numeric type to be expected for the associated IntervalBlock.value (e.g. unsignedInteger). + @param IntervalBlocks: All blocks containing interval reading values with this type information. + @param dynamicConfiguration: Demand configuration. + @param Readings: All reading values with this type information. + @param Register: Register displaying values with this type information. + @param PendingCalculation: Pending conversion that produced this reading type. + """ + #: Multiplier for 'unit'. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.multiplier = multiplier + + #: Unit for the reading value. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.unit = unit + + #: Kind of reading. Values are: "phaseAngle", "volume", "frequency", "energy", "currentAngle", "powerFactor", "date", "other", "demand", "power", "pressure", "voltage", "voltageAngle", "time", "current" + self.kind = kind + + #: True for systems that must operate in 'reverse' chronological order. + self.reverseChronology = reverseChronology + + #: Characteristics of a data value conveyed by a specific Reading, which allow an application to understand how a specific Reading is to be interpreted. + self.defaultQuality = defaultQuality + + #: (if incremental reading value) Length of increment interval. + self.intervalLength = intervalLength + + #: Logical positioning of this measurement data. + self.channelNumber = channelNumber + + #: Numeric type to be expected for the associated IntervalBlock.value (e.g. unsignedInteger). + self.defaultValueDataType = defaultValueDataType + + self._IntervalBlocks = [] + self.IntervalBlocks = [] if IntervalBlocks is None else IntervalBlocks + + self.dynamicConfiguration = dynamicConfiguration + + self._Readings = [] + self.Readings = [] if Readings is None else Readings + + self._Register = None + self.Register = Register + + self._PendingCalculation = None + self.PendingCalculation = PendingCalculation + + super(ReadingType, self).__init__(*args, **kw_args) + + _attrs = ["multiplier", "unit", "kind", "reverseChronology", "defaultQuality", "intervalLength", "channelNumber", "defaultValueDataType"] + _attr_types = {"multiplier": str, "unit": str, "kind": str, "reverseChronology": bool, "defaultQuality": str, "intervalLength": float, "channelNumber": int, "defaultValueDataType": str} + _defaults = {"multiplier": "M", "unit": "N", "kind": "phaseAngle", "reverseChronology": False, "defaultQuality": '', "intervalLength": 0.0, "channelNumber": 0, "defaultValueDataType": ''} + _enums = {"multiplier": "UnitMultiplier", "unit": "UnitSymbol", "kind": "ReadingKind"} + _refs = ["IntervalBlocks", "dynamicConfiguration", "Readings", "Register", "PendingCalculation"] + _many_refs = ["IntervalBlocks", "Readings"] + + def getIntervalBlocks(self): + """All blocks containing interval reading values with this type information. + """ + return self._IntervalBlocks + + def setIntervalBlocks(self, value): + for x in self._IntervalBlocks: + x.ReadingType = None + for y in value: + y._ReadingType = self + self._IntervalBlocks = value + + IntervalBlocks = property(getIntervalBlocks, setIntervalBlocks) + + def addIntervalBlocks(self, *IntervalBlocks): + for obj in IntervalBlocks: + obj.ReadingType = self + + def removeIntervalBlocks(self, *IntervalBlocks): + for obj in IntervalBlocks: + obj.ReadingType = None + + # Demand configuration. + dynamicConfiguration = None + + def getReadings(self): + """All reading values with this type information. + """ + return self._Readings + + def setReadings(self, value): + for x in self._Readings: + x.ReadingType = None + for y in value: + y._ReadingType = self + self._Readings = value + + Readings = property(getReadings, setReadings) + + def addReadings(self, *Readings): + for obj in Readings: + obj.ReadingType = self + + def removeReadings(self, *Readings): + for obj in Readings: + obj.ReadingType = None + + def getRegister(self): + """Register displaying values with this type information. + """ + return self._Register + + def setRegister(self, value): + if self._Register is not None: + self._Register._ReadingType = None + + self._Register = value + if self._Register is not None: + self._Register.ReadingType = None + self._Register._ReadingType = self + + Register = property(getRegister, setRegister) + + def getPendingCalculation(self): + """Pending conversion that produced this reading type. + """ + return self._PendingCalculation + + def setPendingCalculation(self, value): + if self._PendingCalculation is not None: + self._PendingCalculation._ReadingType = None + + self._PendingCalculation = value + if self._PendingCalculation is not None: + self._PendingCalculation.ReadingType = None + self._PendingCalculation._ReadingType = self + + PendingCalculation = property(getPendingCalculation, setPendingCalculation) + diff --git a/CIM16/IEC61968/Metering/Register.py b/CIM16/IEC61968/Metering/Register.py new file mode 100755 index 00000000..14e7173b --- /dev/null +++ b/CIM16/IEC61968/Metering/Register.py @@ -0,0 +1,88 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Register(IdentifiedObject): + """Display for quantity that is metered on an end device such as a meter.Display for quantity that is metered on an end device such as a meter. + """ + + def __init__(self, leftDigitCount=0, rightDigitCount=0, ReadingType=None, EndDeviceFunction=None, *args, **kw_args): + """Initialises a new 'Register' instance. + + @param leftDigitCount: Number of digits (dials on a mechanical meter) to the left of the decimal place; default is 5. + @param rightDigitCount: Number of digits (dials on a mechanical meter) to the right of the decimal place. + @param ReadingType: Reading type for values displayed by this register. + @param EndDeviceFunction: End device function metering quantities displayed by this register. + """ + #: Number of digits (dials on a mechanical meter) to the left of the decimal place; default is 5. + self.leftDigitCount = leftDigitCount + + #: Number of digits (dials on a mechanical meter) to the right of the decimal place. + self.rightDigitCount = rightDigitCount + + self._ReadingType = None + self.ReadingType = ReadingType + + self._EndDeviceFunction = None + self.EndDeviceFunction = EndDeviceFunction + + super(Register, self).__init__(*args, **kw_args) + + _attrs = ["leftDigitCount", "rightDigitCount"] + _attr_types = {"leftDigitCount": int, "rightDigitCount": int} + _defaults = {"leftDigitCount": 0, "rightDigitCount": 0} + _enums = {} + _refs = ["ReadingType", "EndDeviceFunction"] + _many_refs = [] + + def getReadingType(self): + """Reading type for values displayed by this register. + """ + return self._ReadingType + + def setReadingType(self, value): + if self._ReadingType is not None: + self._ReadingType._Register = None + + self._ReadingType = value + if self._ReadingType is not None: + self._ReadingType.Register = None + self._ReadingType._Register = self + + ReadingType = property(getReadingType, setReadingType) + + def getEndDeviceFunction(self): + """End device function metering quantities displayed by this register. + """ + return self._EndDeviceFunction + + def setEndDeviceFunction(self, value): + if self._EndDeviceFunction is not None: + filtered = [x for x in self.EndDeviceFunction.Registers if x != self] + self._EndDeviceFunction._Registers = filtered + + self._EndDeviceFunction = value + if self._EndDeviceFunction is not None: + if self not in self._EndDeviceFunction._Registers: + self._EndDeviceFunction._Registers.append(self) + + EndDeviceFunction = property(getEndDeviceFunction, setEndDeviceFunction) + diff --git a/CIM16/IEC61968/Metering/SDPLocation.py b/CIM16/IEC61968/Metering/SDPLocation.py new file mode 100755 index 00000000..7f31c3af --- /dev/null +++ b/CIM16/IEC61968/Metering/SDPLocation.py @@ -0,0 +1,87 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Location import Location + +class SDPLocation(Location): + """Location of an individual service delivery point. For residential or most businesses, it is typically the location of a meter on the customer's premises. For transmission, it is the point(s) of interconnection on the transmission provider's transmission system where capacity and/or energy transmitted by the transmission provider is made available to the receiving party. The point(s) of delivery is specified in the service agreement.Location of an individual service delivery point. For residential or most businesses, it is typically the location of a meter on the customer's premises. For transmission, it is the point(s) of interconnection on the transmission provider's transmission system where capacity and/or energy transmitted by the transmission provider is made available to the receiving party. The point(s) of delivery is specified in the service agreement. + """ + + def __init__(self, accessMethod='', remark='', siteAccessProblem='', occupancyDate='', ServiceDeliveryPoints=None, *args, **kw_args): + """Initialises a new 'SDPLocation' instance. + + @param accessMethod: Method for the service person to access this service delivery point location. For example, a description of where to obtain a key if the facility is unmanned and secured. + @param remark: Remarks about this location. + @param siteAccessProblem: Problems previously encountered when visiting or performing work at this service delivery point location. Examples include: bad dog, violent customer, verbally abusive occupant, obstructions, safety hazards, etc. + @param occupancyDate: Date when certificate of occupancy was provided for this location, 0 if valid certificate of occupancy does not exist for (inherited) 'Location.corporateCode'. + @param ServiceDeliveryPoints: All service delivery points at this location. + """ + #: Method for the service person to access this service delivery point location. For example, a description of where to obtain a key if the facility is unmanned and secured. + self.accessMethod = accessMethod + + #: Remarks about this location. + self.remark = remark + + #: Problems previously encountered when visiting or performing work at this service delivery point location. Examples include: bad dog, violent customer, verbally abusive occupant, obstructions, safety hazards, etc. + self.siteAccessProblem = siteAccessProblem + + #: Date when certificate of occupancy was provided for this location, 0 if valid certificate of occupancy does not exist for (inherited) 'Location.corporateCode'. + self.occupancyDate = occupancyDate + + self._ServiceDeliveryPoints = [] + self.ServiceDeliveryPoints = [] if ServiceDeliveryPoints is None else ServiceDeliveryPoints + + super(SDPLocation, self).__init__(*args, **kw_args) + + _attrs = ["accessMethod", "remark", "siteAccessProblem", "occupancyDate"] + _attr_types = {"accessMethod": str, "remark": str, "siteAccessProblem": str, "occupancyDate": str} + _defaults = {"accessMethod": '', "remark": '', "siteAccessProblem": '', "occupancyDate": ''} + _enums = {} + _refs = ["ServiceDeliveryPoints"] + _many_refs = ["ServiceDeliveryPoints"] + + def getServiceDeliveryPoints(self): + """All service delivery points at this location. + """ + return self._ServiceDeliveryPoints + + def setServiceDeliveryPoints(self, value): + for p in self._ServiceDeliveryPoints: + filtered = [q for q in p.SDPLocations if q != self] + self._ServiceDeliveryPoints._SDPLocations = filtered + for r in value: + if self not in r._SDPLocations: + r._SDPLocations.append(self) + self._ServiceDeliveryPoints = value + + ServiceDeliveryPoints = property(getServiceDeliveryPoints, setServiceDeliveryPoints) + + def addServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + if self not in obj._SDPLocations: + obj._SDPLocations.append(self) + self._ServiceDeliveryPoints.append(obj) + + def removeServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + if self in obj._SDPLocations: + obj._SDPLocations.remove(self) + self._ServiceDeliveryPoints.remove(obj) + diff --git a/CIM16/IEC61968/Metering/ServiceDeliveryPoint.py b/CIM16/IEC61968/Metering/ServiceDeliveryPoint.py new file mode 100755 index 00000000..2830370c --- /dev/null +++ b/CIM16/IEC61968/Metering/ServiceDeliveryPoint.py @@ -0,0 +1,320 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ServiceDeliveryPoint(IdentifiedObject): + """Logical point on the network where the ownership of the service changes hands. It is one of potentially many service points within a service location, delivering service in accordance with a customer agreement. Used at the place where a meter may be installed.Logical point on the network where the ownership of the service changes hands. It is one of potentially many service points within a service location, delivering service in accordance with a customer agreement. Used at the place where a meter may be installed. + """ + + def __init__(self, checkBilling=False, estimatedLoad=0.0, ratedPower=0.0, servicePriority='', grounded=False, serviceDeliveryRemark='', phaseCode="s12N", ctptReference=0, ratedCurrent=0.0, ratedVoltage=0.0, SDPLocations=None, ServiceLocation=None, EndDevices=None, MeterReadings=None, ServiceCategory=None, PricingStructures=None, EnergyConsumer=None, ServiceSupplier=None, CustomerAgreement=None, TransformerTanks=None, *args, **kw_args): + """Initialises a new 'ServiceDeliveryPoint' instance. + + @param checkBilling: True if as a result of an inspection or otherwise, there is a reason to suspect that a previous billing may have been performed with erroneous data. Value should be reset once this potential discrepancy has been resolved. + @param estimatedLoad: Estimated load. + @param ratedPower: Power that this service delivery point is configured to deliver. + @param servicePriority: Priority of service for this service delivery point. Note that service delivery points at the same service location can have different priorities. + @param grounded: True if grounded. + @param serviceDeliveryRemark: Remarks about this service delivery point, for example the reason for it being rated with a non-nominal priority. + @param phaseCode: Phase code. Number of wires and number of phases can be deduced from enumeration literal values. For example, ABCN is three-phase, four-wire. s12n (splitSecondary12N) is single-phase, three-wire. s1n and s2n are single-phase, two-wire. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param ctptReference: (optional for medium voltage connections) Reference to the low side terminal of a CT or PT that obtain readings from a medium or high voltage point. + @param ratedCurrent: Current that this service delivery point is configured to deliver. + @param ratedVoltage: Nominal service voltage. + @param SDPLocations: All locations of this service delivery point. + @param ServiceLocation: Service location where the service delivered by this service delivery point is consumed. + @param EndDevices: All end devices at this service delivery point. + @param MeterReadings: All meter readings obtained from this service delivery point. + @param ServiceCategory: Service category delivered by this service delivery point. + @param PricingStructures: All pricing structures applicable to this service delivery point (with prepayment meter running as a stand-alone device, with no CustomerAgreement or Customer). + @param EnergyConsumer: + @param ServiceSupplier: ServiceSupplier (Utility) utilising this service delivery point to deliver a service. + @param CustomerAgreement: Customer agreement regulating this service delivery point. + @param TransformerTanks: Transformer supplying this service delivery point. + """ + #: True if as a result of an inspection or otherwise, there is a reason to suspect that a previous billing may have been performed with erroneous data. Value should be reset once this potential discrepancy has been resolved. + self.checkBilling = checkBilling + + #: Estimated load. + self.estimatedLoad = estimatedLoad + + #: Power that this service delivery point is configured to deliver. + self.ratedPower = ratedPower + + #: Priority of service for this service delivery point. Note that service delivery points at the same service location can have different priorities. + self.servicePriority = servicePriority + + #: True if grounded. + self.grounded = grounded + + #: Remarks about this service delivery point, for example the reason for it being rated with a non-nominal priority. + self.serviceDeliveryRemark = serviceDeliveryRemark + + #: Phase code. Number of wires and number of phases can be deduced from enumeration literal values. For example, ABCN is three-phase, four-wire. s12n (splitSecondary12N) is single-phase, three-wire. s1n and s2n are single-phase, two-wire. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.phaseCode = phaseCode + + #: (optional for medium voltage connections) Reference to the low side terminal of a CT or PT that obtain readings from a medium or high voltage point. + self.ctptReference = ctptReference + + #: Current that this service delivery point is configured to deliver. + self.ratedCurrent = ratedCurrent + + #: Nominal service voltage. + self.ratedVoltage = ratedVoltage + + self._SDPLocations = [] + self.SDPLocations = [] if SDPLocations is None else SDPLocations + + self._ServiceLocation = None + self.ServiceLocation = ServiceLocation + + self._EndDevices = [] + self.EndDevices = [] if EndDevices is None else EndDevices + + self._MeterReadings = [] + self.MeterReadings = [] if MeterReadings is None else MeterReadings + + self._ServiceCategory = None + self.ServiceCategory = ServiceCategory + + self._PricingStructures = [] + self.PricingStructures = [] if PricingStructures is None else PricingStructures + + self._EnergyConsumer = None + self.EnergyConsumer = EnergyConsumer + + self._ServiceSupplier = None + self.ServiceSupplier = ServiceSupplier + + self._CustomerAgreement = None + self.CustomerAgreement = CustomerAgreement + + self._TransformerTanks = None + self.TransformerTanks = TransformerTanks + + super(ServiceDeliveryPoint, self).__init__(*args, **kw_args) + + _attrs = ["checkBilling", "estimatedLoad", "ratedPower", "servicePriority", "grounded", "serviceDeliveryRemark", "phaseCode", "ctptReference", "ratedCurrent", "ratedVoltage"] + _attr_types = {"checkBilling": bool, "estimatedLoad": float, "ratedPower": float, "servicePriority": str, "grounded": bool, "serviceDeliveryRemark": str, "phaseCode": str, "ctptReference": int, "ratedCurrent": float, "ratedVoltage": float} + _defaults = {"checkBilling": False, "estimatedLoad": 0.0, "ratedPower": 0.0, "servicePriority": '', "grounded": False, "serviceDeliveryRemark": '', "phaseCode": "s12N", "ctptReference": 0, "ratedCurrent": 0.0, "ratedVoltage": 0.0} + _enums = {"phaseCode": "PhaseCode"} + _refs = ["SDPLocations", "ServiceLocation", "EndDevices", "MeterReadings", "ServiceCategory", "PricingStructures", "EnergyConsumer", "ServiceSupplier", "CustomerAgreement", "TransformerTanks"] + _many_refs = ["SDPLocations", "EndDevices", "MeterReadings", "PricingStructures"] + + def getSDPLocations(self): + """All locations of this service delivery point. + """ + return self._SDPLocations + + def setSDPLocations(self, value): + for p in self._SDPLocations: + filtered = [q for q in p.ServiceDeliveryPoints if q != self] + self._SDPLocations._ServiceDeliveryPoints = filtered + for r in value: + if self not in r._ServiceDeliveryPoints: + r._ServiceDeliveryPoints.append(self) + self._SDPLocations = value + + SDPLocations = property(getSDPLocations, setSDPLocations) + + def addSDPLocations(self, *SDPLocations): + for obj in SDPLocations: + if self not in obj._ServiceDeliveryPoints: + obj._ServiceDeliveryPoints.append(self) + self._SDPLocations.append(obj) + + def removeSDPLocations(self, *SDPLocations): + for obj in SDPLocations: + if self in obj._ServiceDeliveryPoints: + obj._ServiceDeliveryPoints.remove(self) + self._SDPLocations.remove(obj) + + def getServiceLocation(self): + """Service location where the service delivered by this service delivery point is consumed. + """ + return self._ServiceLocation + + def setServiceLocation(self, value): + if self._ServiceLocation is not None: + filtered = [x for x in self.ServiceLocation.ServiceDeliveryPoints if x != self] + self._ServiceLocation._ServiceDeliveryPoints = filtered + + self._ServiceLocation = value + if self._ServiceLocation is not None: + if self not in self._ServiceLocation._ServiceDeliveryPoints: + self._ServiceLocation._ServiceDeliveryPoints.append(self) + + ServiceLocation = property(getServiceLocation, setServiceLocation) + + def getEndDevices(self): + """All end devices at this service delivery point. + """ + return self._EndDevices + + def setEndDevices(self, value): + for x in self._EndDevices: + x.ServiceDeliveryPoint = None + for y in value: + y._ServiceDeliveryPoint = self + self._EndDevices = value + + EndDevices = property(getEndDevices, setEndDevices) + + def addEndDevices(self, *EndDevices): + for obj in EndDevices: + obj.ServiceDeliveryPoint = self + + def removeEndDevices(self, *EndDevices): + for obj in EndDevices: + obj.ServiceDeliveryPoint = None + + def getMeterReadings(self): + """All meter readings obtained from this service delivery point. + """ + return self._MeterReadings + + def setMeterReadings(self, value): + for x in self._MeterReadings: + x.ServiceDeliveryPoint = None + for y in value: + y._ServiceDeliveryPoint = self + self._MeterReadings = value + + MeterReadings = property(getMeterReadings, setMeterReadings) + + def addMeterReadings(self, *MeterReadings): + for obj in MeterReadings: + obj.ServiceDeliveryPoint = self + + def removeMeterReadings(self, *MeterReadings): + for obj in MeterReadings: + obj.ServiceDeliveryPoint = None + + def getServiceCategory(self): + """Service category delivered by this service delivery point. + """ + return self._ServiceCategory + + def setServiceCategory(self, value): + if self._ServiceCategory is not None: + filtered = [x for x in self.ServiceCategory.ServiceDeliveryPoints if x != self] + self._ServiceCategory._ServiceDeliveryPoints = filtered + + self._ServiceCategory = value + if self._ServiceCategory is not None: + if self not in self._ServiceCategory._ServiceDeliveryPoints: + self._ServiceCategory._ServiceDeliveryPoints.append(self) + + ServiceCategory = property(getServiceCategory, setServiceCategory) + + def getPricingStructures(self): + """All pricing structures applicable to this service delivery point (with prepayment meter running as a stand-alone device, with no CustomerAgreement or Customer). + """ + return self._PricingStructures + + def setPricingStructures(self, value): + for p in self._PricingStructures: + filtered = [q for q in p.ServiceDeliveryPoints if q != self] + self._PricingStructures._ServiceDeliveryPoints = filtered + for r in value: + if self not in r._ServiceDeliveryPoints: + r._ServiceDeliveryPoints.append(self) + self._PricingStructures = value + + PricingStructures = property(getPricingStructures, setPricingStructures) + + def addPricingStructures(self, *PricingStructures): + for obj in PricingStructures: + if self not in obj._ServiceDeliveryPoints: + obj._ServiceDeliveryPoints.append(self) + self._PricingStructures.append(obj) + + def removePricingStructures(self, *PricingStructures): + for obj in PricingStructures: + if self in obj._ServiceDeliveryPoints: + obj._ServiceDeliveryPoints.remove(self) + self._PricingStructures.remove(obj) + + def getEnergyConsumer(self): + + return self._EnergyConsumer + + def setEnergyConsumer(self, value): + if self._EnergyConsumer is not None: + filtered = [x for x in self.EnergyConsumer.ServiceDeliveryPoints if x != self] + self._EnergyConsumer._ServiceDeliveryPoints = filtered + + self._EnergyConsumer = value + if self._EnergyConsumer is not None: + if self not in self._EnergyConsumer._ServiceDeliveryPoints: + self._EnergyConsumer._ServiceDeliveryPoints.append(self) + + EnergyConsumer = property(getEnergyConsumer, setEnergyConsumer) + + def getServiceSupplier(self): + """ServiceSupplier (Utility) utilising this service delivery point to deliver a service. + """ + return self._ServiceSupplier + + def setServiceSupplier(self, value): + if self._ServiceSupplier is not None: + filtered = [x for x in self.ServiceSupplier.ServiceDeliveryPoints if x != self] + self._ServiceSupplier._ServiceDeliveryPoints = filtered + + self._ServiceSupplier = value + if self._ServiceSupplier is not None: + if self not in self._ServiceSupplier._ServiceDeliveryPoints: + self._ServiceSupplier._ServiceDeliveryPoints.append(self) + + ServiceSupplier = property(getServiceSupplier, setServiceSupplier) + + def getCustomerAgreement(self): + """Customer agreement regulating this service delivery point. + """ + return self._CustomerAgreement + + def setCustomerAgreement(self, value): + if self._CustomerAgreement is not None: + filtered = [x for x in self.CustomerAgreement.ServiceDeliveryPoints if x != self] + self._CustomerAgreement._ServiceDeliveryPoints = filtered + + self._CustomerAgreement = value + if self._CustomerAgreement is not None: + if self not in self._CustomerAgreement._ServiceDeliveryPoints: + self._CustomerAgreement._ServiceDeliveryPoints.append(self) + + CustomerAgreement = property(getCustomerAgreement, setCustomerAgreement) + + def getTransformerTanks(self): + """Transformer supplying this service delivery point. + """ + return self._TransformerTanks + + def setTransformerTanks(self, value): + if self._TransformerTanks is not None: + filtered = [x for x in self.TransformerTanks.ServiceDeliveryPoints if x != self] + self._TransformerTanks._ServiceDeliveryPoints = filtered + + self._TransformerTanks = value + if self._TransformerTanks is not None: + if self not in self._TransformerTanks._ServiceDeliveryPoints: + self._TransformerTanks._ServiceDeliveryPoints.append(self) + + TransformerTanks = property(getTransformerTanks, setTransformerTanks) + diff --git a/CIM16/IEC61968/Metering/SimpleEndDeviceFunction.py b/CIM16/IEC61968/Metering/SimpleEndDeviceFunction.py new file mode 100755 index 00000000..12807c37 --- /dev/null +++ b/CIM16/IEC61968/Metering/SimpleEndDeviceFunction.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Metering.EndDeviceFunction import EndDeviceFunction + +class SimpleEndDeviceFunction(EndDeviceFunction): + """Simple end device function distinguished by 'kind'; use this class for instances that cannot be represented by another end device function subtype.Simple end device function distinguished by 'kind'; use this class for instances that cannot be represented by another end device function subtype. + """ + + def __init__(self, kind="onRequestRead", *args, **kw_args): + """Initialises a new 'SimpleEndDeviceFunction' instance. + + @param kind: Kind of this function. Values are: "onRequestRead", "relaysProgramming", "demandResponse", "metrology", "outageHistory", "autonomousDst", "reverseFlow" + """ + #: Kind of this function. Values are: "onRequestRead", "relaysProgramming", "demandResponse", "metrology", "outageHistory", "autonomousDst", "reverseFlow" + self.kind = kind + + super(SimpleEndDeviceFunction, self).__init__(*args, **kw_args) + + _attrs = ["kind"] + _attr_types = {"kind": str} + _defaults = {"kind": "onRequestRead"} + _enums = {"kind": "EndDeviceFunctionKind"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/Metering/__init__.py b/CIM16/IEC61968/Metering/__init__.py new file mode 100755 index 00000000..ca930450 --- /dev/null +++ b/CIM16/IEC61968/Metering/__init__.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package contains only diagrams, drawn by hand from Metering-related XSDs that are in Part 9 document. Entry points into the schema are filled with green. Non-used associations are light grey. +""" + +from CIM16.IEC61968.Metering.SDPLocation import SDPLocation +from CIM16.IEC61968.Metering.Reading import Reading +from CIM16.IEC61968.Metering.ServiceDeliveryPoint import ServiceDeliveryPoint +from CIM16.IEC61968.Metering.ElectricMeteringFunction import ElectricMeteringFunction +from CIM16.IEC61968.Metering.DemandResponseProgram import DemandResponseProgram +from CIM16.IEC61968.Metering.ReadingMultiplier import ReadingMultiplier +from CIM16.IEC61968.Metering.MeterReading import MeterReading +from CIM16.IEC61968.Metering.ReadingQuality import ReadingQuality +from CIM16.IEC61968.Metering.EndDeviceEvent import EndDeviceEvent +from CIM16.IEC61968.Metering.IntervalReading import IntervalReading +from CIM16.IEC61968.Metering.Meter import Meter +from CIM16.IEC61968.Metering.MeterServiceWork import MeterServiceWork +from CIM16.IEC61968.Metering.PendingCalculation import PendingCalculation +from CIM16.IEC61968.Metering.IntervalBlock import IntervalBlock +from CIM16.IEC61968.Metering.EndDeviceFunction import EndDeviceFunction +from CIM16.IEC61968.Metering.ComFunction import ComFunction +from CIM16.IEC61968.Metering.EndDevice import EndDevice +from CIM16.IEC61968.Metering.SimpleEndDeviceFunction import SimpleEndDeviceFunction +from CIM16.IEC61968.Metering.EndDeviceGroup import EndDeviceGroup +from CIM16.IEC61968.Metering.Register import Register +from CIM16.IEC61968.Metering.EndDeviceControl import EndDeviceControl +from CIM16.IEC61968.Metering.DynamicDemand import DynamicDemand +from CIM16.IEC61968.Metering.ReadingType import ReadingType + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Metering" +nsPrefix = "cimMetering" + + +class EndDeviceFunctionKind(str): + """Values are: onRequestRead, relaysProgramming, demandResponse, metrology, outageHistory, autonomousDst, reverseFlow + """ + pass + +class ReadingKind(str): + """Values are: phaseAngle, volume, frequency, energy, currentAngle, powerFactor, date, other, demand, power, pressure, voltage, voltageAngle, time, current + """ + pass + +class DemandKind(str): + """Values are: fixedBlock, rollingBlock, logarithmic + """ + pass diff --git a/CIM16/IEC61968/PaymentMetering/AccountMovement.py b/CIM16/IEC61968/PaymentMetering/AccountMovement.py new file mode 100755 index 00000000..be967d03 --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/AccountMovement.py @@ -0,0 +1,49 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class AccountMovement(object): + """Credit/debit movements for an account.Credit/debit movements for an account. + """ + + def __init__(self, dateTime='', reason='', amount=0.0): + """Initialises a new 'AccountMovement' instance. + + @param dateTime: Date and time when the credit/debit transaction was performed. + @param reason: Reason for credit/debit transaction on an account. Example: payment received/arrears interest levied. + @param amount: Amount that was credited to/debited from an account. For example: payment received/interest charge on arrears. + """ + #: Date and time when the credit/debit transaction was performed. + self.dateTime = dateTime + + #: Reason for credit/debit transaction on an account. Example: payment received/arrears interest levied. + self.reason = reason + + #: Amount that was credited to/debited from an account. For example: payment received/interest charge on arrears. + self.amount = amount + + + _attrs = ["dateTime", "reason", "amount"] + _attr_types = {"dateTime": str, "reason": str, "amount": float} + _defaults = {"dateTime": '', "reason": '', "amount": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/PaymentMetering/AccountingUnit.py b/CIM16/IEC61968/PaymentMetering/AccountingUnit.py new file mode 100755 index 00000000..67a57dbc --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/AccountingUnit.py @@ -0,0 +1,53 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class AccountingUnit(object): + """Unit for accounting; use either 'energyUnit' or 'currencyUnit' to specify the unit for 'value'.Unit for accounting; use either 'energyUnit' or 'currencyUnit' to specify the unit for 'value'. + """ + + def __init__(self, multiplier="M", energyUnit=0.0, monetaryUnit="CAD", value=0.0): + """Initialises a new 'AccountingUnit' instance. + + @param multiplier: Multiplier for the 'energyUnit' or 'monetaryUnit'. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param energyUnit: Unit of service. + @param monetaryUnit: Unit of currency. Values are: "CAD", "EUR", "CHF", "INR", "AUD", "USD", "RUR", "GBP", "CNY", "SEK", "JPY", "other", "NOK", "DKK" + @param value: Value expressed in applicable units. + """ + #: Multiplier for the 'energyUnit' or 'monetaryUnit'. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.multiplier = multiplier + + #: Unit of service. + self.energyUnit = energyUnit + + #: Unit of currency. Values are: "CAD", "EUR", "CHF", "INR", "AUD", "USD", "RUR", "GBP", "CNY", "SEK", "JPY", "other", "NOK", "DKK" + self.monetaryUnit = monetaryUnit + + #: Value expressed in applicable units. + self.value = value + + + _attrs = ["multiplier", "energyUnit", "monetaryUnit", "value"] + _attr_types = {"multiplier": str, "energyUnit": float, "monetaryUnit": str, "value": float} + _defaults = {"multiplier": "M", "energyUnit": 0.0, "monetaryUnit": "CAD", "value": 0.0} + _enums = {"multiplier": "UnitMultiplier", "monetaryUnit": "Currency"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/PaymentMetering/AuxiliaryAccount.py b/CIM16/IEC61968/PaymentMetering/AuxiliaryAccount.py new file mode 100755 index 00000000..afea7d9e --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/AuxiliaryAccount.py @@ -0,0 +1,144 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class AuxiliaryAccount(Document): + """Variable and dynamic part of auxiliary agreement, generally representing the current state of the account related to the outstanding balance defined in auxiliary agreement.Variable and dynamic part of auxiliary agreement, generally representing the current state of the account related to the outstanding balance defined in auxiliary agreement. + """ + + def __init__(self, principleAmount=0.0, balance=0.0, lastDebit=None, PaymentTransactions=None, Charges=None, lastCredit=None, AuxiliaryAgreement=None, due=None, *args, **kw_args): + """Initialises a new 'AuxiliaryAccount' instance. + + @param principleAmount: The initial principle amount, with which this account was instantiated. + @param balance: The total amount currently remaining on this account that is required to be paid in order to settle the account to zero. This excludes any due amounts not yet paid. + @param lastDebit: Details of the last debit transaction performed on this account. + @param PaymentTransactions: All payments against this account. + @param Charges: All charges levied on this account. + @param lastCredit: Details of the last credit transaction performed on this account. + @param AuxiliaryAgreement: Auxiliary agreement regulating this account. + @param due: Current amounts now due for payment on this account. + """ + #: The initial principle amount, with which this account was instantiated. + self.principleAmount = principleAmount + + #: The total amount currently remaining on this account that is required to be paid in order to settle the account to zero. This excludes any due amounts not yet paid. + self.balance = balance + + self.lastDebit = lastDebit + + self._PaymentTransactions = [] + self.PaymentTransactions = [] if PaymentTransactions is None else PaymentTransactions + + self._Charges = [] + self.Charges = [] if Charges is None else Charges + + self.lastCredit = lastCredit + + self._AuxiliaryAgreement = None + self.AuxiliaryAgreement = AuxiliaryAgreement + + self.due = due + + super(AuxiliaryAccount, self).__init__(*args, **kw_args) + + _attrs = ["principleAmount", "balance"] + _attr_types = {"principleAmount": float, "balance": float} + _defaults = {"principleAmount": 0.0, "balance": 0.0} + _enums = {} + _refs = ["lastDebit", "PaymentTransactions", "Charges", "lastCredit", "AuxiliaryAgreement", "due"] + _many_refs = ["PaymentTransactions", "Charges"] + + # Details of the last debit transaction performed on this account. + lastDebit = None + + def getPaymentTransactions(self): + """All payments against this account. + """ + return self._PaymentTransactions + + def setPaymentTransactions(self, value): + for x in self._PaymentTransactions: + x.AuxiliaryAccount = None + for y in value: + y._AuxiliaryAccount = self + self._PaymentTransactions = value + + PaymentTransactions = property(getPaymentTransactions, setPaymentTransactions) + + def addPaymentTransactions(self, *PaymentTransactions): + for obj in PaymentTransactions: + obj.AuxiliaryAccount = self + + def removePaymentTransactions(self, *PaymentTransactions): + for obj in PaymentTransactions: + obj.AuxiliaryAccount = None + + def getCharges(self): + """All charges levied on this account. + """ + return self._Charges + + def setCharges(self, value): + for p in self._Charges: + filtered = [q for q in p.AuxiliaryAccounts if q != self] + self._Charges._AuxiliaryAccounts = filtered + for r in value: + if self not in r._AuxiliaryAccounts: + r._AuxiliaryAccounts.append(self) + self._Charges = value + + Charges = property(getCharges, setCharges) + + def addCharges(self, *Charges): + for obj in Charges: + if self not in obj._AuxiliaryAccounts: + obj._AuxiliaryAccounts.append(self) + self._Charges.append(obj) + + def removeCharges(self, *Charges): + for obj in Charges: + if self in obj._AuxiliaryAccounts: + obj._AuxiliaryAccounts.remove(self) + self._Charges.remove(obj) + + # Details of the last credit transaction performed on this account. + lastCredit = None + + def getAuxiliaryAgreement(self): + """Auxiliary agreement regulating this account. + """ + return self._AuxiliaryAgreement + + def setAuxiliaryAgreement(self, value): + if self._AuxiliaryAgreement is not None: + filtered = [x for x in self.AuxiliaryAgreement.AuxiliaryAccounts if x != self] + self._AuxiliaryAgreement._AuxiliaryAccounts = filtered + + self._AuxiliaryAgreement = value + if self._AuxiliaryAgreement is not None: + if self not in self._AuxiliaryAgreement._AuxiliaryAccounts: + self._AuxiliaryAgreement._AuxiliaryAccounts.append(self) + + AuxiliaryAgreement = property(getAuxiliaryAgreement, setAuxiliaryAgreement) + + # Current amounts now due for payment on this account. + due = None + diff --git a/CIM16/IEC61968/PaymentMetering/AuxiliaryAgreement.py b/CIM16/IEC61968/PaymentMetering/AuxiliaryAgreement.py new file mode 100755 index 00000000..0da97761 --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/AuxiliaryAgreement.py @@ -0,0 +1,126 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Agreement import Agreement + +class AuxiliaryAgreement(Agreement): + """An ad-hoc auxiliary account agreement associated with a customer agreement, not part of the customer's account, but typically subject to formal agreement between customer and supplier (utility). Typically this is used to collect revenue owing by the customer for other services or arrears accrued with the utility for other services. It is typically linked to a prepaid token purchase transaction, thus forcing the customer to make a payment towards settlement of the auxiliary account balance whenever he needs to purchase a prepaid token for electricity. The present status of auxiliary agreement can be defined in the context of the utility's business rules, for example: enabled, disabled, pending, over recovered, under recovered, written off, etc.An ad-hoc auxiliary account agreement associated with a customer agreement, not part of the customer's account, but typically subject to formal agreement between customer and supplier (utility). Typically this is used to collect revenue owing by the customer for other services or arrears accrued with the utility for other services. It is typically linked to a prepaid token purchase transaction, thus forcing the customer to make a payment towards settlement of the auxiliary account balance whenever he needs to purchase a prepaid token for electricity. The present status of auxiliary agreement can be defined in the context of the utility's business rules, for example: enabled, disabled, pending, over recovered, under recovered, written off, etc. + """ + + def __init__(self, vendPortionArrear=0.0, auxRef='', payCycle='', arrearsInterest=0.0, fixedAmount=0.0, vendPortion=0.0, subCategory='', auxCycle='', auxPriorityCode='', minAmount=0.0, CustomerAgreement=None, AuxiliaryAccounts=None, *args, **kw_args): + """Initialises a new 'AuxiliaryAgreement' instance. + + @param vendPortionArrear: The percentage of the transaction amount that must be collected from each vending transaction towards settlement of this auxiliary agreement when payments are in arrears. Note that there may be multiple tokens vended per vending transaction, but this is not relevant. + @param auxRef: A local reference to this auxiliary agreement defined in the context of the implementation and not related to IdentifiedObject.mRID. + @param payCycle: The contractually expected payment frequency (by the customer). Examples are: ad-hoc; on specified date; hourly, daily, weekly, monthly. etc. + @param arrearsInterest: The interest per annum to be charged prorata on 'AuxiliaryAccount.dueArrears' at the end of each 'payCycle'. + @param fixedAmount: The fixed amount that must be collected from each vending transaction towards settlement of this auxiliary agreement. Note that there may be multiple tokens vended per vending transaction, but this is not relevant. + @param vendPortion: The percentage of the transaction amount that must be collected from each vending transaction towards settlement of this auxiliary agreement when payments are not in arrears. Note that there may be multiple tokens vended per vending transaction, but this is not relevant. + @param subCategory: Sub-category of this AuxiliaryAgreement as sub-classification of the inherited 'category'. + @param auxCycle: The frequency for automatically recurring auxiliary charges, where 'AuxiliaryAccount.initialCharge' is recursively added to 'AuxiliaryAccount.dueCurrent' at the start of each 'auxCycle'. For example: on a specified date and time; hourly; daily; weekly; monthly; 3-monthly; 6-monthly; 12-monthly; etc. + @param auxPriorityCode: The coded priority indicating the priority that this auxiliary agreement has above other auxiliary agreements (associated with the same customer agreement) when it comes to competing for settlement from a payment transaction or token purchase. + @param minAmount: The minimum amount that must be paid at any transaction towards settling this auxiliry agreement or reducing the balance. + @param CustomerAgreement: Customer agreement this (non-service related) auxiliary agreement refers to. + @param AuxiliaryAccounts: All auxiliary accounts regulated by this agreement. + """ + #: The percentage of the transaction amount that must be collected from each vending transaction towards settlement of this auxiliary agreement when payments are in arrears. Note that there may be multiple tokens vended per vending transaction, but this is not relevant. + self.vendPortionArrear = vendPortionArrear + + #: A local reference to this auxiliary agreement defined in the context of the implementation and not related to IdentifiedObject.mRID. + self.auxRef = auxRef + + #: The contractually expected payment frequency (by the customer). Examples are: ad-hoc; on specified date; hourly, daily, weekly, monthly. etc. + self.payCycle = payCycle + + #: The interest per annum to be charged prorata on 'AuxiliaryAccount.dueArrears' at the end of each 'payCycle'. + self.arrearsInterest = arrearsInterest + + #: The fixed amount that must be collected from each vending transaction towards settlement of this auxiliary agreement. Note that there may be multiple tokens vended per vending transaction, but this is not relevant. + self.fixedAmount = fixedAmount + + #: The percentage of the transaction amount that must be collected from each vending transaction towards settlement of this auxiliary agreement when payments are not in arrears. Note that there may be multiple tokens vended per vending transaction, but this is not relevant. + self.vendPortion = vendPortion + + #: Sub-category of this AuxiliaryAgreement as sub-classification of the inherited 'category'. + self.subCategory = subCategory + + #: The frequency for automatically recurring auxiliary charges, where 'AuxiliaryAccount.initialCharge' is recursively added to 'AuxiliaryAccount.dueCurrent' at the start of each 'auxCycle'. For example: on a specified date and time; hourly; daily; weekly; monthly; 3-monthly; 6-monthly; 12-monthly; etc. + self.auxCycle = auxCycle + + #: The coded priority indicating the priority that this auxiliary agreement has above other auxiliary agreements (associated with the same customer agreement) when it comes to competing for settlement from a payment transaction or token purchase. + self.auxPriorityCode = auxPriorityCode + + #: The minimum amount that must be paid at any transaction towards settling this auxiliry agreement or reducing the balance. + self.minAmount = minAmount + + self._CustomerAgreement = None + self.CustomerAgreement = CustomerAgreement + + self._AuxiliaryAccounts = [] + self.AuxiliaryAccounts = [] if AuxiliaryAccounts is None else AuxiliaryAccounts + + super(AuxiliaryAgreement, self).__init__(*args, **kw_args) + + _attrs = ["vendPortionArrear", "auxRef", "payCycle", "arrearsInterest", "fixedAmount", "vendPortion", "subCategory", "auxCycle", "auxPriorityCode", "minAmount"] + _attr_types = {"vendPortionArrear": float, "auxRef": str, "payCycle": str, "arrearsInterest": float, "fixedAmount": float, "vendPortion": float, "subCategory": str, "auxCycle": str, "auxPriorityCode": str, "minAmount": float} + _defaults = {"vendPortionArrear": 0.0, "auxRef": '', "payCycle": '', "arrearsInterest": 0.0, "fixedAmount": 0.0, "vendPortion": 0.0, "subCategory": '', "auxCycle": '', "auxPriorityCode": '', "minAmount": 0.0} + _enums = {} + _refs = ["CustomerAgreement", "AuxiliaryAccounts"] + _many_refs = ["AuxiliaryAccounts"] + + def getCustomerAgreement(self): + """Customer agreement this (non-service related) auxiliary agreement refers to. + """ + return self._CustomerAgreement + + def setCustomerAgreement(self, value): + if self._CustomerAgreement is not None: + filtered = [x for x in self.CustomerAgreement.AuxiliaryAgreements if x != self] + self._CustomerAgreement._AuxiliaryAgreements = filtered + + self._CustomerAgreement = value + if self._CustomerAgreement is not None: + if self not in self._CustomerAgreement._AuxiliaryAgreements: + self._CustomerAgreement._AuxiliaryAgreements.append(self) + + CustomerAgreement = property(getCustomerAgreement, setCustomerAgreement) + + def getAuxiliaryAccounts(self): + """All auxiliary accounts regulated by this agreement. + """ + return self._AuxiliaryAccounts + + def setAuxiliaryAccounts(self, value): + for x in self._AuxiliaryAccounts: + x.AuxiliaryAgreement = None + for y in value: + y._AuxiliaryAgreement = self + self._AuxiliaryAccounts = value + + AuxiliaryAccounts = property(getAuxiliaryAccounts, setAuxiliaryAccounts) + + def addAuxiliaryAccounts(self, *AuxiliaryAccounts): + for obj in AuxiliaryAccounts: + obj.AuxiliaryAgreement = self + + def removeAuxiliaryAccounts(self, *AuxiliaryAccounts): + for obj in AuxiliaryAccounts: + obj.AuxiliaryAgreement = None + diff --git a/CIM16/IEC61968/PaymentMetering/BankAccountDetail.py b/CIM16/IEC61968/PaymentMetering/BankAccountDetail.py new file mode 100755 index 00000000..be61f5ef --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/BankAccountDetail.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class BankAccountDetail(object): + """Details of a bank account.Details of a bank account. + """ + + def __init__(self, holderID='', holderName='', bankName='', branchCode='', accountNumber=''): + """Initialises a new 'BankAccountDetail' instance. + + @param holderID: National identity number (or equivalent) of account holder. + @param holderName: Name of account holder. + @param bankName: Name of bank where account is held. + @param branchCode: Branch of bank where account is held. + @param accountNumber: Operational account reference number. + """ + #: National identity number (or equivalent) of account holder. + self.holderID = holderID + + #: Name of account holder. + self.holderName = holderName + + #: Name of bank where account is held. + self.bankName = bankName + + #: Branch of bank where account is held. + self.branchCode = branchCode + + #: Operational account reference number. + self.accountNumber = accountNumber + + + _attrs = ["holderID", "holderName", "bankName", "branchCode", "accountNumber"] + _attr_types = {"holderID": str, "holderName": str, "bankName": str, "branchCode": str, "accountNumber": str} + _defaults = {"holderID": '', "holderName": '', "bankName": '', "branchCode": '', "accountNumber": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/PaymentMetering/Card.py b/CIM16/IEC61968/PaymentMetering/Card.py new file mode 100755 index 00000000..531df767 --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/Card.py @@ -0,0 +1,75 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class Card(Element): + """Documentation of the tender when it is a type of card (credit, debit, etc).Documentation of the tender when it is a type of card (credit, debit, etc). + """ + + def __init__(self, cvNumber='', expiryDate='', pan='', accountHolderName='', Tender=None, *args, **kw_args): + """Initialises a new 'Card' instance. + + @param cvNumber: The card verification number. + @param expiryDate: The date when this card expires. + @param pan: The primary account number. + @param accountHolderName: Name of account holder. + @param Tender: Payment tender this card is being used for. + """ + #: The card verification number. + self.cvNumber = cvNumber + + #: The date when this card expires. + self.expiryDate = expiryDate + + #: The primary account number. + self.pan = pan + + #: Name of account holder. + self.accountHolderName = accountHolderName + + self._Tender = None + self.Tender = Tender + + super(Card, self).__init__(*args, **kw_args) + + _attrs = ["cvNumber", "expiryDate", "pan", "accountHolderName"] + _attr_types = {"cvNumber": str, "expiryDate": str, "pan": str, "accountHolderName": str} + _defaults = {"cvNumber": '', "expiryDate": '', "pan": '', "accountHolderName": ''} + _enums = {} + _refs = ["Tender"] + _many_refs = [] + + def getTender(self): + """Payment tender this card is being used for. + """ + return self._Tender + + def setTender(self, value): + if self._Tender is not None: + self._Tender._Card = None + + self._Tender = value + if self._Tender is not None: + self._Tender.Card = None + self._Tender._Card = self + + Tender = property(getTender, setTender) + diff --git a/CIM16/IEC61968/PaymentMetering/Cashier.py b/CIM16/IEC61968/PaymentMetering/Cashier.py new file mode 100755 index 00000000..a512365f --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/Cashier.py @@ -0,0 +1,71 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Cashier(IdentifiedObject): + """The operator of the point of sale for the duration of CashierShift. Cashier is under the exclusive management control of Vendor.The operator of the point of sale for the duration of CashierShift. Cashier is under the exclusive management control of Vendor. + """ + + def __init__(self, electronicAddress=None, CashierShifts=None, *args, **kw_args): + """Initialises a new 'Cashier' instance. + + @param electronicAddress: Electronic address. + @param CashierShifts: All shifts operated by this cashier. + """ + self.electronicAddress = electronicAddress + + self._CashierShifts = [] + self.CashierShifts = [] if CashierShifts is None else CashierShifts + + super(Cashier, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["electronicAddress", "CashierShifts"] + _many_refs = ["CashierShifts"] + + # Electronic address. + electronicAddress = None + + def getCashierShifts(self): + """All shifts operated by this cashier. + """ + return self._CashierShifts + + def setCashierShifts(self, value): + for x in self._CashierShifts: + x.Cashier = None + for y in value: + y._Cashier = self + self._CashierShifts = value + + CashierShifts = property(getCashierShifts, setCashierShifts) + + def addCashierShifts(self, *CashierShifts): + for obj in CashierShifts: + obj.Cashier = self + + def removeCashierShifts(self, *CashierShifts): + for obj in CashierShifts: + obj.Cashier = None + diff --git a/CIM16/IEC61968/PaymentMetering/CashierShift.py b/CIM16/IEC61968/PaymentMetering/CashierShift.py new file mode 100755 index 00000000..76a3644b --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/CashierShift.py @@ -0,0 +1,136 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.PaymentMetering.Shift import Shift + +class CashierShift(Shift): + """The operating shift for a cashier, during which he may transact against the cashier shift, subject to vendor shift being open.The operating shift for a cashier, during which he may transact against the cashier shift, subject to vendor shift being open. + """ + + def __init__(self, cashFloat=0.0, Transactions=None, PointOfSale=None, Receipts=None, Cashier=None, *args, **kw_args): + """Initialises a new 'CashierShift' instance. + + @param cashFloat: The amount of cash that the cashier brings with him to start his shift and that he will take away at the end of his shift; i.e. the cash float does not get banked. + @param Transactions: + @param PointOfSale: Point of sale that is in operation during this shift. + @param Receipts: All Receipts recorded for this Shift. + @param Cashier: Cashier operating this shift. + """ + #: The amount of cash that the cashier brings with him to start his shift and that he will take away at the end of his shift; i.e. the cash float does not get banked. + self.cashFloat = cashFloat + + self._Transactions = [] + self.Transactions = [] if Transactions is None else Transactions + + self._PointOfSale = None + self.PointOfSale = PointOfSale + + self._Receipts = [] + self.Receipts = [] if Receipts is None else Receipts + + self._Cashier = None + self.Cashier = Cashier + + super(CashierShift, self).__init__(*args, **kw_args) + + _attrs = ["cashFloat"] + _attr_types = {"cashFloat": float} + _defaults = {"cashFloat": 0.0} + _enums = {} + _refs = ["Transactions", "PointOfSale", "Receipts", "Cashier"] + _many_refs = ["Transactions", "Receipts"] + + def getTransactions(self): + + return self._Transactions + + def setTransactions(self, value): + for x in self._Transactions: + x.CashierShift = None + for y in value: + y._CashierShift = self + self._Transactions = value + + Transactions = property(getTransactions, setTransactions) + + def addTransactions(self, *Transactions): + for obj in Transactions: + obj.CashierShift = self + + def removeTransactions(self, *Transactions): + for obj in Transactions: + obj.CashierShift = None + + def getPointOfSale(self): + """Point of sale that is in operation during this shift. + """ + return self._PointOfSale + + def setPointOfSale(self, value): + if self._PointOfSale is not None: + filtered = [x for x in self.PointOfSale.CashierShifts if x != self] + self._PointOfSale._CashierShifts = filtered + + self._PointOfSale = value + if self._PointOfSale is not None: + if self not in self._PointOfSale._CashierShifts: + self._PointOfSale._CashierShifts.append(self) + + PointOfSale = property(getPointOfSale, setPointOfSale) + + def getReceipts(self): + """All Receipts recorded for this Shift. + """ + return self._Receipts + + def setReceipts(self, value): + for x in self._Receipts: + x.CashierShift = None + for y in value: + y._CashierShift = self + self._Receipts = value + + Receipts = property(getReceipts, setReceipts) + + def addReceipts(self, *Receipts): + for obj in Receipts: + obj.CashierShift = self + + def removeReceipts(self, *Receipts): + for obj in Receipts: + obj.CashierShift = None + + def getCashier(self): + """Cashier operating this shift. + """ + return self._Cashier + + def setCashier(self, value): + if self._Cashier is not None: + filtered = [x for x in self.Cashier.CashierShifts if x != self] + self._Cashier._CashierShifts = filtered + + self._Cashier = value + if self._Cashier is not None: + if self not in self._Cashier._CashierShifts: + self._Cashier._CashierShifts.append(self) + + Cashier = property(getCashier, setCashier) + diff --git a/CIM16/IEC61968/PaymentMetering/Charge.py b/CIM16/IEC61968/PaymentMetering/Charge.py new file mode 100755 index 00000000..c05f0116 --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/Charge.py @@ -0,0 +1,196 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Charge(IdentifiedObject): + """A charge element associated with other entities such as tariff structures, auxiliary agreements or other charge elements. The total charge amount applicable to this instance of charge is the sum of fixed and variable portion.A charge element associated with other entities such as tariff structures, auxiliary agreements or other charge elements. The total charge amount applicable to this instance of charge is the sum of fixed and variable portion. + """ + + def __init__(self, variablePortion=0.0, kind="other", ConsumptionTariffIntervals=None, TimeTariffIntervals=None, AuxiliaryAccounts=None, ChildCharges=None, fixedPortion=None, ParentCharge=None, *args, **kw_args): + """Initialises a new 'Charge' instance. + + @param variablePortion: The variable portion of this charge element, calculated as a percentage of the total amount of a parent charge. + @param kind: The kind of charge to be applied. Values are: "other", "demandCharge", "consumptionCharge", "auxiliaryCharge", "taxCharge" + @param ConsumptionTariffIntervals: Tariff intervals to which this consumption-based charge must be levied. + @param TimeTariffIntervals: Tariff intervals to which this time-based charge must be levied. + @param AuxiliaryAccounts: All auxiliary accounts to which this charge must be levied. + @param ChildCharges: All sub-components of this complex charge. + @param fixedPortion: The fixed portion of this charge element. + @param ParentCharge: Parent of this charge sub-component. + """ + #: The variable portion of this charge element, calculated as a percentage of the total amount of a parent charge. + self.variablePortion = variablePortion + + #: The kind of charge to be applied. Values are: "other", "demandCharge", "consumptionCharge", "auxiliaryCharge", "taxCharge" + self.kind = kind + + self._ConsumptionTariffIntervals = [] + self.ConsumptionTariffIntervals = [] if ConsumptionTariffIntervals is None else ConsumptionTariffIntervals + + self._TimeTariffIntervals = [] + self.TimeTariffIntervals = [] if TimeTariffIntervals is None else TimeTariffIntervals + + self._AuxiliaryAccounts = [] + self.AuxiliaryAccounts = [] if AuxiliaryAccounts is None else AuxiliaryAccounts + + self._ChildCharges = [] + self.ChildCharges = [] if ChildCharges is None else ChildCharges + + self.fixedPortion = fixedPortion + + self._ParentCharge = None + self.ParentCharge = ParentCharge + + super(Charge, self).__init__(*args, **kw_args) + + _attrs = ["variablePortion", "kind"] + _attr_types = {"variablePortion": float, "kind": str} + _defaults = {"variablePortion": 0.0, "kind": "other"} + _enums = {"kind": "ChargeKind"} + _refs = ["ConsumptionTariffIntervals", "TimeTariffIntervals", "AuxiliaryAccounts", "ChildCharges", "fixedPortion", "ParentCharge"] + _many_refs = ["ConsumptionTariffIntervals", "TimeTariffIntervals", "AuxiliaryAccounts", "ChildCharges"] + + def getConsumptionTariffIntervals(self): + """Tariff intervals to which this consumption-based charge must be levied. + """ + return self._ConsumptionTariffIntervals + + def setConsumptionTariffIntervals(self, value): + for p in self._ConsumptionTariffIntervals: + filtered = [q for q in p.Charges if q != self] + self._ConsumptionTariffIntervals._Charges = filtered + for r in value: + if self not in r._Charges: + r._Charges.append(self) + self._ConsumptionTariffIntervals = value + + ConsumptionTariffIntervals = property(getConsumptionTariffIntervals, setConsumptionTariffIntervals) + + def addConsumptionTariffIntervals(self, *ConsumptionTariffIntervals): + for obj in ConsumptionTariffIntervals: + if self not in obj._Charges: + obj._Charges.append(self) + self._ConsumptionTariffIntervals.append(obj) + + def removeConsumptionTariffIntervals(self, *ConsumptionTariffIntervals): + for obj in ConsumptionTariffIntervals: + if self in obj._Charges: + obj._Charges.remove(self) + self._ConsumptionTariffIntervals.remove(obj) + + def getTimeTariffIntervals(self): + """Tariff intervals to which this time-based charge must be levied. + """ + return self._TimeTariffIntervals + + def setTimeTariffIntervals(self, value): + for p in self._TimeTariffIntervals: + filtered = [q for q in p.Charges if q != self] + self._TimeTariffIntervals._Charges = filtered + for r in value: + if self not in r._Charges: + r._Charges.append(self) + self._TimeTariffIntervals = value + + TimeTariffIntervals = property(getTimeTariffIntervals, setTimeTariffIntervals) + + def addTimeTariffIntervals(self, *TimeTariffIntervals): + for obj in TimeTariffIntervals: + if self not in obj._Charges: + obj._Charges.append(self) + self._TimeTariffIntervals.append(obj) + + def removeTimeTariffIntervals(self, *TimeTariffIntervals): + for obj in TimeTariffIntervals: + if self in obj._Charges: + obj._Charges.remove(self) + self._TimeTariffIntervals.remove(obj) + + def getAuxiliaryAccounts(self): + """All auxiliary accounts to which this charge must be levied. + """ + return self._AuxiliaryAccounts + + def setAuxiliaryAccounts(self, value): + for p in self._AuxiliaryAccounts: + filtered = [q for q in p.Charges if q != self] + self._AuxiliaryAccounts._Charges = filtered + for r in value: + if self not in r._Charges: + r._Charges.append(self) + self._AuxiliaryAccounts = value + + AuxiliaryAccounts = property(getAuxiliaryAccounts, setAuxiliaryAccounts) + + def addAuxiliaryAccounts(self, *AuxiliaryAccounts): + for obj in AuxiliaryAccounts: + if self not in obj._Charges: + obj._Charges.append(self) + self._AuxiliaryAccounts.append(obj) + + def removeAuxiliaryAccounts(self, *AuxiliaryAccounts): + for obj in AuxiliaryAccounts: + if self in obj._Charges: + obj._Charges.remove(self) + self._AuxiliaryAccounts.remove(obj) + + def getChildCharges(self): + """All sub-components of this complex charge. + """ + return self._ChildCharges + + def setChildCharges(self, value): + for x in self._ChildCharges: + x.ParentCharge = None + for y in value: + y._ParentCharge = self + self._ChildCharges = value + + ChildCharges = property(getChildCharges, setChildCharges) + + def addChildCharges(self, *ChildCharges): + for obj in ChildCharges: + obj.ParentCharge = self + + def removeChildCharges(self, *ChildCharges): + for obj in ChildCharges: + obj.ParentCharge = None + + # The fixed portion of this charge element. + fixedPortion = None + + def getParentCharge(self): + """Parent of this charge sub-component. + """ + return self._ParentCharge + + def setParentCharge(self, value): + if self._ParentCharge is not None: + filtered = [x for x in self.ParentCharge.ChildCharges if x != self] + self._ParentCharge._ChildCharges = filtered + + self._ParentCharge = value + if self._ParentCharge is not None: + if self not in self._ParentCharge._ChildCharges: + self._ParentCharge._ChildCharges.append(self) + + ParentCharge = property(getParentCharge, setParentCharge) + diff --git a/CIM16/IEC61968/PaymentMetering/Cheque.py b/CIM16/IEC61968/PaymentMetering/Cheque.py new file mode 100755 index 00000000..6430d31d --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/Cheque.py @@ -0,0 +1,81 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class Cheque(Element): + """The actual tender when it is a type of cheque.The actual tender when it is a type of cheque. + """ + + def __init__(self, micrNumber='', chequeNumber='', date='', kind="other", Tender=None, bankAccountDetail=None, *args, **kw_args): + """Initialises a new 'Cheque' instance. + + @param micrNumber: The magnetic ink character recognition number printed on the cheque. + @param chequeNumber: Cheque reference number as printed on the cheque. + @param date: Date when cheque becomes valid. + @param kind: Kind of cheque. Values are: "other", "postalOrder", "bankOrder" + @param Tender: Payment tender the cheque is being used for. + @param bankAccountDetail: Details of the account holder and bank. + """ + #: The magnetic ink character recognition number printed on the cheque. + self.micrNumber = micrNumber + + #: Cheque reference number as printed on the cheque. + self.chequeNumber = chequeNumber + + #: Date when cheque becomes valid. + self.date = date + + #: Kind of cheque. Values are: "other", "postalOrder", "bankOrder" + self.kind = kind + + self._Tender = None + self.Tender = Tender + + self.bankAccountDetail = bankAccountDetail + + super(Cheque, self).__init__(*args, **kw_args) + + _attrs = ["micrNumber", "chequeNumber", "date", "kind"] + _attr_types = {"micrNumber": str, "chequeNumber": str, "date": str, "kind": str} + _defaults = {"micrNumber": '', "chequeNumber": '', "date": '', "kind": "other"} + _enums = {"kind": "ChequeKind"} + _refs = ["Tender", "bankAccountDetail"] + _many_refs = [] + + def getTender(self): + """Payment tender the cheque is being used for. + """ + return self._Tender + + def setTender(self, value): + if self._Tender is not None: + self._Tender._Cheque = None + + self._Tender = value + if self._Tender is not None: + self._Tender.Cheque = None + self._Tender._Cheque = self + + Tender = property(getTender, setTender) + + # Details of the account holder and bank. + bankAccountDetail = None + diff --git a/CIM16/IEC61968/PaymentMetering/ConsumptionTariffInterval.py b/CIM16/IEC61968/PaymentMetering/ConsumptionTariffInterval.py new file mode 100755 index 00000000..eab1aea5 --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/ConsumptionTariffInterval.py @@ -0,0 +1,143 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class ConsumptionTariffInterval(Element): + """One of a sequence of intervals defined in terms of consumption quantity of a service such as electricity, water, gas, etc. It is typically used in association with TariffProfile to define the steps or blocks in a step tariff structure, where startValue simultaneously defines the entry value of this step and the closing value of the previous step. Where consumption is >= startValue it falls within this interval and where consumption is < startValue it falls within the previous interval.One of a sequence of intervals defined in terms of consumption quantity of a service such as electricity, water, gas, etc. It is typically used in association with TariffProfile to define the steps or blocks in a step tariff structure, where startValue simultaneously defines the entry value of this step and the closing value of the previous step. Where consumption is >= startValue it falls within this interval and where consumption is < startValue it falls within the previous interval. + """ + + def __init__(self, startValue=0.0, sequenceNumber=0, Charges=None, TariffProfiles=None, TouTariffIntervals=None, *args, **kw_args): + """Initialises a new 'ConsumptionTariffInterval' instance. + + @param startValue: The lowest level of consumption that defines the starting point of this interval. The interval extends to the start of the next interval or until it is reset to the start of the first interval by TariffProfile.tariffCycle. + @param sequenceNumber: A sequential reference that defines the identity of this interval and its relative position with respect to other intervals in a sequence of intervals. + @param Charges: All charges used to define this consumption tariff interval. + @param TariffProfiles: All tariff profiles defined by this consumption tariff interval. + @param TouTariffIntervals: All time of use tariff intervals influenced by this consumption tariff interval. + """ + #: The lowest level of consumption that defines the starting point of this interval. The interval extends to the start of the next interval or until it is reset to the start of the first interval by TariffProfile.tariffCycle. + self.startValue = startValue + + #: A sequential reference that defines the identity of this interval and its relative position with respect to other intervals in a sequence of intervals. + self.sequenceNumber = sequenceNumber + + self._Charges = [] + self.Charges = [] if Charges is None else Charges + + self._TariffProfiles = [] + self.TariffProfiles = [] if TariffProfiles is None else TariffProfiles + + self._TouTariffIntervals = [] + self.TouTariffIntervals = [] if TouTariffIntervals is None else TouTariffIntervals + + super(ConsumptionTariffInterval, self).__init__(*args, **kw_args) + + _attrs = ["startValue", "sequenceNumber"] + _attr_types = {"startValue": float, "sequenceNumber": int} + _defaults = {"startValue": 0.0, "sequenceNumber": 0} + _enums = {} + _refs = ["Charges", "TariffProfiles", "TouTariffIntervals"] + _many_refs = ["Charges", "TariffProfiles", "TouTariffIntervals"] + + def getCharges(self): + """All charges used to define this consumption tariff interval. + """ + return self._Charges + + def setCharges(self, value): + for p in self._Charges: + filtered = [q for q in p.ConsumptionTariffIntervals if q != self] + self._Charges._ConsumptionTariffIntervals = filtered + for r in value: + if self not in r._ConsumptionTariffIntervals: + r._ConsumptionTariffIntervals.append(self) + self._Charges = value + + Charges = property(getCharges, setCharges) + + def addCharges(self, *Charges): + for obj in Charges: + if self not in obj._ConsumptionTariffIntervals: + obj._ConsumptionTariffIntervals.append(self) + self._Charges.append(obj) + + def removeCharges(self, *Charges): + for obj in Charges: + if self in obj._ConsumptionTariffIntervals: + obj._ConsumptionTariffIntervals.remove(self) + self._Charges.remove(obj) + + def getTariffProfiles(self): + """All tariff profiles defined by this consumption tariff interval. + """ + return self._TariffProfiles + + def setTariffProfiles(self, value): + for p in self._TariffProfiles: + filtered = [q for q in p.ConsumptionTariffIntervals if q != self] + self._TariffProfiles._ConsumptionTariffIntervals = filtered + for r in value: + if self not in r._ConsumptionTariffIntervals: + r._ConsumptionTariffIntervals.append(self) + self._TariffProfiles = value + + TariffProfiles = property(getTariffProfiles, setTariffProfiles) + + def addTariffProfiles(self, *TariffProfiles): + for obj in TariffProfiles: + if self not in obj._ConsumptionTariffIntervals: + obj._ConsumptionTariffIntervals.append(self) + self._TariffProfiles.append(obj) + + def removeTariffProfiles(self, *TariffProfiles): + for obj in TariffProfiles: + if self in obj._ConsumptionTariffIntervals: + obj._ConsumptionTariffIntervals.remove(self) + self._TariffProfiles.remove(obj) + + def getTouTariffIntervals(self): + """All time of use tariff intervals influenced by this consumption tariff interval. + """ + return self._TouTariffIntervals + + def setTouTariffIntervals(self, value): + for p in self._TouTariffIntervals: + filtered = [q for q in p.ConsumptionTariffIntervals if q != self] + self._TouTariffIntervals._ConsumptionTariffIntervals = filtered + for r in value: + if self not in r._ConsumptionTariffIntervals: + r._ConsumptionTariffIntervals.append(self) + self._TouTariffIntervals = value + + TouTariffIntervals = property(getTouTariffIntervals, setTouTariffIntervals) + + def addTouTariffIntervals(self, *TouTariffIntervals): + for obj in TouTariffIntervals: + if self not in obj._ConsumptionTariffIntervals: + obj._ConsumptionTariffIntervals.append(self) + self._TouTariffIntervals.append(obj) + + def removeTouTariffIntervals(self, *TouTariffIntervals): + for obj in TouTariffIntervals: + if self in obj._ConsumptionTariffIntervals: + obj._ConsumptionTariffIntervals.remove(self) + self._TouTariffIntervals.remove(obj) + diff --git a/CIM16/IEC61968/PaymentMetering/Due.py b/CIM16/IEC61968/PaymentMetering/Due.py new file mode 100755 index 00000000..b2131526 --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/Due.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class Due(object): + """Details on amounts due for an account.Details on amounts due for an account. + """ + + def __init__(self, interest=0.0, charges=0.0, principle=0.0, current=0.0, arrears=0.0): + """Initialises a new 'Due' instance. + + @param interest: Part of 'current' that constitutes the interest portion. + @param charges: Part of 'current' that constitutes the charge portion: 'charges' = 'Charge.fixedPortion' + 'Charge.variablePortion'. + @param principle: Part of 'current' that constitutes the portion of the principle amount currently due. + @param current: Current total amount now due: current = principle + arrears + interest + charges. Typically the rule for settlement priority is: interest dues, then arrears dues, then current dues, then charge dues. + @param arrears: Part of 'current' that constitutes the arrears portion. + """ + #: Part of 'current' that constitutes the interest portion. + self.interest = interest + + #: Part of 'current' that constitutes the charge portion: 'charges' = 'Charge.fixedPortion' + 'Charge.variablePortion'. + self.charges = charges + + #: Part of 'current' that constitutes the portion of the principle amount currently due. + self.principle = principle + + #: Current total amount now due: current = principle + arrears + interest + charges. Typically the rule for settlement priority is: interest dues, then arrears dues, then current dues, then charge dues. + self.current = current + + #: Part of 'current' that constitutes the arrears portion. + self.arrears = arrears + + + _attrs = ["interest", "charges", "principle", "current", "arrears"] + _attr_types = {"interest": float, "charges": float, "principle": float, "current": float, "arrears": float} + _defaults = {"interest": 0.0, "charges": 0.0, "principle": 0.0, "current": 0.0, "arrears": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/PaymentMetering/LineDetail.py b/CIM16/IEC61968/PaymentMetering/LineDetail.py new file mode 100755 index 00000000..071f8bce --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/LineDetail.py @@ -0,0 +1,53 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class LineDetail(object): + """Details on an amount line, with rounding, date and note.Details on an amount line, with rounding, date and note. + """ + + def __init__(self, amount=0.0, rounding=0.0, dateTime='', note=''): + """Initialises a new 'LineDetail' instance. + + @param amount: Amount for this line item. + @param rounding: Totalised monetary value of all errors due to process rounding or truncating that is not reflected in 'amount'. + @param dateTime: Date and time when this line was created in the application process. + @param note: Free format note relevant to this line. + """ + #: Amount for this line item. + self.amount = amount + + #: Totalised monetary value of all errors due to process rounding or truncating that is not reflected in 'amount'. + self.rounding = rounding + + #: Date and time when this line was created in the application process. + self.dateTime = dateTime + + #: Free format note relevant to this line. + self.note = note + + + _attrs = ["amount", "rounding", "dateTime", "note"] + _attr_types = {"amount": float, "rounding": float, "dateTime": str, "note": str} + _defaults = {"amount": 0.0, "rounding": 0.0, "dateTime": '', "note": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61968/PaymentMetering/MerchantAccount.py b/CIM16/IEC61968/PaymentMetering/MerchantAccount.py new file mode 100755 index 00000000..45f6597b --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/MerchantAccount.py @@ -0,0 +1,126 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class MerchantAccount(Document): + """The operating account controlled by merchant agreement, against which vendor may vend tokens or receipt payments. Transactions via vendor shift debit the account and bank deposits via bank statement credit the account.The operating account controlled by merchant agreement, against which vendor may vend tokens or receipt payments. Transactions via vendor shift debit the account and bank deposits via bank statement credit the account. + """ + + def __init__(self, currentBalance=0.0, provisionalBalance=0.0, MerchantAgreement=None, Transactors=None, VendorShifts=None, *args, **kw_args): + """Initialises a new 'MerchantAccount' instance. + + @param currentBalance: The current operating balance of this account. + @param provisionalBalance: The balance of this account after taking into account any pending debits from VendorShift.merchantDebitAmount and pending credits from BankStatement.merchantCreditAmount or credits (see also BankStatement attributes and VendorShift attributes). + @param MerchantAgreement: Merchant agreement that instantiated this merchant account. + @param Transactors: All transactors this merchant account is registered with. + @param VendorShifts: All vendor shifts that operate on this merchant account. + """ + #: The current operating balance of this account. + self.currentBalance = currentBalance + + #: The balance of this account after taking into account any pending debits from VendorShift.merchantDebitAmount and pending credits from BankStatement.merchantCreditAmount or credits (see also BankStatement attributes and VendorShift attributes). + self.provisionalBalance = provisionalBalance + + self._MerchantAgreement = None + self.MerchantAgreement = MerchantAgreement + + self._Transactors = [] + self.Transactors = [] if Transactors is None else Transactors + + self._VendorShifts = [] + self.VendorShifts = [] if VendorShifts is None else VendorShifts + + super(MerchantAccount, self).__init__(*args, **kw_args) + + _attrs = ["currentBalance", "provisionalBalance"] + _attr_types = {"currentBalance": float, "provisionalBalance": float} + _defaults = {"currentBalance": 0.0, "provisionalBalance": 0.0} + _enums = {} + _refs = ["MerchantAgreement", "Transactors", "VendorShifts"] + _many_refs = ["Transactors", "VendorShifts"] + + def getMerchantAgreement(self): + """Merchant agreement that instantiated this merchant account. + """ + return self._MerchantAgreement + + def setMerchantAgreement(self, value): + if self._MerchantAgreement is not None: + filtered = [x for x in self.MerchantAgreement.MerchantAccounts if x != self] + self._MerchantAgreement._MerchantAccounts = filtered + + self._MerchantAgreement = value + if self._MerchantAgreement is not None: + if self not in self._MerchantAgreement._MerchantAccounts: + self._MerchantAgreement._MerchantAccounts.append(self) + + MerchantAgreement = property(getMerchantAgreement, setMerchantAgreement) + + def getTransactors(self): + """All transactors this merchant account is registered with. + """ + return self._Transactors + + def setTransactors(self, value): + for p in self._Transactors: + filtered = [q for q in p.MerchantAccounts if q != self] + self._Transactors._MerchantAccounts = filtered + for r in value: + if self not in r._MerchantAccounts: + r._MerchantAccounts.append(self) + self._Transactors = value + + Transactors = property(getTransactors, setTransactors) + + def addTransactors(self, *Transactors): + for obj in Transactors: + if self not in obj._MerchantAccounts: + obj._MerchantAccounts.append(self) + self._Transactors.append(obj) + + def removeTransactors(self, *Transactors): + for obj in Transactors: + if self in obj._MerchantAccounts: + obj._MerchantAccounts.remove(self) + self._Transactors.remove(obj) + + def getVendorShifts(self): + """All vendor shifts that operate on this merchant account. + """ + return self._VendorShifts + + def setVendorShifts(self, value): + for x in self._VendorShifts: + x.MerchantAccount = None + for y in value: + y._MerchantAccount = self + self._VendorShifts = value + + VendorShifts = property(getVendorShifts, setVendorShifts) + + def addVendorShifts(self, *VendorShifts): + for obj in VendorShifts: + obj.MerchantAccount = self + + def removeVendorShifts(self, *VendorShifts): + for obj in VendorShifts: + obj.MerchantAccount = None + diff --git a/CIM16/IEC61968/PaymentMetering/MerchantAgreement.py b/CIM16/IEC61968/PaymentMetering/MerchantAgreement.py new file mode 100755 index 00000000..92a646ad --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/MerchantAgreement.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Agreement import Agreement + +class MerchantAgreement(Agreement): + """A formal controlling contractual agreement between supplier and merchant, in terms of which merchant is authorised to vend tokens and receipt payments on behalf of supplier. Merchant is accountable to supplier for revenue collected at point of sale.A formal controlling contractual agreement between supplier and merchant, in terms of which merchant is authorised to vend tokens and receipt payments on behalf of supplier. Merchant is accountable to supplier for revenue collected at point of sale. + """ + + def __init__(self, MerchantAccounts=None, *args, **kw_args): + """Initialises a new 'MerchantAgreement' instance. + + @param MerchantAccounts: All merchant accounts instantiated as a result of this merchant agreement. + """ + self._MerchantAccounts = [] + self.MerchantAccounts = [] if MerchantAccounts is None else MerchantAccounts + + super(MerchantAgreement, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["MerchantAccounts"] + _many_refs = ["MerchantAccounts"] + + def getMerchantAccounts(self): + """All merchant accounts instantiated as a result of this merchant agreement. + """ + return self._MerchantAccounts + + def setMerchantAccounts(self, value): + for x in self._MerchantAccounts: + x.MerchantAgreement = None + for y in value: + y._MerchantAgreement = self + self._MerchantAccounts = value + + MerchantAccounts = property(getMerchantAccounts, setMerchantAccounts) + + def addMerchantAccounts(self, *MerchantAccounts): + for obj in MerchantAccounts: + obj.MerchantAgreement = self + + def removeMerchantAccounts(self, *MerchantAccounts): + for obj in MerchantAccounts: + obj.MerchantAgreement = None + diff --git a/CIM16/IEC61968/PaymentMetering/PointOfSale.py b/CIM16/IEC61968/PaymentMetering/PointOfSale.py new file mode 100755 index 00000000..8565284a --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/PointOfSale.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PointOfSale(IdentifiedObject): + """Logical point where transactions take place with operational interaction between cashier and the payment system; in certain cases point of sale interacts directly with the end customer, in which case cashier might not be a real person: for example a self-service kiosk or over the internet.Logical point where transactions take place with operational interaction between cashier and the payment system; in certain cases point of sale interacts directly with the end customer, in which case cashier might not be a real person: for example a self-service kiosk or over the internet. + """ + + def __init__(self, location='', CashierShifts=None, *args, **kw_args): + """Initialises a new 'PointOfSale' instance. + + @param location: Local description for where this point of sale is physically located. + @param CashierShifts: All shifts this point of sale operated in. + """ + #: Local description for where this point of sale is physically located. + self.location = location + + self._CashierShifts = [] + self.CashierShifts = [] if CashierShifts is None else CashierShifts + + super(PointOfSale, self).__init__(*args, **kw_args) + + _attrs = ["location"] + _attr_types = {"location": str} + _defaults = {"location": ''} + _enums = {} + _refs = ["CashierShifts"] + _many_refs = ["CashierShifts"] + + def getCashierShifts(self): + """All shifts this point of sale operated in. + """ + return self._CashierShifts + + def setCashierShifts(self, value): + for x in self._CashierShifts: + x.PointOfSale = None + for y in value: + y._PointOfSale = self + self._CashierShifts = value + + CashierShifts = property(getCashierShifts, setCashierShifts) + + def addCashierShifts(self, *CashierShifts): + for obj in CashierShifts: + obj.PointOfSale = self + + def removeCashierShifts(self, *CashierShifts): + for obj in CashierShifts: + obj.PointOfSale = None + diff --git a/CIM16/IEC61968/PaymentMetering/Receipt.py b/CIM16/IEC61968/PaymentMetering/Receipt.py new file mode 100755 index 00000000..375723e9 --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/Receipt.py @@ -0,0 +1,143 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Receipt(IdentifiedObject): + """Record of total receipted payment from customer.Record of total receipted payment from customer. + """ + + def __init__(self, isBankable=False, VendorShift=None, line=None, CashierShift=None, Tenders=None, Transactions=None, *args, **kw_args): + """Initialises a new 'Receipt' instance. + + @param isBankable: True if this receipted payment is manually bankable, otherwise it is an electronic funds transfer. + @param VendorShift: Vendor shift during which this receipt was recorded. + @param line: Receipted amount with rounding, date and note. + @param CashierShift: Cashier shift during which this receipt was recorded. + @param Tenders: All payments received in the form of tenders recorded by this receipt. + @param Transactions: All transactions recorded for this receipted payment. + """ + #: True if this receipted payment is manually bankable, otherwise it is an electronic funds transfer. + self.isBankable = isBankable + + self._VendorShift = None + self.VendorShift = VendorShift + + self.line = line + + self._CashierShift = None + self.CashierShift = CashierShift + + self._Tenders = [] + self.Tenders = [] if Tenders is None else Tenders + + self._Transactions = [] + self.Transactions = [] if Transactions is None else Transactions + + super(Receipt, self).__init__(*args, **kw_args) + + _attrs = ["isBankable"] + _attr_types = {"isBankable": bool} + _defaults = {"isBankable": False} + _enums = {} + _refs = ["VendorShift", "line", "CashierShift", "Tenders", "Transactions"] + _many_refs = ["Tenders", "Transactions"] + + def getVendorShift(self): + """Vendor shift during which this receipt was recorded. + """ + return self._VendorShift + + def setVendorShift(self, value): + if self._VendorShift is not None: + filtered = [x for x in self.VendorShift.Receipts if x != self] + self._VendorShift._Receipts = filtered + + self._VendorShift = value + if self._VendorShift is not None: + if self not in self._VendorShift._Receipts: + self._VendorShift._Receipts.append(self) + + VendorShift = property(getVendorShift, setVendorShift) + + # Receipted amount with rounding, date and note. + line = None + + def getCashierShift(self): + """Cashier shift during which this receipt was recorded. + """ + return self._CashierShift + + def setCashierShift(self, value): + if self._CashierShift is not None: + filtered = [x for x in self.CashierShift.Receipts if x != self] + self._CashierShift._Receipts = filtered + + self._CashierShift = value + if self._CashierShift is not None: + if self not in self._CashierShift._Receipts: + self._CashierShift._Receipts.append(self) + + CashierShift = property(getCashierShift, setCashierShift) + + def getTenders(self): + """All payments received in the form of tenders recorded by this receipt. + """ + return self._Tenders + + def setTenders(self, value): + for x in self._Tenders: + x.Receipt = None + for y in value: + y._Receipt = self + self._Tenders = value + + Tenders = property(getTenders, setTenders) + + def addTenders(self, *Tenders): + for obj in Tenders: + obj.Receipt = self + + def removeTenders(self, *Tenders): + for obj in Tenders: + obj.Receipt = None + + def getTransactions(self): + """All transactions recorded for this receipted payment. + """ + return self._Transactions + + def setTransactions(self, value): + for x in self._Transactions: + x.Receipt = None + for y in value: + y._Receipt = self + self._Transactions = value + + Transactions = property(getTransactions, setTransactions) + + def addTransactions(self, *Transactions): + for obj in Transactions: + obj.Receipt = self + + def removeTransactions(self, *Transactions): + for obj in Transactions: + obj.Receipt = None + diff --git a/CIM16/IEC61968/PaymentMetering/ServiceSupplier.py b/CIM16/IEC61968/PaymentMetering/ServiceSupplier.py new file mode 100755 index 00000000..e98bb123 --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/ServiceSupplier.py @@ -0,0 +1,125 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Organisation import Organisation + +class ServiceSupplier(Organisation): + """Organisation that provides services to customers.Organisation that provides services to customers. + """ + + def __init__(self, issuerIdentificationNumber='', kind="other", BankAccounts=None, ServiceDeliveryPoints=None, CustomerAgreements=None, *args, **kw_args): + """Initialises a new 'ServiceSupplier' instance. + + @param issuerIdentificationNumber: Unique transaction reference prefix number issued to an entity by the International Standards Organisation for the purpose of tagging onto electronic financial transactions, as defined in ISO/IEC 7812-1 and ISO/IEC 7812-2. + @param kind: Kind of supplier. Values are: "other", "retailer", "utility" + @param BankAccounts: All BackAccounts this ServiceSupplier owns. + @param ServiceDeliveryPoints: All service delivery points this service supplier utilises to deliver a service. + @param CustomerAgreements: All customer agreements of this service supplier. + """ + #: Unique transaction reference prefix number issued to an entity by the International Standards Organisation for the purpose of tagging onto electronic financial transactions, as defined in ISO/IEC 7812-1 and ISO/IEC 7812-2. + self.issuerIdentificationNumber = issuerIdentificationNumber + + #: Kind of supplier. Values are: "other", "retailer", "utility" + self.kind = kind + + self._BankAccounts = [] + self.BankAccounts = [] if BankAccounts is None else BankAccounts + + self._ServiceDeliveryPoints = [] + self.ServiceDeliveryPoints = [] if ServiceDeliveryPoints is None else ServiceDeliveryPoints + + self._CustomerAgreements = [] + self.CustomerAgreements = [] if CustomerAgreements is None else CustomerAgreements + + super(ServiceSupplier, self).__init__(*args, **kw_args) + + _attrs = ["issuerIdentificationNumber", "kind"] + _attr_types = {"issuerIdentificationNumber": str, "kind": str} + _defaults = {"issuerIdentificationNumber": '', "kind": "other"} + _enums = {"kind": "SupplierKind"} + _refs = ["BankAccounts", "ServiceDeliveryPoints", "CustomerAgreements"] + _many_refs = ["BankAccounts", "ServiceDeliveryPoints", "CustomerAgreements"] + + def getBankAccounts(self): + """All BackAccounts this ServiceSupplier owns. + """ + return self._BankAccounts + + def setBankAccounts(self, value): + for x in self._BankAccounts: + x.ServiceSupplier = None + for y in value: + y._ServiceSupplier = self + self._BankAccounts = value + + BankAccounts = property(getBankAccounts, setBankAccounts) + + def addBankAccounts(self, *BankAccounts): + for obj in BankAccounts: + obj.ServiceSupplier = self + + def removeBankAccounts(self, *BankAccounts): + for obj in BankAccounts: + obj.ServiceSupplier = None + + def getServiceDeliveryPoints(self): + """All service delivery points this service supplier utilises to deliver a service. + """ + return self._ServiceDeliveryPoints + + def setServiceDeliveryPoints(self, value): + for x in self._ServiceDeliveryPoints: + x.ServiceSupplier = None + for y in value: + y._ServiceSupplier = self + self._ServiceDeliveryPoints = value + + ServiceDeliveryPoints = property(getServiceDeliveryPoints, setServiceDeliveryPoints) + + def addServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + obj.ServiceSupplier = self + + def removeServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + obj.ServiceSupplier = None + + def getCustomerAgreements(self): + """All customer agreements of this service supplier. + """ + return self._CustomerAgreements + + def setCustomerAgreements(self, value): + for x in self._CustomerAgreements: + x.ServiceSupplier = None + for y in value: + y._ServiceSupplier = self + self._CustomerAgreements = value + + CustomerAgreements = property(getCustomerAgreements, setCustomerAgreements) + + def addCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + obj.ServiceSupplier = self + + def removeCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + obj.ServiceSupplier = None + diff --git a/CIM16/IEC61968/PaymentMetering/Shift.py b/CIM16/IEC61968/PaymentMetering/Shift.py new file mode 100755 index 00000000..5282796d --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/Shift.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Shift(IdentifiedObject): + """Generally referring to a period of operation or work performed. Whether shift is open/closed can be derived from attributes 'activiryInterval.start' and 'activityInterval.end'. The grand total for receipts (i.e., cumulative total of all actual receipted amounts during this shift; bankable + non-bankable; excludes rounding error totals) can be derived from receipt: =sum(Receipt.receiptAmount) ; includes bankable and non-bankable receipts. Must also reconcile against: =sum(receiptsGrandTotalBankable + receiptsGrandTotalNonBankable). Must also reconcile against ReceiptSummary: =sum(ReceiptSummary.receiptsTotal). The attributes with 'GrandTotal' defined in this class may need to be used when the source data is periodically flushed from the system and then these cannot be derived.Generally referring to a period of operation or work performed. Whether shift is open/closed can be derived from attributes 'activiryInterval.start' and 'activityInterval.end'. The grand total for receipts (i.e., cumulative total of all actual receipted amounts during this shift; bankable + non-bankable; excludes rounding error totals) can be derived from receipt: =sum(Receipt.receiptAmount) ; includes bankable and non-bankable receipts. Must also reconcile against: =sum(receiptsGrandTotalBankable + receiptsGrandTotalNonBankable). Must also reconcile against ReceiptSummary: =sum(ReceiptSummary.receiptsTotal). The attributes with 'GrandTotal' defined in this class may need to be used when the source data is periodically flushed from the system and then these cannot be derived. + """ + + def __init__(self, transactionsGrandTotal=0.0, receiptsGrandTotalBankable=0.0, receiptsGrandTotalRounding=0.0, transactionsGrandTotalRounding=0.0, receiptsGrandTotalNonBankable=0.0, activityInterval=None, *args, **kw_args): + """Initialises a new 'Shift' instance. + + @param transactionsGrandTotal: Cumulative total of transacted amounts during this shift. Values are obtained from Transaction attributes: =sum(Transaction.transactionAmount). It must also reconcile against TransactionSummary: =sum(TransactionSummary.transactionsTotal). + @param receiptsGrandTotalBankable: Total of amounts receipted during this shift that can be manually banked (cash and cheques for example). Values are obtained from Receipt attributes: =sum(Receipt.receiptAmount) for all Receipt.bankable = true. + @param receiptsGrandTotalRounding: Cumulative amount in error due to process rounding not reflected in receiptsGrandTotal. Values are obtained from Receipt attributes: =sum(Receipt.receiptRounding). + @param transactionsGrandTotalRounding: Cumulative amount in error due to process rounding not reflected in transactionsGandTotal. Values are obtained from Transaction attributes: =sum(Transaction.transactionRounding). + @param receiptsGrandTotalNonBankable: Total of amounts receipted during this shift that cannot be manually banked (card payments for example). Values are obtained from Receipt attributes: =sum(Receipt.receiptAmount) for all Receipt.bankable = false. + @param activityInterval: Interval for activity of this shift. + """ + #: Cumulative total of transacted amounts during this shift. Values are obtained from Transaction attributes: =sum(Transaction.transactionAmount). It must also reconcile against TransactionSummary: =sum(TransactionSummary.transactionsTotal). + self.transactionsGrandTotal = transactionsGrandTotal + + #: Total of amounts receipted during this shift that can be manually banked (cash and cheques for example). Values are obtained from Receipt attributes: =sum(Receipt.receiptAmount) for all Receipt.bankable = true. + self.receiptsGrandTotalBankable = receiptsGrandTotalBankable + + #: Cumulative amount in error due to process rounding not reflected in receiptsGrandTotal. Values are obtained from Receipt attributes: =sum(Receipt.receiptRounding). + self.receiptsGrandTotalRounding = receiptsGrandTotalRounding + + #: Cumulative amount in error due to process rounding not reflected in transactionsGandTotal. Values are obtained from Transaction attributes: =sum(Transaction.transactionRounding). + self.transactionsGrandTotalRounding = transactionsGrandTotalRounding + + #: Total of amounts receipted during this shift that cannot be manually banked (card payments for example). Values are obtained from Receipt attributes: =sum(Receipt.receiptAmount) for all Receipt.bankable = false. + self.receiptsGrandTotalNonBankable = receiptsGrandTotalNonBankable + + self.activityInterval = activityInterval + + super(Shift, self).__init__(*args, **kw_args) + + _attrs = ["transactionsGrandTotal", "receiptsGrandTotalBankable", "receiptsGrandTotalRounding", "transactionsGrandTotalRounding", "receiptsGrandTotalNonBankable"] + _attr_types = {"transactionsGrandTotal": float, "receiptsGrandTotalBankable": float, "receiptsGrandTotalRounding": float, "transactionsGrandTotalRounding": float, "receiptsGrandTotalNonBankable": float} + _defaults = {"transactionsGrandTotal": 0.0, "receiptsGrandTotalBankable": 0.0, "receiptsGrandTotalRounding": 0.0, "transactionsGrandTotalRounding": 0.0, "receiptsGrandTotalNonBankable": 0.0} + _enums = {} + _refs = ["activityInterval"] + _many_refs = [] + + # Interval for activity of this shift. + activityInterval = None + diff --git a/CIM16/IEC61968/PaymentMetering/TariffProfile.py b/CIM16/IEC61968/PaymentMetering/TariffProfile.py new file mode 100755 index 00000000..56f81cbf --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/TariffProfile.py @@ -0,0 +1,139 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class TariffProfile(Document): + """A schedule of charges; structure associated with Tariff that allows the definition of complex tarif structures such as step and time of use when used in conjunction with TimeTariffInterval and Charge. Inherited 'status.value' is defined in the context of the utility's business rules, for example: active, inactive, etc.A schedule of charges; structure associated with Tariff that allows the definition of complex tarif structures such as step and time of use when used in conjunction with TimeTariffInterval and Charge. Inherited 'status.value' is defined in the context of the utility's business rules, for example: active, inactive, etc. + """ + + def __init__(self, tariffCycle='', Tariffs=None, ConsumptionTariffIntervals=None, TimeTariffIntervals=None, *args, **kw_args): + """Initialises a new 'TariffProfile' instance. + + @param tariffCycle: The frequency at which the tariff charge schedule is repeated Examples are: once off on a specified date and time; hourly; daily; weekly; monthly; 3-monthly; 6-monthly; 12-monthly; etc. At the end of each cycle, the business rules are reset to start from the beginning again. + @param Tariffs: All tariffs defined by this tariff profile. + @param ConsumptionTariffIntervals: All consumption tariff intervals used to define this tariff profile. + @param TimeTariffIntervals: All time tariff intervals used to define this tariff profile. + """ + #: The frequency at which the tariff charge schedule is repeated Examples are: once off on a specified date and time; hourly; daily; weekly; monthly; 3-monthly; 6-monthly; 12-monthly; etc. At the end of each cycle, the business rules are reset to start from the beginning again. + self.tariffCycle = tariffCycle + + self._Tariffs = [] + self.Tariffs = [] if Tariffs is None else Tariffs + + self._ConsumptionTariffIntervals = [] + self.ConsumptionTariffIntervals = [] if ConsumptionTariffIntervals is None else ConsumptionTariffIntervals + + self._TimeTariffIntervals = [] + self.TimeTariffIntervals = [] if TimeTariffIntervals is None else TimeTariffIntervals + + super(TariffProfile, self).__init__(*args, **kw_args) + + _attrs = ["tariffCycle"] + _attr_types = {"tariffCycle": str} + _defaults = {"tariffCycle": ''} + _enums = {} + _refs = ["Tariffs", "ConsumptionTariffIntervals", "TimeTariffIntervals"] + _many_refs = ["Tariffs", "ConsumptionTariffIntervals", "TimeTariffIntervals"] + + def getTariffs(self): + """All tariffs defined by this tariff profile. + """ + return self._Tariffs + + def setTariffs(self, value): + for p in self._Tariffs: + filtered = [q for q in p.TariffProfiles if q != self] + self._Tariffs._TariffProfiles = filtered + for r in value: + if self not in r._TariffProfiles: + r._TariffProfiles.append(self) + self._Tariffs = value + + Tariffs = property(getTariffs, setTariffs) + + def addTariffs(self, *Tariffs): + for obj in Tariffs: + if self not in obj._TariffProfiles: + obj._TariffProfiles.append(self) + self._Tariffs.append(obj) + + def removeTariffs(self, *Tariffs): + for obj in Tariffs: + if self in obj._TariffProfiles: + obj._TariffProfiles.remove(self) + self._Tariffs.remove(obj) + + def getConsumptionTariffIntervals(self): + """All consumption tariff intervals used to define this tariff profile. + """ + return self._ConsumptionTariffIntervals + + def setConsumptionTariffIntervals(self, value): + for p in self._ConsumptionTariffIntervals: + filtered = [q for q in p.TariffProfiles if q != self] + self._ConsumptionTariffIntervals._TariffProfiles = filtered + for r in value: + if self not in r._TariffProfiles: + r._TariffProfiles.append(self) + self._ConsumptionTariffIntervals = value + + ConsumptionTariffIntervals = property(getConsumptionTariffIntervals, setConsumptionTariffIntervals) + + def addConsumptionTariffIntervals(self, *ConsumptionTariffIntervals): + for obj in ConsumptionTariffIntervals: + if self not in obj._TariffProfiles: + obj._TariffProfiles.append(self) + self._ConsumptionTariffIntervals.append(obj) + + def removeConsumptionTariffIntervals(self, *ConsumptionTariffIntervals): + for obj in ConsumptionTariffIntervals: + if self in obj._TariffProfiles: + obj._TariffProfiles.remove(self) + self._ConsumptionTariffIntervals.remove(obj) + + def getTimeTariffIntervals(self): + """All time tariff intervals used to define this tariff profile. + """ + return self._TimeTariffIntervals + + def setTimeTariffIntervals(self, value): + for p in self._TimeTariffIntervals: + filtered = [q for q in p.TariffProfiles if q != self] + self._TimeTariffIntervals._TariffProfiles = filtered + for r in value: + if self not in r._TariffProfiles: + r._TariffProfiles.append(self) + self._TimeTariffIntervals = value + + TimeTariffIntervals = property(getTimeTariffIntervals, setTimeTariffIntervals) + + def addTimeTariffIntervals(self, *TimeTariffIntervals): + for obj in TimeTariffIntervals: + if self not in obj._TariffProfiles: + obj._TariffProfiles.append(self) + self._TimeTariffIntervals.append(obj) + + def removeTimeTariffIntervals(self, *TimeTariffIntervals): + for obj in TimeTariffIntervals: + if self in obj._TariffProfiles: + obj._TariffProfiles.remove(self) + self._TimeTariffIntervals.remove(obj) + diff --git a/CIM16/IEC61968/PaymentMetering/Tender.py b/CIM16/IEC61968/PaymentMetering/Tender.py new file mode 100755 index 00000000..264a5795 --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/Tender.py @@ -0,0 +1,112 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Tender(IdentifiedObject): + """Tender is what is 'offered' by the customer towards making a payment and is often more than the required payment (hence the need for 'change'). The payment is thus that part of the Tender that goes towards settlement of a particular transaction. Tender is modelled as an aggregation of Cheque and Card. Both these tender types can exist in a single tender bid thus 'accountHolderName' must exist separately in each of Cheque and Card as each could have a different account holder name.Tender is what is 'offered' by the customer towards making a payment and is often more than the required payment (hence the need for 'change'). The payment is thus that part of the Tender that goes towards settlement of a particular transaction. Tender is modelled as an aggregation of Cheque and Card. Both these tender types can exist in a single tender bid thus 'accountHolderName' must exist separately in each of Cheque and Card as each could have a different account holder name. + """ + + def __init__(self, kind="unspecified", change=0.0, amount=0.0, Card=None, Receipt=None, Cheque=None, *args, **kw_args): + """Initialises a new 'Tender' instance. + + @param kind: Kind of tender from customer. Values are: "unspecified", "cheque", "other", "cash", "card" + @param change: Difference between amount tendered by customer and the amount charged by point of sale. + @param amount: Amount tendered by customer. + @param Card: Card used to tender payment. + @param Receipt: Receipt that recorded this receiving of a payment in the form of tenders. + @param Cheque: Cheque used to tender payment. + """ + #: Kind of tender from customer. Values are: "unspecified", "cheque", "other", "cash", "card" + self.kind = kind + + #: Difference between amount tendered by customer and the amount charged by point of sale. + self.change = change + + #: Amount tendered by customer. + self.amount = amount + + self._Card = None + self.Card = Card + + self._Receipt = None + self.Receipt = Receipt + + self._Cheque = None + self.Cheque = Cheque + + super(Tender, self).__init__(*args, **kw_args) + + _attrs = ["kind", "change", "amount"] + _attr_types = {"kind": str, "change": float, "amount": float} + _defaults = {"kind": "unspecified", "change": 0.0, "amount": 0.0} + _enums = {"kind": "TenderKind"} + _refs = ["Card", "Receipt", "Cheque"] + _many_refs = [] + + def getCard(self): + """Card used to tender payment. + """ + return self._Card + + def setCard(self, value): + if self._Card is not None: + self._Card._Tender = None + + self._Card = value + if self._Card is not None: + self._Card.Tender = None + self._Card._Tender = self + + Card = property(getCard, setCard) + + def getReceipt(self): + """Receipt that recorded this receiving of a payment in the form of tenders. + """ + return self._Receipt + + def setReceipt(self, value): + if self._Receipt is not None: + filtered = [x for x in self.Receipt.Tenders if x != self] + self._Receipt._Tenders = filtered + + self._Receipt = value + if self._Receipt is not None: + if self not in self._Receipt._Tenders: + self._Receipt._Tenders.append(self) + + Receipt = property(getReceipt, setReceipt) + + def getCheque(self): + """Cheque used to tender payment. + """ + return self._Cheque + + def setCheque(self, value): + if self._Cheque is not None: + self._Cheque._Tender = None + + self._Cheque = value + if self._Cheque is not None: + self._Cheque.Tender = None + self._Cheque._Tender = self + + Cheque = property(getCheque, setCheque) + diff --git a/CIM16/IEC61968/PaymentMetering/TimeTariffInterval.py b/CIM16/IEC61968/PaymentMetering/TimeTariffInterval.py new file mode 100755 index 00000000..6a9b8463 --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/TimeTariffInterval.py @@ -0,0 +1,143 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class TimeTariffInterval(Element): + """One of a sequence of time intervals defined in terms of real time. It is typically used in association with TariffProfile to define the intervals in a time of use tariff structure, where startDateTime simultaneously determines the starting point of this interval and the ending point of the previous interval.One of a sequence of time intervals defined in terms of real time. It is typically used in association with TariffProfile to define the intervals in a time of use tariff structure, where startDateTime simultaneously determines the starting point of this interval and the ending point of the previous interval. + """ + + def __init__(self, startDateTime='', sequenceNumber=0, ConsumptionTariffIntervals=None, TariffProfiles=None, Charges=None, *args, **kw_args): + """Initialises a new 'TimeTariffInterval' instance. + + @param startDateTime: A real time marker that defines the starting time (typically it is the time of day) for this interval. The interval extends to the start of the next interval or until it is reset to the start of the first interval by TariffProfile.tariffCycle. + @param sequenceNumber: A sequential reference that defines the identity of this interval and its relative position with respect to other intervals in a sequence of intervals. + @param ConsumptionTariffIntervals: All consumption tariff intervals that introduce variation in this time of use tariff interval; allows to express e.g., peak hour prices that are different with different consumption blocks. + @param TariffProfiles: All tariff profiles defined by this time tariff interval. + @param Charges: All charges used to define this time tariff interval. + """ + #: A real time marker that defines the starting time (typically it is the time of day) for this interval. The interval extends to the start of the next interval or until it is reset to the start of the first interval by TariffProfile.tariffCycle. + self.startDateTime = startDateTime + + #: A sequential reference that defines the identity of this interval and its relative position with respect to other intervals in a sequence of intervals. + self.sequenceNumber = sequenceNumber + + self._ConsumptionTariffIntervals = [] + self.ConsumptionTariffIntervals = [] if ConsumptionTariffIntervals is None else ConsumptionTariffIntervals + + self._TariffProfiles = [] + self.TariffProfiles = [] if TariffProfiles is None else TariffProfiles + + self._Charges = [] + self.Charges = [] if Charges is None else Charges + + super(TimeTariffInterval, self).__init__(*args, **kw_args) + + _attrs = ["startDateTime", "sequenceNumber"] + _attr_types = {"startDateTime": str, "sequenceNumber": int} + _defaults = {"startDateTime": '', "sequenceNumber": 0} + _enums = {} + _refs = ["ConsumptionTariffIntervals", "TariffProfiles", "Charges"] + _many_refs = ["ConsumptionTariffIntervals", "TariffProfiles", "Charges"] + + def getConsumptionTariffIntervals(self): + """All consumption tariff intervals that introduce variation in this time of use tariff interval; allows to express e.g., peak hour prices that are different with different consumption blocks. + """ + return self._ConsumptionTariffIntervals + + def setConsumptionTariffIntervals(self, value): + for p in self._ConsumptionTariffIntervals: + filtered = [q for q in p.TouTariffIntervals if q != self] + self._ConsumptionTariffIntervals._TouTariffIntervals = filtered + for r in value: + if self not in r._TouTariffIntervals: + r._TouTariffIntervals.append(self) + self._ConsumptionTariffIntervals = value + + ConsumptionTariffIntervals = property(getConsumptionTariffIntervals, setConsumptionTariffIntervals) + + def addConsumptionTariffIntervals(self, *ConsumptionTariffIntervals): + for obj in ConsumptionTariffIntervals: + if self not in obj._TouTariffIntervals: + obj._TouTariffIntervals.append(self) + self._ConsumptionTariffIntervals.append(obj) + + def removeConsumptionTariffIntervals(self, *ConsumptionTariffIntervals): + for obj in ConsumptionTariffIntervals: + if self in obj._TouTariffIntervals: + obj._TouTariffIntervals.remove(self) + self._ConsumptionTariffIntervals.remove(obj) + + def getTariffProfiles(self): + """All tariff profiles defined by this time tariff interval. + """ + return self._TariffProfiles + + def setTariffProfiles(self, value): + for p in self._TariffProfiles: + filtered = [q for q in p.TimeTariffIntervals if q != self] + self._TariffProfiles._TimeTariffIntervals = filtered + for r in value: + if self not in r._TimeTariffIntervals: + r._TimeTariffIntervals.append(self) + self._TariffProfiles = value + + TariffProfiles = property(getTariffProfiles, setTariffProfiles) + + def addTariffProfiles(self, *TariffProfiles): + for obj in TariffProfiles: + if self not in obj._TimeTariffIntervals: + obj._TimeTariffIntervals.append(self) + self._TariffProfiles.append(obj) + + def removeTariffProfiles(self, *TariffProfiles): + for obj in TariffProfiles: + if self in obj._TimeTariffIntervals: + obj._TimeTariffIntervals.remove(self) + self._TariffProfiles.remove(obj) + + def getCharges(self): + """All charges used to define this time tariff interval. + """ + return self._Charges + + def setCharges(self, value): + for p in self._Charges: + filtered = [q for q in p.TimeTariffIntervals if q != self] + self._Charges._TimeTariffIntervals = filtered + for r in value: + if self not in r._TimeTariffIntervals: + r._TimeTariffIntervals.append(self) + self._Charges = value + + Charges = property(getCharges, setCharges) + + def addCharges(self, *Charges): + for obj in Charges: + if self not in obj._TimeTariffIntervals: + obj._TimeTariffIntervals.append(self) + self._Charges.append(obj) + + def removeCharges(self, *Charges): + for obj in Charges: + if self in obj._TimeTariffIntervals: + obj._TimeTariffIntervals.remove(self) + self._Charges.remove(obj) + diff --git a/CIM16/IEC61968/PaymentMetering/Transaction.py b/CIM16/IEC61968/PaymentMetering/Transaction.py new file mode 100755 index 00000000..51c909dd --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/Transaction.py @@ -0,0 +1,246 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Transaction(IdentifiedObject): + """The record of details of payment for service or token sale.The record of details of payment for service or token sale. + """ + + def __init__(self, donorReference='', kind="other", receiverReference='', serviceUnitsError=0.0, diverseReference='', serviceUnitsEnergy=0.0, reversedId='', PricingStructure=None, line=None, UserAttributes=None, AuxiliaryAccount=None, VendorShift=None, Receipt=None, Meter=None, CustomerAccount=None, CashierShift=None, *args, **kw_args): + """Initialises a new 'Transaction' instance. + + @param donorReference: Reference to the entity that is the source of 'amount' (for example: customer for token purchase; or supplier for free issue token). + @param kind: Kind of transaction. Values are: "other", "serviceChargePayment", "accountPayment", "tokenSalePayment", "tokenCancellation", "taxChargePayment", "tokenExchange", "tokenGrant", "diversePayment", "auxiliaryChargePayment", "meterConfigurationToken", "tokenFreeIssue", "transactionReversal" + @param receiverReference: Reference to the entity that is the recipient of 'amount' (for example, supplier for service charge payment; or tax receiver for VAT). + @param serviceUnitsError: Number of service units not reflected in 'serviceUnitsEnergy' due to process rounding or truncating errors. + @param diverseReference: Formal reference for use with diverse payment (traffic fine for example). + @param serviceUnitsEnergy: Actual amount of service units that is being paid for. + @param reversedId: (if 'kind' is transactionReversal) Reference to the original transaction that is being reversed by this transaction. + @param PricingStructure: Pricing structure applicable for this transaction. + @param line: Transaction amount, rounding, date and note for this transaction line. + @param UserAttributes: All snapshots of meter parameters recorded at the time of this transaction. Use 'name' and 'value.value' attributes to specify name and value of a parameter from meter. + @param AuxiliaryAccount: Auxiliary account for this payment transaction. + @param VendorShift: Vendor shift during which this transaction was recorded. + @param Receipt: The receipted payment for which this transaction has been recorded. + @param Meter: Meter for this vending transaction. + @param CustomerAccount: Customer account for this payment transaction. + @param CashierShift: Cashier shift during which this transaction was recorded. + """ + #: Reference to the entity that is the source of 'amount' (for example: customer for token purchase; or supplier for free issue token). + self.donorReference = donorReference + + #: Kind of transaction. Values are: "other", "serviceChargePayment", "accountPayment", "tokenSalePayment", "tokenCancellation", "taxChargePayment", "tokenExchange", "tokenGrant", "diversePayment", "auxiliaryChargePayment", "meterConfigurationToken", "tokenFreeIssue", "transactionReversal" + self.kind = kind + + #: Reference to the entity that is the recipient of 'amount' (for example, supplier for service charge payment; or tax receiver for VAT). + self.receiverReference = receiverReference + + #: Number of service units not reflected in 'serviceUnitsEnergy' due to process rounding or truncating errors. + self.serviceUnitsError = serviceUnitsError + + #: Formal reference for use with diverse payment (traffic fine for example). + self.diverseReference = diverseReference + + #: Actual amount of service units that is being paid for. + self.serviceUnitsEnergy = serviceUnitsEnergy + + #: (if 'kind' is transactionReversal) Reference to the original transaction that is being reversed by this transaction. + self.reversedId = reversedId + + self._PricingStructure = None + self.PricingStructure = PricingStructure + + self.line = line + + self._UserAttributes = [] + self.UserAttributes = [] if UserAttributes is None else UserAttributes + + self._AuxiliaryAccount = None + self.AuxiliaryAccount = AuxiliaryAccount + + self._VendorShift = None + self.VendorShift = VendorShift + + self._Receipt = None + self.Receipt = Receipt + + self._Meter = None + self.Meter = Meter + + self._CustomerAccount = None + self.CustomerAccount = CustomerAccount + + self._CashierShift = None + self.CashierShift = CashierShift + + super(Transaction, self).__init__(*args, **kw_args) + + _attrs = ["donorReference", "kind", "receiverReference", "serviceUnitsError", "diverseReference", "serviceUnitsEnergy", "reversedId"] + _attr_types = {"donorReference": str, "kind": str, "receiverReference": str, "serviceUnitsError": float, "diverseReference": str, "serviceUnitsEnergy": float, "reversedId": str} + _defaults = {"donorReference": '', "kind": "other", "receiverReference": '', "serviceUnitsError": 0.0, "diverseReference": '', "serviceUnitsEnergy": 0.0, "reversedId": ''} + _enums = {"kind": "TransactionKind"} + _refs = ["PricingStructure", "line", "UserAttributes", "AuxiliaryAccount", "VendorShift", "Receipt", "Meter", "CustomerAccount", "CashierShift"] + _many_refs = ["UserAttributes"] + + def getPricingStructure(self): + """Pricing structure applicable for this transaction. + """ + return self._PricingStructure + + def setPricingStructure(self, value): + if self._PricingStructure is not None: + filtered = [x for x in self.PricingStructure.Transactions if x != self] + self._PricingStructure._Transactions = filtered + + self._PricingStructure = value + if self._PricingStructure is not None: + if self not in self._PricingStructure._Transactions: + self._PricingStructure._Transactions.append(self) + + PricingStructure = property(getPricingStructure, setPricingStructure) + + # Transaction amount, rounding, date and note for this transaction line. + line = None + + def getUserAttributes(self): + """All snapshots of meter parameters recorded at the time of this transaction. Use 'name' and 'value.value' attributes to specify name and value of a parameter from meter. + """ + return self._UserAttributes + + def setUserAttributes(self, value): + for x in self._UserAttributes: + x.Transaction = None + for y in value: + y._Transaction = self + self._UserAttributes = value + + UserAttributes = property(getUserAttributes, setUserAttributes) + + def addUserAttributes(self, *UserAttributes): + for obj in UserAttributes: + obj.Transaction = self + + def removeUserAttributes(self, *UserAttributes): + for obj in UserAttributes: + obj.Transaction = None + + def getAuxiliaryAccount(self): + """Auxiliary account for this payment transaction. + """ + return self._AuxiliaryAccount + + def setAuxiliaryAccount(self, value): + if self._AuxiliaryAccount is not None: + filtered = [x for x in self.AuxiliaryAccount.PaymentTransactions if x != self] + self._AuxiliaryAccount._PaymentTransactions = filtered + + self._AuxiliaryAccount = value + if self._AuxiliaryAccount is not None: + if self not in self._AuxiliaryAccount._PaymentTransactions: + self._AuxiliaryAccount._PaymentTransactions.append(self) + + AuxiliaryAccount = property(getAuxiliaryAccount, setAuxiliaryAccount) + + def getVendorShift(self): + """Vendor shift during which this transaction was recorded. + """ + return self._VendorShift + + def setVendorShift(self, value): + if self._VendorShift is not None: + filtered = [x for x in self.VendorShift.Transactions if x != self] + self._VendorShift._Transactions = filtered + + self._VendorShift = value + if self._VendorShift is not None: + if self not in self._VendorShift._Transactions: + self._VendorShift._Transactions.append(self) + + VendorShift = property(getVendorShift, setVendorShift) + + def getReceipt(self): + """The receipted payment for which this transaction has been recorded. + """ + return self._Receipt + + def setReceipt(self, value): + if self._Receipt is not None: + filtered = [x for x in self.Receipt.Transactions if x != self] + self._Receipt._Transactions = filtered + + self._Receipt = value + if self._Receipt is not None: + if self not in self._Receipt._Transactions: + self._Receipt._Transactions.append(self) + + Receipt = property(getReceipt, setReceipt) + + def getMeter(self): + """Meter for this vending transaction. + """ + return self._Meter + + def setMeter(self, value): + if self._Meter is not None: + filtered = [x for x in self.Meter.VendingTransactions if x != self] + self._Meter._VendingTransactions = filtered + + self._Meter = value + if self._Meter is not None: + if self not in self._Meter._VendingTransactions: + self._Meter._VendingTransactions.append(self) + + Meter = property(getMeter, setMeter) + + def getCustomerAccount(self): + """Customer account for this payment transaction. + """ + return self._CustomerAccount + + def setCustomerAccount(self, value): + if self._CustomerAccount is not None: + filtered = [x for x in self.CustomerAccount.PaymentTransactions if x != self] + self._CustomerAccount._PaymentTransactions = filtered + + self._CustomerAccount = value + if self._CustomerAccount is not None: + if self not in self._CustomerAccount._PaymentTransactions: + self._CustomerAccount._PaymentTransactions.append(self) + + CustomerAccount = property(getCustomerAccount, setCustomerAccount) + + def getCashierShift(self): + """Cashier shift during which this transaction was recorded. + """ + return self._CashierShift + + def setCashierShift(self, value): + if self._CashierShift is not None: + filtered = [x for x in self.CashierShift.Transactions if x != self] + self._CashierShift._Transactions = filtered + + self._CashierShift = value + if self._CashierShift is not None: + if self not in self._CashierShift._Transactions: + self._CashierShift._Transactions.append(self) + + CashierShift = property(getCashierShift, setCashierShift) + diff --git a/CIM16/IEC61968/PaymentMetering/Transactor.py b/CIM16/IEC61968/PaymentMetering/Transactor.py new file mode 100755 index 00000000..c05da52b --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/Transactor.py @@ -0,0 +1,71 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Transactor(IdentifiedObject): + """The entity that ultimately executes the transaction and who is in control of the process; typically this is embodied in secure software running on a server that may employ secure hardware encryption devices for secure transaction processing.The entity that ultimately executes the transaction and who is in control of the process; typically this is embodied in secure software running on a server that may employ secure hardware encryption devices for secure transaction processing. + """ + + def __init__(self, MerchantAccounts=None, *args, **kw_args): + """Initialises a new 'Transactor' instance. + + @param MerchantAccounts: All merchant accounts registered with this transactor. + """ + self._MerchantAccounts = [] + self.MerchantAccounts = [] if MerchantAccounts is None else MerchantAccounts + + super(Transactor, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["MerchantAccounts"] + _many_refs = ["MerchantAccounts"] + + def getMerchantAccounts(self): + """All merchant accounts registered with this transactor. + """ + return self._MerchantAccounts + + def setMerchantAccounts(self, value): + for p in self._MerchantAccounts: + filtered = [q for q in p.Transactors if q != self] + self._MerchantAccounts._Transactors = filtered + for r in value: + if self not in r._Transactors: + r._Transactors.append(self) + self._MerchantAccounts = value + + MerchantAccounts = property(getMerchantAccounts, setMerchantAccounts) + + def addMerchantAccounts(self, *MerchantAccounts): + for obj in MerchantAccounts: + if self not in obj._Transactors: + obj._Transactors.append(self) + self._MerchantAccounts.append(obj) + + def removeMerchantAccounts(self, *MerchantAccounts): + for obj in MerchantAccounts: + if self in obj._Transactors: + obj._Transactors.remove(self) + self._MerchantAccounts.remove(obj) + diff --git a/CIM16/IEC61968/PaymentMetering/Vendor.py b/CIM16/IEC61968/PaymentMetering/Vendor.py new file mode 100755 index 00000000..637b63f1 --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/Vendor.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Vendor(IdentifiedObject): + """The entity that owns point of sale and contracts with cashier to receipt payments and vend tokens using the payment system. Vendor has a private contract with and is managed by merchant who is a type of organisation. Vendor is accountable to merchant for revenue collected, who is in turn accountable to supplier.The entity that owns point of sale and contracts with cashier to receipt payments and vend tokens using the payment system. Vendor has a private contract with and is managed by merchant who is a type of organisation. Vendor is accountable to merchant for revenue collected, who is in turn accountable to supplier. + """ + + def __init__(self, VendorShifts=None, *args, **kw_args): + """Initialises a new 'Vendor' instance. + + @param VendorShifts: All vendor shifts opened and owned by this vendor. + """ + self._VendorShifts = [] + self.VendorShifts = [] if VendorShifts is None else VendorShifts + + super(Vendor, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["VendorShifts"] + _many_refs = ["VendorShifts"] + + def getVendorShifts(self): + """All vendor shifts opened and owned by this vendor. + """ + return self._VendorShifts + + def setVendorShifts(self, value): + for x in self._VendorShifts: + x.Vendor = None + for y in value: + y._Vendor = self + self._VendorShifts = value + + VendorShifts = property(getVendorShifts, setVendorShifts) + + def addVendorShifts(self, *VendorShifts): + for obj in VendorShifts: + obj.Vendor = self + + def removeVendorShifts(self, *VendorShifts): + for obj in VendorShifts: + obj.Vendor = None + diff --git a/CIM16/IEC61968/PaymentMetering/VendorShift.py b/CIM16/IEC61968/PaymentMetering/VendorShift.py new file mode 100755 index 00000000..038c7b47 --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/VendorShift.py @@ -0,0 +1,139 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.PaymentMetering.Shift import Shift + +class VendorShift(Shift): + """The operating shift for a vendor during which he may transact against the merchant's account. It aggregates transactions and receipts during the shift and periodically debits a merchant account. The totals in VendorShift should always = sum of totals aggregated in all cashier shifts that were open under the particular vendor shift.The operating shift for a vendor during which he may transact against the merchant's account. It aggregates transactions and receipts during the shift and periodically debits a merchant account. The totals in VendorShift should always = sum of totals aggregated in all cashier shifts that were open under the particular vendor shift. + """ + + def __init__(self, merchantDebitAmount=0.0, posted=False, Vendor=None, Receipts=None, MerchantAccount=None, Transactions=None, *args, **kw_args): + """Initialises a new 'VendorShift' instance. + + @param merchantDebitAmount: The amount that is to be debited from the merchant account for this vendor shift. This amount reflects the sum(PaymentTransaction.transactionAmount). + @param posted: = true if merchantDebitAmount has been debited from MerchantAccount; typically happens at the end of VendorShift when it closes. + @param Vendor: Vendor that opens and owns this vendor shift. + @param Receipts: + @param MerchantAccount: Merchant account this vendor shift periodically debits (based on aggregated transactions). + @param Transactions: + """ + #: The amount that is to be debited from the merchant account for this vendor shift. This amount reflects the sum(PaymentTransaction.transactionAmount). + self.merchantDebitAmount = merchantDebitAmount + + #: = true if merchantDebitAmount has been debited from MerchantAccount; typically happens at the end of VendorShift when it closes. + self.posted = posted + + self._Vendor = None + self.Vendor = Vendor + + self._Receipts = [] + self.Receipts = [] if Receipts is None else Receipts + + self._MerchantAccount = None + self.MerchantAccount = MerchantAccount + + self._Transactions = [] + self.Transactions = [] if Transactions is None else Transactions + + super(VendorShift, self).__init__(*args, **kw_args) + + _attrs = ["merchantDebitAmount", "posted"] + _attr_types = {"merchantDebitAmount": float, "posted": bool} + _defaults = {"merchantDebitAmount": 0.0, "posted": False} + _enums = {} + _refs = ["Vendor", "Receipts", "MerchantAccount", "Transactions"] + _many_refs = ["Receipts", "Transactions"] + + def getVendor(self): + """Vendor that opens and owns this vendor shift. + """ + return self._Vendor + + def setVendor(self, value): + if self._Vendor is not None: + filtered = [x for x in self.Vendor.VendorShifts if x != self] + self._Vendor._VendorShifts = filtered + + self._Vendor = value + if self._Vendor is not None: + if self not in self._Vendor._VendorShifts: + self._Vendor._VendorShifts.append(self) + + Vendor = property(getVendor, setVendor) + + def getReceipts(self): + + return self._Receipts + + def setReceipts(self, value): + for x in self._Receipts: + x.VendorShift = None + for y in value: + y._VendorShift = self + self._Receipts = value + + Receipts = property(getReceipts, setReceipts) + + def addReceipts(self, *Receipts): + for obj in Receipts: + obj.VendorShift = self + + def removeReceipts(self, *Receipts): + for obj in Receipts: + obj.VendorShift = None + + def getMerchantAccount(self): + """Merchant account this vendor shift periodically debits (based on aggregated transactions). + """ + return self._MerchantAccount + + def setMerchantAccount(self, value): + if self._MerchantAccount is not None: + filtered = [x for x in self.MerchantAccount.VendorShifts if x != self] + self._MerchantAccount._VendorShifts = filtered + + self._MerchantAccount = value + if self._MerchantAccount is not None: + if self not in self._MerchantAccount._VendorShifts: + self._MerchantAccount._VendorShifts.append(self) + + MerchantAccount = property(getMerchantAccount, setMerchantAccount) + + def getTransactions(self): + + return self._Transactions + + def setTransactions(self, value): + for x in self._Transactions: + x.VendorShift = None + for y in value: + y._VendorShift = self + self._Transactions = value + + Transactions = property(getTransactions, setTransactions) + + def addTransactions(self, *Transactions): + for obj in Transactions: + obj.VendorShift = self + + def removeTransactions(self, *Transactions): + for obj in Transactions: + obj.VendorShift = None + diff --git a/CIM16/IEC61968/PaymentMetering/__init__.py b/CIM16/IEC61968/PaymentMetering/__init__.py new file mode 100755 index 00000000..dec40182 --- /dev/null +++ b/CIM16/IEC61968/PaymentMetering/__init__.py @@ -0,0 +1,78 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package is an extension of the Metering package and contains the information classes that support specialised applications such as prepayment metering. These classes are generally associated with the collection and control of revenue from the customer for a delivered service. +""" + +from CIM16.IEC61968.PaymentMetering.VendorShift import VendorShift +from CIM16.IEC61968.PaymentMetering.Transactor import Transactor +from CIM16.IEC61968.PaymentMetering.CashierShift import CashierShift +from CIM16.IEC61968.PaymentMetering.TariffProfile import TariffProfile +from CIM16.IEC61968.PaymentMetering.AccountingUnit import AccountingUnit +from CIM16.IEC61968.PaymentMetering.Transaction import Transaction +from CIM16.IEC61968.PaymentMetering.TimeTariffInterval import TimeTariffInterval +from CIM16.IEC61968.PaymentMetering.Charge import Charge +from CIM16.IEC61968.PaymentMetering.AuxiliaryAgreement import AuxiliaryAgreement +from CIM16.IEC61968.PaymentMetering.Tender import Tender +from CIM16.IEC61968.PaymentMetering.ServiceSupplier import ServiceSupplier +from CIM16.IEC61968.PaymentMetering.MerchantAgreement import MerchantAgreement +from CIM16.IEC61968.PaymentMetering.LineDetail import LineDetail +from CIM16.IEC61968.PaymentMetering.ConsumptionTariffInterval import ConsumptionTariffInterval +from CIM16.IEC61968.PaymentMetering.Vendor import Vendor +from CIM16.IEC61968.PaymentMetering.Cheque import Cheque +from CIM16.IEC61968.PaymentMetering.AccountMovement import AccountMovement +from CIM16.IEC61968.PaymentMetering.Shift import Shift +from CIM16.IEC61968.PaymentMetering.Receipt import Receipt +from CIM16.IEC61968.PaymentMetering.Due import Due +from CIM16.IEC61968.PaymentMetering.BankAccountDetail import BankAccountDetail +from CIM16.IEC61968.PaymentMetering.AuxiliaryAccount import AuxiliaryAccount +from CIM16.IEC61968.PaymentMetering.Cashier import Cashier +from CIM16.IEC61968.PaymentMetering.Card import Card +from CIM16.IEC61968.PaymentMetering.MerchantAccount import MerchantAccount +from CIM16.IEC61968.PaymentMetering.PointOfSale import PointOfSale + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#PaymentMetering" +nsPrefix = "cimPaymentMetering" + + +class TenderKind(str): + """Values are: unspecified, cheque, other, cash, card + """ + pass + +class ChequeKind(str): + """Values are: other, postalOrder, bankOrder + """ + pass + +class ChargeKind(str): + """Values are: other, demandCharge, consumptionCharge, auxiliaryCharge, taxCharge + """ + pass + +class TransactionKind(str): + """Values are: other, serviceChargePayment, accountPayment, tokenSalePayment, tokenCancellation, taxChargePayment, tokenExchange, tokenGrant, diversePayment, auxiliaryChargePayment, meterConfigurationToken, tokenFreeIssue, transactionReversal + """ + pass + +class SupplierKind(str): + """Values are: other, retailer, utility + """ + pass diff --git a/CIM16/IEC61968/Work/Work.py b/CIM16/IEC61968/Work/Work.py new file mode 100755 index 00000000..032a9a02 --- /dev/null +++ b/CIM16/IEC61968/Work/Work.py @@ -0,0 +1,289 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class Work(Document): + """Document used to request, initiate, track and record work. This is synonymous with work breakdown structure (WBS), which is traversed through the (currently informative) recursive association of Work. Note that the work name is equal to the WBS name, which is given in the inherited 'name' attribute.Document used to request, initiate, track and record work. This is synonymous with work breakdown structure (WBS), which is traversed through the (currently informative) recursive association of Work. Note that the work name is equal to the WBS name, which is given in the inherited 'name' attribute. + """ + + def __init__(self, kind="disconnect", priority='', requestDateTime='', Designs=None, WorkCostDetails=None, ErpProjectAccounting=None, Project=None, WorkFlowSteps=None, WorkTasks=None, BusinessCase=None, WorkBillingInfo=None, Request=None, Customers=None, *args, **kw_args): + """Initialises a new 'Work' instance. + + @param kind: Kind of work. Values are: "disconnect", "other", "reconnect", "construction", "service", "meter", "inspection", "maintenance" + @param priority: Priority of work. + @param requestDateTime: Date and time work was requested. + @param Designs: + @param WorkCostDetails: + @param ErpProjectAccounting: + @param Project: + @param WorkFlowSteps: + @param WorkTasks: + @param BusinessCase: + @param WorkBillingInfo: + @param Request: + @param Customers: All the customers for which this work is performed. + """ + #: Kind of work. Values are: "disconnect", "other", "reconnect", "construction", "service", "meter", "inspection", "maintenance" + self.kind = kind + + #: Priority of work. + self.priority = priority + + #: Date and time work was requested. + self.requestDateTime = requestDateTime + + self._Designs = [] + self.Designs = [] if Designs is None else Designs + + self._WorkCostDetails = [] + self.WorkCostDetails = [] if WorkCostDetails is None else WorkCostDetails + + self._ErpProjectAccounting = None + self.ErpProjectAccounting = ErpProjectAccounting + + self._Project = None + self.Project = Project + + self._WorkFlowSteps = [] + self.WorkFlowSteps = [] if WorkFlowSteps is None else WorkFlowSteps + + self._WorkTasks = [] + self.WorkTasks = [] if WorkTasks is None else WorkTasks + + self._BusinessCase = None + self.BusinessCase = BusinessCase + + self._WorkBillingInfo = None + self.WorkBillingInfo = WorkBillingInfo + + self._Request = None + self.Request = Request + + self._Customers = [] + self.Customers = [] if Customers is None else Customers + + super(Work, self).__init__(*args, **kw_args) + + _attrs = ["kind", "priority", "requestDateTime"] + _attr_types = {"kind": str, "priority": str, "requestDateTime": str} + _defaults = {"kind": "disconnect", "priority": '', "requestDateTime": ''} + _enums = {"kind": "WorkKind"} + _refs = ["Designs", "WorkCostDetails", "ErpProjectAccounting", "Project", "WorkFlowSteps", "WorkTasks", "BusinessCase", "WorkBillingInfo", "Request", "Customers"] + _many_refs = ["Designs", "WorkCostDetails", "WorkFlowSteps", "WorkTasks", "Customers"] + + def getDesigns(self): + + return self._Designs + + def setDesigns(self, value): + for x in self._Designs: + x.Work = None + for y in value: + y._Work = self + self._Designs = value + + Designs = property(getDesigns, setDesigns) + + def addDesigns(self, *Designs): + for obj in Designs: + obj.Work = self + + def removeDesigns(self, *Designs): + for obj in Designs: + obj.Work = None + + def getWorkCostDetails(self): + + return self._WorkCostDetails + + def setWorkCostDetails(self, value): + for p in self._WorkCostDetails: + filtered = [q for q in p.Works if q != self] + self._WorkCostDetails._Works = filtered + for r in value: + if self not in r._Works: + r._Works.append(self) + self._WorkCostDetails = value + + WorkCostDetails = property(getWorkCostDetails, setWorkCostDetails) + + def addWorkCostDetails(self, *WorkCostDetails): + for obj in WorkCostDetails: + if self not in obj._Works: + obj._Works.append(self) + self._WorkCostDetails.append(obj) + + def removeWorkCostDetails(self, *WorkCostDetails): + for obj in WorkCostDetails: + if self in obj._Works: + obj._Works.remove(self) + self._WorkCostDetails.remove(obj) + + def getErpProjectAccounting(self): + + return self._ErpProjectAccounting + + def setErpProjectAccounting(self, value): + if self._ErpProjectAccounting is not None: + filtered = [x for x in self.ErpProjectAccounting.Works if x != self] + self._ErpProjectAccounting._Works = filtered + + self._ErpProjectAccounting = value + if self._ErpProjectAccounting is not None: + if self not in self._ErpProjectAccounting._Works: + self._ErpProjectAccounting._Works.append(self) + + ErpProjectAccounting = property(getErpProjectAccounting, setErpProjectAccounting) + + def getProject(self): + + return self._Project + + def setProject(self, value): + if self._Project is not None: + filtered = [x for x in self.Project.Works if x != self] + self._Project._Works = filtered + + self._Project = value + if self._Project is not None: + if self not in self._Project._Works: + self._Project._Works.append(self) + + Project = property(getProject, setProject) + + def getWorkFlowSteps(self): + + return self._WorkFlowSteps + + def setWorkFlowSteps(self, value): + for x in self._WorkFlowSteps: + x.Work = None + for y in value: + y._Work = self + self._WorkFlowSteps = value + + WorkFlowSteps = property(getWorkFlowSteps, setWorkFlowSteps) + + def addWorkFlowSteps(self, *WorkFlowSteps): + for obj in WorkFlowSteps: + obj.Work = self + + def removeWorkFlowSteps(self, *WorkFlowSteps): + for obj in WorkFlowSteps: + obj.Work = None + + def getWorkTasks(self): + + return self._WorkTasks + + def setWorkTasks(self, value): + for x in self._WorkTasks: + x.Work = None + for y in value: + y._Work = self + self._WorkTasks = value + + WorkTasks = property(getWorkTasks, setWorkTasks) + + def addWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + obj.Work = self + + def removeWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + obj.Work = None + + def getBusinessCase(self): + + return self._BusinessCase + + def setBusinessCase(self, value): + if self._BusinessCase is not None: + filtered = [x for x in self.BusinessCase.Works if x != self] + self._BusinessCase._Works = filtered + + self._BusinessCase = value + if self._BusinessCase is not None: + if self not in self._BusinessCase._Works: + self._BusinessCase._Works.append(self) + + BusinessCase = property(getBusinessCase, setBusinessCase) + + def getWorkBillingInfo(self): + + return self._WorkBillingInfo + + def setWorkBillingInfo(self, value): + if self._WorkBillingInfo is not None: + filtered = [x for x in self.WorkBillingInfo.Works if x != self] + self._WorkBillingInfo._Works = filtered + + self._WorkBillingInfo = value + if self._WorkBillingInfo is not None: + if self not in self._WorkBillingInfo._Works: + self._WorkBillingInfo._Works.append(self) + + WorkBillingInfo = property(getWorkBillingInfo, setWorkBillingInfo) + + def getRequest(self): + + return self._Request + + def setRequest(self, value): + if self._Request is not None: + filtered = [x for x in self.Request.Works if x != self] + self._Request._Works = filtered + + self._Request = value + if self._Request is not None: + if self not in self._Request._Works: + self._Request._Works.append(self) + + Request = property(getRequest, setRequest) + + def getCustomers(self): + """All the customers for which this work is performed. + """ + return self._Customers + + def setCustomers(self, value): + for p in self._Customers: + filtered = [q for q in p.Works if q != self] + self._Customers._Works = filtered + for r in value: + if self not in r._Works: + r._Works.append(self) + self._Customers = value + + Customers = property(getCustomers, setCustomers) + + def addCustomers(self, *Customers): + for obj in Customers: + if self not in obj._Works: + obj._Works.append(self) + self._Customers.append(obj) + + def removeCustomers(self, *Customers): + for obj in Customers: + if self in obj._Works: + obj._Works.remove(self) + self._Customers.remove(obj) + diff --git a/CIM16/IEC61968/Work/__init__.py b/CIM16/IEC61968/Work/__init__.py new file mode 100755 index 00000000..7e048c52 --- /dev/null +++ b/CIM16/IEC61968/Work/__init__.py @@ -0,0 +1,33 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package contains the core information classes that support work management and network extension planning applications. +""" + +from CIM16.IEC61968.Work.Work import Work + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Work" +nsPrefix = "cimWork" + + +class WorkKind(str): + """Values are: disconnect, other, reconnect, construction, service, meter, inspection, maintenance + """ + pass diff --git a/CIM16/IEC61968/__init__.py b/CIM16/IEC61968/__init__.py new file mode 100755 index 00000000..f8adcadb --- /dev/null +++ b/CIM16/IEC61968/__init__.py @@ -0,0 +1,28 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package is an extension of the Metering package and contains the information classes that support specialised applications such as prepayment metering. These classes are generally associated with the collection and control of revenue from the customer for a delivered service. +""" + +from CIM16.IEC61968.IEC61968CIMVersion import IEC61968CIMVersion + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#IEC61968" +nsPrefix = "cimIEC61968" + diff --git a/CIM16/IEC61970/AuxiliaryEquipment/AuxiliaryEquipment.py b/CIM16/IEC61970/AuxiliaryEquipment/AuxiliaryEquipment.py new file mode 100755 index 00000000..0462bf7b --- /dev/null +++ b/CIM16/IEC61970/AuxiliaryEquipment/AuxiliaryEquipment.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Equipment import Equipment + +class AuxiliaryEquipment(Equipment): + """AuxiliaryEquipment describe equipment that is not performing any primary functions but support for the equipment performing the primary function. AuxiliaryEquipment is attached to primary eqipment via an association with Terminal.AuxiliaryEquipment describe equipment that is not performing any primary functions but support for the equipment performing the primary function. AuxiliaryEquipment is attached to primary eqipment via an association with Terminal. + """ + + def __init__(self, Terminal=None, *args, **kw_args): + """Initialises a new 'AuxiliaryEquipment' instance. + + @param Terminal: The Terminal at the equipment where the AuxiliaryEquipment is attached. + """ + self._Terminal = None + self.Terminal = Terminal + + super(AuxiliaryEquipment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Terminal"] + _many_refs = [] + + def getTerminal(self): + """The Terminal at the equipment where the AuxiliaryEquipment is attached. + """ + return self._Terminal + + def setTerminal(self, value): + if self._Terminal is not None: + filtered = [x for x in self.Terminal.AuxiliaryEquipment if x != self] + self._Terminal._AuxiliaryEquipment = filtered + + self._Terminal = value + if self._Terminal is not None: + if self not in self._Terminal._AuxiliaryEquipment: + self._Terminal._AuxiliaryEquipment.append(self) + + Terminal = property(getTerminal, setTerminal) + diff --git a/CIM16/IEC61970/AuxiliaryEquipment/CurrentTransformer.py b/CIM16/IEC61970/AuxiliaryEquipment/CurrentTransformer.py new file mode 100755 index 00000000..e9c26336 --- /dev/null +++ b/CIM16/IEC61970/AuxiliaryEquipment/CurrentTransformer.py @@ -0,0 +1,84 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.AuxiliaryEquipment.Sensor import Sensor + +class CurrentTransformer(Sensor): + """Instrument transformer used to measure electrical qualities of the circuit that is being protected and/or monitored. Typically used as current transducer for the purpose of metering or protection. A typical secondary current rating would be 5A.Instrument transformer used to measure electrical qualities of the circuit that is being protected and/or monitored. Typically used as current transducer for the purpose of metering or protection. A typical secondary current rating would be 5A. + """ + + def __init__(self, ctClass='', accuracyLimit='', usage='', accuracyClass='', coreCount=0, maxRatio=0.0, CTInfo=None, *args, **kw_args): + """Initialises a new 'CurrentTransformer' instance. + + @param ctClass: CT classification; i.e. class 10P. + @param accuracyLimit: Percent of rated current for which the CT remains accurate within specified limits. + @param usage: Intended usage of the CT; i.e. metering, protection. + @param accuracyClass: CT accuracy classification. + @param coreCount: Number of cores. + @param maxRatio: For multi-ratio CT's, the maximum permissable ratio attainable. + @param CTInfo: Current transformer data. + """ + #: CT classification; i.e. class 10P. + self.ctClass = ctClass + + #: Percent of rated current for which the CT remains accurate within specified limits. + self.accuracyLimit = accuracyLimit + + #: Intended usage of the CT; i.e. metering, protection. + self.usage = usage + + #: CT accuracy classification. + self.accuracyClass = accuracyClass + + #: Number of cores. + self.coreCount = coreCount + + #: For multi-ratio CT's, the maximum permissable ratio attainable. + self.maxRatio = maxRatio + + self._CTInfo = None + self.CTInfo = CTInfo + + super(CurrentTransformer, self).__init__(*args, **kw_args) + + _attrs = ["ctClass", "accuracyLimit", "usage", "accuracyClass", "coreCount", "maxRatio"] + _attr_types = {"ctClass": str, "accuracyLimit": str, "usage": str, "accuracyClass": str, "coreCount": int, "maxRatio": float} + _defaults = {"ctClass": '', "accuracyLimit": '', "usage": '', "accuracyClass": '', "coreCount": 0, "maxRatio": 0.0} + _enums = {} + _refs = ["CTInfo"] + _many_refs = [] + + def getCTInfo(self): + """Current transformer data. + """ + return self._CTInfo + + def setCTInfo(self, value): + if self._CTInfo is not None: + filtered = [x for x in self.CTInfo.CTs if x != self] + self._CTInfo._CTs = filtered + + self._CTInfo = value + if self._CTInfo is not None: + if self not in self._CTInfo._CTs: + self._CTInfo._CTs.append(self) + + CTInfo = property(getCTInfo, setCTInfo) + diff --git a/CIM16/IEC61970/AuxiliaryEquipment/FaultIndicator.py b/CIM16/IEC61970/AuxiliaryEquipment/FaultIndicator.py new file mode 100755 index 00000000..0dce554c --- /dev/null +++ b/CIM16/IEC61970/AuxiliaryEquipment/FaultIndicator.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.AuxiliaryEquipment.AuxiliaryEquipment import AuxiliaryEquipment + +class FaultIndicator(AuxiliaryEquipment): + """A FaultIndicator is typically only an indicator (which may or may not be remotely monitored), and not a piece of equipment that actually initiates a protection event. It is used for FLISR (Fault Location, Isolation and Restoration) purposes, assisting with the dispatch of crews to 'most likely' part of the network (i.e. assists with determining circuit section where the fault most likely happened).A FaultIndicator is typically only an indicator (which may or may not be remotely monitored), and not a piece of equipment that actually initiates a protection event. It is used for FLISR (Fault Location, Isolation and Restoration) purposes, assisting with the dispatch of crews to 'most likely' part of the network (i.e. assists with determining circuit section where the fault most likely happened). + """ + + def __init__(self, FaultIndicatorInfo=None, *args, **kw_args): + """Initialises a new 'FaultIndicator' instance. + + @param FaultIndicatorInfo: Fault indicator data. + """ + self._FaultIndicatorInfo = None + self.FaultIndicatorInfo = FaultIndicatorInfo + + super(FaultIndicator, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["FaultIndicatorInfo"] + _many_refs = [] + + def getFaultIndicatorInfo(self): + """Fault indicator data. + """ + return self._FaultIndicatorInfo + + def setFaultIndicatorInfo(self, value): + if self._FaultIndicatorInfo is not None: + filtered = [x for x in self.FaultIndicatorInfo.FaultIndicators if x != self] + self._FaultIndicatorInfo._FaultIndicators = filtered + + self._FaultIndicatorInfo = value + if self._FaultIndicatorInfo is not None: + if self not in self._FaultIndicatorInfo._FaultIndicators: + self._FaultIndicatorInfo._FaultIndicators.append(self) + + FaultIndicatorInfo = property(getFaultIndicatorInfo, setFaultIndicatorInfo) + diff --git a/CIM16/IEC61970/AuxiliaryEquipment/PotentialTransformer.py b/CIM16/IEC61970/AuxiliaryEquipment/PotentialTransformer.py new file mode 100755 index 00000000..841be65a --- /dev/null +++ b/CIM16/IEC61970/AuxiliaryEquipment/PotentialTransformer.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.AuxiliaryEquipment.Sensor import Sensor + +class PotentialTransformer(Sensor): + """Instrument transformer (also known as Voltage Transformer) used to measure electrical qualities of the circuit that is being protected and/or monitored. Typically used as voltage transducer for the purpose of metering, protection, or sometimes auxiliary substation supply. A typical secondary voltage rating would be 120V.Instrument transformer (also known as Voltage Transformer) used to measure electrical qualities of the circuit that is being protected and/or monitored. Typically used as voltage transducer for the purpose of metering, protection, or sometimes auxiliary substation supply. A typical secondary voltage rating would be 120V. + """ + + def __init__(self, nominalRatio=0.0, accuracyClass='', ptClass='', PTInfo=None, *args, **kw_args): + """Initialises a new 'PotentialTransformer' instance. + + @param nominalRatio: Nominal ratio between the primary and secondary voltage. + @param accuracyClass: PT accuracy classification. + @param ptClass: PT classification. + @param PTInfo: Potential (voltage) transformer data. + """ + #: Nominal ratio between the primary and secondary voltage. + self.nominalRatio = nominalRatio + + #: PT accuracy classification. + self.accuracyClass = accuracyClass + + #: PT classification. + self.ptClass = ptClass + + self._PTInfo = None + self.PTInfo = PTInfo + + super(PotentialTransformer, self).__init__(*args, **kw_args) + + _attrs = ["nominalRatio", "accuracyClass", "ptClass"] + _attr_types = {"nominalRatio": float, "accuracyClass": str, "ptClass": str} + _defaults = {"nominalRatio": 0.0, "accuracyClass": '', "ptClass": ''} + _enums = {} + _refs = ["PTInfo"] + _many_refs = [] + + def getPTInfo(self): + """Potential (voltage) transformer data. + """ + return self._PTInfo + + def setPTInfo(self, value): + if self._PTInfo is not None: + filtered = [x for x in self.PTInfo.PTs if x != self] + self._PTInfo._PTs = filtered + + self._PTInfo = value + if self._PTInfo is not None: + if self not in self._PTInfo._PTs: + self._PTInfo._PTs.append(self) + + PTInfo = property(getPTInfo, setPTInfo) + diff --git a/CIM16/IEC61970/AuxiliaryEquipment/Sensor.py b/CIM16/IEC61970/AuxiliaryEquipment/Sensor.py new file mode 100755 index 00000000..a5df8f06 --- /dev/null +++ b/CIM16/IEC61970/AuxiliaryEquipment/Sensor.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.AuxiliaryEquipment.AuxiliaryEquipment import AuxiliaryEquipment + +class Sensor(AuxiliaryEquipment): + """This class describe devices that transform a measured quantity into signals that can be presented at displays, used in control or be recorded.This class describe devices that transform a measured quantity into signals that can be presented at displays, used in control or be recorded. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Sensor' instance. + + """ + super(Sensor, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/AuxiliaryEquipment/SurgeProtector.py b/CIM16/IEC61970/AuxiliaryEquipment/SurgeProtector.py new file mode 100755 index 00000000..de0f3a75 --- /dev/null +++ b/CIM16/IEC61970/AuxiliaryEquipment/SurgeProtector.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.AuxiliaryEquipment.AuxiliaryEquipment import AuxiliaryEquipment + +class SurgeProtector(AuxiliaryEquipment): + """Shunt device, installed on the network, usually in the proximity of electrical equipment in order to protect the said equipment against transient voltage spikes caused by lightning or switching activity.Shunt device, installed on the network, usually in the proximity of electrical equipment in order to protect the said equipment against transient voltage spikes caused by lightning or switching activity. + """ + + def __init__(self, SurgeProtectorInfo=None, *args, **kw_args): + """Initialises a new 'SurgeProtector' instance. + + @param SurgeProtectorInfo: Surge protector data. + """ + self._SurgeProtectorInfo = None + self.SurgeProtectorInfo = SurgeProtectorInfo + + super(SurgeProtector, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["SurgeProtectorInfo"] + _many_refs = [] + + def getSurgeProtectorInfo(self): + """Surge protector data. + """ + return self._SurgeProtectorInfo + + def setSurgeProtectorInfo(self, value): + if self._SurgeProtectorInfo is not None: + filtered = [x for x in self.SurgeProtectorInfo.SurgeProtectors if x != self] + self._SurgeProtectorInfo._SurgeProtectors = filtered + + self._SurgeProtectorInfo = value + if self._SurgeProtectorInfo is not None: + if self not in self._SurgeProtectorInfo._SurgeProtectors: + self._SurgeProtectorInfo._SurgeProtectors.append(self) + + SurgeProtectorInfo = property(getSurgeProtectorInfo, setSurgeProtectorInfo) + diff --git a/CIM16/IEC61970/AuxiliaryEquipment/__init__.py b/CIM16/IEC61970/AuxiliaryEquipment/__init__.py new file mode 100755 index 00000000..12e7589e --- /dev/null +++ b/CIM16/IEC61970/AuxiliaryEquipment/__init__.py @@ -0,0 +1,31 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +from CIM16.IEC61970.AuxiliaryEquipment.PotentialTransformer import PotentialTransformer +from CIM16.IEC61970.AuxiliaryEquipment.Sensor import Sensor +from CIM16.IEC61970.AuxiliaryEquipment.AuxiliaryEquipment import AuxiliaryEquipment +from CIM16.IEC61970.AuxiliaryEquipment.CurrentTransformer import CurrentTransformer +from CIM16.IEC61970.AuxiliaryEquipment.SurgeProtector import SurgeProtector +from CIM16.IEC61970.AuxiliaryEquipment.FaultIndicator import FaultIndicator + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#AuxiliaryEquipment" +nsPrefix = "cimAuxiliaryEquipment" + diff --git a/CIM16/IEC61970/Contingency/Contingency.py b/CIM16/IEC61970/Contingency/Contingency.py new file mode 100755 index 00000000..a5cf4e20 --- /dev/null +++ b/CIM16/IEC61970/Contingency/Contingency.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Contingency(IdentifiedObject): + """An event threatening system reliability, consisting of one or more contingency elements.An event threatening system reliability, consisting of one or more contingency elements. + """ + + def __init__(self, mustStudy=False, ContingencyElement=None, *args, **kw_args): + """Initialises a new 'Contingency' instance. + + @param mustStudy: Set true if must study this contingency. + @param ContingencyElement: A contingency can have any number of contingency elements. + """ + #: Set true if must study this contingency. + self.mustStudy = mustStudy + + self._ContingencyElement = [] + self.ContingencyElement = [] if ContingencyElement is None else ContingencyElement + + super(Contingency, self).__init__(*args, **kw_args) + + _attrs = ["mustStudy"] + _attr_types = {"mustStudy": bool} + _defaults = {"mustStudy": False} + _enums = {} + _refs = ["ContingencyElement"] + _many_refs = ["ContingencyElement"] + + def getContingencyElement(self): + """A contingency can have any number of contingency elements. + """ + return self._ContingencyElement + + def setContingencyElement(self, value): + for x in self._ContingencyElement: + x.Contingency = None + for y in value: + y._Contingency = self + self._ContingencyElement = value + + ContingencyElement = property(getContingencyElement, setContingencyElement) + + def addContingencyElement(self, *ContingencyElement): + for obj in ContingencyElement: + obj.Contingency = self + + def removeContingencyElement(self, *ContingencyElement): + for obj in ContingencyElement: + obj.Contingency = None + diff --git a/CIM16/IEC61970/Contingency/ContingencyElement.py b/CIM16/IEC61970/Contingency/ContingencyElement.py new file mode 100755 index 00000000..dec29e3c --- /dev/null +++ b/CIM16/IEC61970/Contingency/ContingencyElement.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ContingencyElement(IdentifiedObject): + """An element of a system event to be studied by contingency analysis, representing a change in status of a single piece of equipment.An element of a system event to be studied by contingency analysis, representing a change in status of a single piece of equipment. + """ + + def __init__(self, Contingency=None, *args, **kw_args): + """Initialises a new 'ContingencyElement' instance. + + @param Contingency: A contingency element belongs to one contingency. + """ + self._Contingency = None + self.Contingency = Contingency + + super(ContingencyElement, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Contingency"] + _many_refs = [] + + def getContingency(self): + """A contingency element belongs to one contingency. + """ + return self._Contingency + + def setContingency(self, value): + if self._Contingency is not None: + filtered = [x for x in self.Contingency.ContingencyElement if x != self] + self._Contingency._ContingencyElement = filtered + + self._Contingency = value + if self._Contingency is not None: + if self not in self._Contingency._ContingencyElement: + self._Contingency._ContingencyElement.append(self) + + Contingency = property(getContingency, setContingency) + diff --git a/CIM16/IEC61970/Contingency/ContingencyEquipment.py b/CIM16/IEC61970/Contingency/ContingencyEquipment.py new file mode 100755 index 00000000..65491220 --- /dev/null +++ b/CIM16/IEC61970/Contingency/ContingencyEquipment.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Contingency.ContingencyElement import ContingencyElement + +class ContingencyEquipment(ContingencyElement): + """A equipment to which the in service status is to change such as a power transformer or AC line segment.A equipment to which the in service status is to change such as a power transformer or AC line segment. + """ + + def __init__(self, contingentStatus="outOfService", Equipment=None, *args, **kw_args): + """Initialises a new 'ContingencyEquipment' instance. + + @param contingentStatus: The status for the associated equipment when in the contingency state. This status is independent of the case to which the contingency is originally applied, but defines the equipment status when the contingency is applied. Values are: "outOfService", "inService" + @param Equipment: The single piece of equipment to which to apply the contingency. + """ + #: The status for the associated equipment when in the contingency state. This status is independent of the case to which the contingency is originally applied, but defines the equipment status when the contingency is applied. Values are: "outOfService", "inService" + self.contingentStatus = contingentStatus + + self._Equipment = None + self.Equipment = Equipment + + super(ContingencyEquipment, self).__init__(*args, **kw_args) + + _attrs = ["contingentStatus"] + _attr_types = {"contingentStatus": str} + _defaults = {"contingentStatus": "outOfService"} + _enums = {"contingentStatus": "ContingencyEquipmentStatusKind"} + _refs = ["Equipment"] + _many_refs = [] + + def getEquipment(self): + """The single piece of equipment to which to apply the contingency. + """ + return self._Equipment + + def setEquipment(self, value): + if self._Equipment is not None: + filtered = [x for x in self.Equipment.ContingencyEquipment if x != self] + self._Equipment._ContingencyEquipment = filtered + + self._Equipment = value + if self._Equipment is not None: + if self not in self._Equipment._ContingencyEquipment: + self._Equipment._ContingencyEquipment.append(self) + + Equipment = property(getEquipment, setEquipment) + diff --git a/CIM16/IEC61970/Contingency/__init__.py b/CIM16/IEC61970/Contingency/__init__.py new file mode 100755 index 00000000..c321ee1e --- /dev/null +++ b/CIM16/IEC61970/Contingency/__init__.py @@ -0,0 +1,35 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""Contingencies to be studied. +""" + +from CIM16.IEC61970.Contingency.ContingencyEquipment import ContingencyEquipment +from CIM16.IEC61970.Contingency.Contingency import Contingency +from CIM16.IEC61970.Contingency.ContingencyElement import ContingencyElement + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Contingency" +nsPrefix = "cimContingency" + + +class ContingencyEquipmentStatusKind(str): + """Values are: outOfService, inService + """ + pass diff --git a/CIM16/IEC61970/ControlArea/AltGeneratingUnitMeas.py b/CIM16/IEC61970/ControlArea/AltGeneratingUnitMeas.py new file mode 100755 index 00000000..297f9226 --- /dev/null +++ b/CIM16/IEC61970/ControlArea/AltGeneratingUnitMeas.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class AltGeneratingUnitMeas(Element): + """A prioritized measurement to be used for the generating unit in the control area specificaiton.A prioritized measurement to be used for the generating unit in the control area specificaiton. + """ + + def __init__(self, priority=0, AnalogValue=None, ControlAreaGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'AltGeneratingUnitMeas' instance. + + @param priority: Priority of a measurement usage. Lower numbers have first priority. + @param AnalogValue: The specific analog value used as a source. + @param ControlAreaGeneratingUnit: The control aread generating unit to which the prioritized measurement assignment is applied. + """ + #: Priority of a measurement usage. Lower numbers have first priority. + self.priority = priority + + self._AnalogValue = None + self.AnalogValue = AnalogValue + + self._ControlAreaGeneratingUnit = None + self.ControlAreaGeneratingUnit = ControlAreaGeneratingUnit + + super(AltGeneratingUnitMeas, self).__init__(*args, **kw_args) + + _attrs = ["priority"] + _attr_types = {"priority": int} + _defaults = {"priority": 0} + _enums = {} + _refs = ["AnalogValue", "ControlAreaGeneratingUnit"] + _many_refs = [] + + def getAnalogValue(self): + """The specific analog value used as a source. + """ + return self._AnalogValue + + def setAnalogValue(self, value): + if self._AnalogValue is not None: + filtered = [x for x in self.AnalogValue.AltGeneratingUnit if x != self] + self._AnalogValue._AltGeneratingUnit = filtered + + self._AnalogValue = value + if self._AnalogValue is not None: + if self not in self._AnalogValue._AltGeneratingUnit: + self._AnalogValue._AltGeneratingUnit.append(self) + + AnalogValue = property(getAnalogValue, setAnalogValue) + + def getControlAreaGeneratingUnit(self): + """The control aread generating unit to which the prioritized measurement assignment is applied. + """ + return self._ControlAreaGeneratingUnit + + def setControlAreaGeneratingUnit(self, value): + if self._ControlAreaGeneratingUnit is not None: + filtered = [x for x in self.ControlAreaGeneratingUnit.AltGeneratingUnitMeas if x != self] + self._ControlAreaGeneratingUnit._AltGeneratingUnitMeas = filtered + + self._ControlAreaGeneratingUnit = value + if self._ControlAreaGeneratingUnit is not None: + if self not in self._ControlAreaGeneratingUnit._AltGeneratingUnitMeas: + self._ControlAreaGeneratingUnit._AltGeneratingUnitMeas.append(self) + + ControlAreaGeneratingUnit = property(getControlAreaGeneratingUnit, setControlAreaGeneratingUnit) + diff --git a/CIM16/IEC61970/ControlArea/AltTieMeas.py b/CIM16/IEC61970/ControlArea/AltTieMeas.py new file mode 100755 index 00000000..dc007d08 --- /dev/null +++ b/CIM16/IEC61970/ControlArea/AltTieMeas.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class AltTieMeas(Element): + """A prioritized measurement to be used for the tie flow as part of the control area specification.A prioritized measurement to be used for the tie flow as part of the control area specification. + """ + + def __init__(self, priority=0, AnalogValue=None, TieFlow=None, *args, **kw_args): + """Initialises a new 'AltTieMeas' instance. + + @param priority: Priority of a measurement usage. Lower numbers have first priority. + @param AnalogValue: The specific analog value used as a source. + @param TieFlow: The tie flow of the alternate measurements. + """ + #: Priority of a measurement usage. Lower numbers have first priority. + self.priority = priority + + self._AnalogValue = None + self.AnalogValue = AnalogValue + + self._TieFlow = None + self.TieFlow = TieFlow + + super(AltTieMeas, self).__init__(*args, **kw_args) + + _attrs = ["priority"] + _attr_types = {"priority": int} + _defaults = {"priority": 0} + _enums = {} + _refs = ["AnalogValue", "TieFlow"] + _many_refs = [] + + def getAnalogValue(self): + """The specific analog value used as a source. + """ + return self._AnalogValue + + def setAnalogValue(self, value): + if self._AnalogValue is not None: + filtered = [x for x in self.AnalogValue.AltTieMeas if x != self] + self._AnalogValue._AltTieMeas = filtered + + self._AnalogValue = value + if self._AnalogValue is not None: + if self not in self._AnalogValue._AltTieMeas: + self._AnalogValue._AltTieMeas.append(self) + + AnalogValue = property(getAnalogValue, setAnalogValue) + + def getTieFlow(self): + """The tie flow of the alternate measurements. + """ + return self._TieFlow + + def setTieFlow(self, value): + if self._TieFlow is not None: + filtered = [x for x in self.TieFlow.AltTieMeas if x != self] + self._TieFlow._AltTieMeas = filtered + + self._TieFlow = value + if self._TieFlow is not None: + if self not in self._TieFlow._AltTieMeas: + self._TieFlow._AltTieMeas.append(self) + + TieFlow = property(getTieFlow, setTieFlow) + diff --git a/CIM16/IEC61970/ControlArea/ControlArea.py b/CIM16/IEC61970/ControlArea/ControlArea.py new file mode 100755 index 00000000..deb25612 --- /dev/null +++ b/CIM16/IEC61970/ControlArea/ControlArea.py @@ -0,0 +1,123 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class ControlArea(PowerSystemResource): + """A control area is a grouping of generating units and/or loads and a cutset of tie lines (as terminals) which may be used for a variety of purposes including automatic generation control, powerflow solution area interchange control specification, and input to load forecasting. Note that any number of overlapping control area specifications can be superimposed on the physical model.A control area is a grouping of generating units and/or loads and a cutset of tie lines (as terminals) which may be used for a variety of purposes including automatic generation control, powerflow solution area interchange control specification, and input to load forecasting. Note that any number of overlapping control area specifications can be superimposed on the physical model. + """ + + def __init__(self, type="Forecast", pTolerance=0.0, netInterchange=0.0, ControlAreaGeneratingUnit=None, TieFlow=None, EnergyArea=None, *args, **kw_args): + """Initialises a new 'ControlArea' instance. + + @param type: The type of control area defintion used to determine if this is used for automatic generation control, for planning interchange control, or other purposes. Values are: "Forecast", "AGC", "Interchange" + @param pTolerance: Active power net interchange tolerance + @param netInterchange: The specified positive net interchange into the control area. + @param ControlAreaGeneratingUnit: The generating unit specificaitons for the control area. + @param TieFlow: The tie flows associated with the control area. + @param EnergyArea: The energy area that is forecast from this control area specification. + """ + #: The type of control area defintion used to determine if this is used for automatic generation control, for planning interchange control, or other purposes. Values are: "Forecast", "AGC", "Interchange" + self.type = type + + #: Active power net interchange tolerance + self.pTolerance = pTolerance + + #: The specified positive net interchange into the control area. + self.netInterchange = netInterchange + + self._ControlAreaGeneratingUnit = [] + self.ControlAreaGeneratingUnit = [] if ControlAreaGeneratingUnit is None else ControlAreaGeneratingUnit + + self._TieFlow = [] + self.TieFlow = [] if TieFlow is None else TieFlow + + self._EnergyArea = None + self.EnergyArea = EnergyArea + + super(ControlArea, self).__init__(*args, **kw_args) + + _attrs = ["type", "pTolerance", "netInterchange"] + _attr_types = {"type": str, "pTolerance": float, "netInterchange": float} + _defaults = {"type": "Forecast", "pTolerance": 0.0, "netInterchange": 0.0} + _enums = {"type": "ControlAreaTypeKind"} + _refs = ["ControlAreaGeneratingUnit", "TieFlow", "EnergyArea"] + _many_refs = ["ControlAreaGeneratingUnit", "TieFlow"] + + def getControlAreaGeneratingUnit(self): + """The generating unit specificaitons for the control area. + """ + return self._ControlAreaGeneratingUnit + + def setControlAreaGeneratingUnit(self, value): + for x in self._ControlAreaGeneratingUnit: + x.ControlArea = None + for y in value: + y._ControlArea = self + self._ControlAreaGeneratingUnit = value + + ControlAreaGeneratingUnit = property(getControlAreaGeneratingUnit, setControlAreaGeneratingUnit) + + def addControlAreaGeneratingUnit(self, *ControlAreaGeneratingUnit): + for obj in ControlAreaGeneratingUnit: + obj.ControlArea = self + + def removeControlAreaGeneratingUnit(self, *ControlAreaGeneratingUnit): + for obj in ControlAreaGeneratingUnit: + obj.ControlArea = None + + def getTieFlow(self): + """The tie flows associated with the control area. + """ + return self._TieFlow + + def setTieFlow(self, value): + for x in self._TieFlow: + x.ControlArea = None + for y in value: + y._ControlArea = self + self._TieFlow = value + + TieFlow = property(getTieFlow, setTieFlow) + + def addTieFlow(self, *TieFlow): + for obj in TieFlow: + obj.ControlArea = self + + def removeTieFlow(self, *TieFlow): + for obj in TieFlow: + obj.ControlArea = None + + def getEnergyArea(self): + """The energy area that is forecast from this control area specification. + """ + return self._EnergyArea + + def setEnergyArea(self, value): + if self._EnergyArea is not None: + self._EnergyArea._ControlArea = None + + self._EnergyArea = value + if self._EnergyArea is not None: + self._EnergyArea.ControlArea = None + self._EnergyArea._ControlArea = self + + EnergyArea = property(getEnergyArea, setEnergyArea) + diff --git a/CIM16/IEC61970/ControlArea/ControlAreaGeneratingUnit.py b/CIM16/IEC61970/ControlArea/ControlAreaGeneratingUnit.py new file mode 100755 index 00000000..3087efe2 --- /dev/null +++ b/CIM16/IEC61970/ControlArea/ControlAreaGeneratingUnit.py @@ -0,0 +1,107 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class ControlAreaGeneratingUnit(Element): + """A control area generating unit. This class is needed so that alternate control area definitions may include the same generating unit. Note only one instance within a control area should reference a specific generating unit.A control area generating unit. This class is needed so that alternate control area definitions may include the same generating unit. Note only one instance within a control area should reference a specific generating unit. + """ + + def __init__(self, AltGeneratingUnitMeas=None, GeneratingUnit=None, ControlArea=None, *args, **kw_args): + """Initialises a new 'ControlAreaGeneratingUnit' instance. + + @param AltGeneratingUnitMeas: The link to prioritized measurements for this GeneratingUnit. + @param GeneratingUnit: The generating unit specified for this control area. Note that a control area should include a GeneratingUnit only once. + @param ControlArea: The parent control area for the generating unit specifications. + """ + self._AltGeneratingUnitMeas = [] + self.AltGeneratingUnitMeas = [] if AltGeneratingUnitMeas is None else AltGeneratingUnitMeas + + self._GeneratingUnit = None + self.GeneratingUnit = GeneratingUnit + + self._ControlArea = None + self.ControlArea = ControlArea + + super(ControlAreaGeneratingUnit, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["AltGeneratingUnitMeas", "GeneratingUnit", "ControlArea"] + _many_refs = ["AltGeneratingUnitMeas"] + + def getAltGeneratingUnitMeas(self): + """The link to prioritized measurements for this GeneratingUnit. + """ + return self._AltGeneratingUnitMeas + + def setAltGeneratingUnitMeas(self, value): + for x in self._AltGeneratingUnitMeas: + x.ControlAreaGeneratingUnit = None + for y in value: + y._ControlAreaGeneratingUnit = self + self._AltGeneratingUnitMeas = value + + AltGeneratingUnitMeas = property(getAltGeneratingUnitMeas, setAltGeneratingUnitMeas) + + def addAltGeneratingUnitMeas(self, *AltGeneratingUnitMeas): + for obj in AltGeneratingUnitMeas: + obj.ControlAreaGeneratingUnit = self + + def removeAltGeneratingUnitMeas(self, *AltGeneratingUnitMeas): + for obj in AltGeneratingUnitMeas: + obj.ControlAreaGeneratingUnit = None + + def getGeneratingUnit(self): + """The generating unit specified for this control area. Note that a control area should include a GeneratingUnit only once. + """ + return self._GeneratingUnit + + def setGeneratingUnit(self, value): + if self._GeneratingUnit is not None: + filtered = [x for x in self.GeneratingUnit.ControlAreaGeneratingUnit if x != self] + self._GeneratingUnit._ControlAreaGeneratingUnit = filtered + + self._GeneratingUnit = value + if self._GeneratingUnit is not None: + if self not in self._GeneratingUnit._ControlAreaGeneratingUnit: + self._GeneratingUnit._ControlAreaGeneratingUnit.append(self) + + GeneratingUnit = property(getGeneratingUnit, setGeneratingUnit) + + def getControlArea(self): + """The parent control area for the generating unit specifications. + """ + return self._ControlArea + + def setControlArea(self, value): + if self._ControlArea is not None: + filtered = [x for x in self.ControlArea.ControlAreaGeneratingUnit if x != self] + self._ControlArea._ControlAreaGeneratingUnit = filtered + + self._ControlArea = value + if self._ControlArea is not None: + if self not in self._ControlArea._ControlAreaGeneratingUnit: + self._ControlArea._ControlAreaGeneratingUnit.append(self) + + ControlArea = property(getControlArea, setControlArea) + diff --git a/CIM16/IEC61970/ControlArea/TieFlow.py b/CIM16/IEC61970/ControlArea/TieFlow.py new file mode 100755 index 00000000..35151f46 --- /dev/null +++ b/CIM16/IEC61970/ControlArea/TieFlow.py @@ -0,0 +1,111 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class TieFlow(Element): + """A flow specification in terms of location and direction for a control area.A flow specification in terms of location and direction for a control area. + """ + + def __init__(self, positiveFlowIn=False, AltTieMeas=None, Terminal=None, ControlArea=None, *args, **kw_args): + """Initialises a new 'TieFlow' instance. + + @param positiveFlowIn: The flow is positive into the terminal. A flow is positive if it is an import into the control area. + @param AltTieMeas: The primary and alternate tie flow measurements associated with the tie flow. + @param Terminal: The terminal to which this tie flow belongs. + @param ControlArea: The control area of the tie flows. + """ + #: The flow is positive into the terminal. A flow is positive if it is an import into the control area. + self.positiveFlowIn = positiveFlowIn + + self._AltTieMeas = [] + self.AltTieMeas = [] if AltTieMeas is None else AltTieMeas + + self._Terminal = None + self.Terminal = Terminal + + self._ControlArea = None + self.ControlArea = ControlArea + + super(TieFlow, self).__init__(*args, **kw_args) + + _attrs = ["positiveFlowIn"] + _attr_types = {"positiveFlowIn": bool} + _defaults = {"positiveFlowIn": False} + _enums = {} + _refs = ["AltTieMeas", "Terminal", "ControlArea"] + _many_refs = ["AltTieMeas"] + + def getAltTieMeas(self): + """The primary and alternate tie flow measurements associated with the tie flow. + """ + return self._AltTieMeas + + def setAltTieMeas(self, value): + for x in self._AltTieMeas: + x.TieFlow = None + for y in value: + y._TieFlow = self + self._AltTieMeas = value + + AltTieMeas = property(getAltTieMeas, setAltTieMeas) + + def addAltTieMeas(self, *AltTieMeas): + for obj in AltTieMeas: + obj.TieFlow = self + + def removeAltTieMeas(self, *AltTieMeas): + for obj in AltTieMeas: + obj.TieFlow = None + + def getTerminal(self): + """The terminal to which this tie flow belongs. + """ + return self._Terminal + + def setTerminal(self, value): + if self._Terminal is not None: + filtered = [x for x in self.Terminal.TieFlow if x != self] + self._Terminal._TieFlow = filtered + + self._Terminal = value + if self._Terminal is not None: + if self not in self._Terminal._TieFlow: + self._Terminal._TieFlow.append(self) + + Terminal = property(getTerminal, setTerminal) + + def getControlArea(self): + """The control area of the tie flows. + """ + return self._ControlArea + + def setControlArea(self, value): + if self._ControlArea is not None: + filtered = [x for x in self.ControlArea.TieFlow if x != self] + self._ControlArea._TieFlow = filtered + + self._ControlArea = value + if self._ControlArea is not None: + if self not in self._ControlArea._TieFlow: + self._ControlArea._TieFlow.append(self) + + ControlArea = property(getControlArea, setControlArea) + diff --git a/CIM16/IEC61970/ControlArea/__init__.py b/CIM16/IEC61970/ControlArea/__init__.py new file mode 100755 index 00000000..38638d0d --- /dev/null +++ b/CIM16/IEC61970/ControlArea/__init__.py @@ -0,0 +1,37 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The ControlArea package models area specifications which can be used for a variety of purposes. The package as a whole models potentially overlapping control area specifications for the purpose of actual generation control, load forecast area load capture, or powerflow based analysis. +""" + +from CIM16.IEC61970.ControlArea.AltTieMeas import AltTieMeas +from CIM16.IEC61970.ControlArea.AltGeneratingUnitMeas import AltGeneratingUnitMeas +from CIM16.IEC61970.ControlArea.TieFlow import TieFlow +from CIM16.IEC61970.ControlArea.ControlArea import ControlArea +from CIM16.IEC61970.ControlArea.ControlAreaGeneratingUnit import ControlAreaGeneratingUnit + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#ControlArea" +nsPrefix = "cimControlArea" + + +class ControlAreaTypeKind(str): + """Values are: Forecast, AGC, Interchange + """ + pass diff --git a/CIM16/IEC61970/Core/BasePower.py b/CIM16/IEC61970/Core/BasePower.py new file mode 100755 index 00000000..e1b0a214 --- /dev/null +++ b/CIM16/IEC61970/Core/BasePower.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class BasePower(IdentifiedObject): + """The BasePower class defines the base power used in the per unit calculations.The BasePower class defines the base power used in the per unit calculations. + """ + + def __init__(self, basePower=0.0, *args, **kw_args): + """Initialises a new 'BasePower' instance. + + @param basePower: Definition of base power. + """ + #: Definition of base power. + self.basePower = basePower + + super(BasePower, self).__init__(*args, **kw_args) + + _attrs = ["basePower"] + _attr_types = {"basePower": float} + _defaults = {"basePower": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Core/BaseVoltage.py b/CIM16/IEC61970/Core/BaseVoltage.py new file mode 100755 index 00000000..8a9dc20e --- /dev/null +++ b/CIM16/IEC61970/Core/BaseVoltage.py @@ -0,0 +1,147 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class BaseVoltage(IdentifiedObject): + """Defines a nominal base voltage which is referenced in the system.Defines a nominal base voltage which is referenced in the system. + """ + + def __init__(self, nominalVoltage=0.0, isDC=False, TopologicalNode=None, VoltageLevel=None, ConductingEquipment=None, TransformerEnd=None, *args, **kw_args): + """Initialises a new 'BaseVoltage' instance. + + @param nominalVoltage: The PowerSystemResource's base voltage. + @param isDC: If true, this is a direct current base voltage and items assigned to this base voltage are also associated with a direct current capabilities. False indicates alternating current. + @param TopologicalNode: The topological nodes at the base voltage. + @param VoltageLevel: The VoltageLevels having this BaseVoltage. + @param ConductingEquipment: Use association to ConductingEquipment only when there is no VoltageLevel container used. + """ + #: The PowerSystemResource's base voltage. + self.nominalVoltage = nominalVoltage + + #: If true, this is a direct current base voltage and items assigned to this base voltage are also associated with a direct current capabilities. False indicates alternating current. + self.isDC = isDC + + self._TopologicalNode = [] + self.TopologicalNode = [] if TopologicalNode is None else TopologicalNode + + self._VoltageLevel = [] + self.VoltageLevel = [] if VoltageLevel is None else VoltageLevel + + self._ConductingEquipment = [] + self.ConductingEquipment = [] if ConductingEquipment is None else ConductingEquipment + + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + super(BaseVoltage, self).__init__(*args, **kw_args) + + _attrs = ["nominalVoltage", "isDC"] + _attr_types = {"nominalVoltage": float, "isDC": bool} + _defaults = {"nominalVoltage": 0.0, "isDC": False} + _enums = {} + _refs = ["TopologicalNode", "VoltageLevel", "ConductingEquipment", "TransformerEnd"] + _many_refs = ["TopologicalNode", "VoltageLevel", "ConductingEquipment", "TransformerEnd"] + + def getTopologicalNode(self): + """The topological nodes at the base voltage. + """ + return self._TopologicalNode + + def setTopologicalNode(self, value): + for x in self._TopologicalNode: + x.BaseVoltage = None + for y in value: + y._BaseVoltage = self + self._TopologicalNode = value + + TopologicalNode = property(getTopologicalNode, setTopologicalNode) + + def addTopologicalNode(self, *TopologicalNode): + for obj in TopologicalNode: + obj.BaseVoltage = self + + def removeTopologicalNode(self, *TopologicalNode): + for obj in TopologicalNode: + obj.BaseVoltage = None + + def getVoltageLevel(self): + """The VoltageLevels having this BaseVoltage. + """ + return self._VoltageLevel + + def setVoltageLevel(self, value): + for x in self._VoltageLevel: + x.BaseVoltage = None + for y in value: + y._BaseVoltage = self + self._VoltageLevel = value + + VoltageLevel = property(getVoltageLevel, setVoltageLevel) + + def addVoltageLevel(self, *VoltageLevel): + for obj in VoltageLevel: + obj.BaseVoltage = self + + def removeVoltageLevel(self, *VoltageLevel): + for obj in VoltageLevel: + obj.BaseVoltage = None + + def getConductingEquipment(self): + """Use association to ConductingEquipment only when there is no VoltageLevel container used. + """ + return self._ConductingEquipment + + def setConductingEquipment(self, value): + for x in self._ConductingEquipment: + x.BaseVoltage = None + for y in value: + y._BaseVoltage = self + self._ConductingEquipment = value + + ConductingEquipment = property(getConductingEquipment, setConductingEquipment) + + def addConductingEquipment(self, *ConductingEquipment): + for obj in ConductingEquipment: + obj.BaseVoltage = self + + def removeConductingEquipment(self, *ConductingEquipment): + for obj in ConductingEquipment: + obj.BaseVoltage = None + + def getTransformerEnd(self): + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.BaseVoltage = None + for y in value: + y._BaseVoltage = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.BaseVoltage = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.BaseVoltage = None diff --git a/CIM16/IEC61970/Core/BasicIntervalSchedule.py b/CIM16/IEC61970/Core/BasicIntervalSchedule.py new file mode 100755 index 00000000..210534b9 --- /dev/null +++ b/CIM16/IEC61970/Core/BasicIntervalSchedule.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class BasicIntervalSchedule(IdentifiedObject): + """Schedule of values at points in time.Schedule of values at points in time. + """ + + def __init__(self, startTime='', value1Multiplier="M", value2Unit="N", value1Unit="N", value2Multiplier="M", *args, **kw_args): + """Initialises a new 'BasicIntervalSchedule' instance. + + @param startTime: The time for the first time point. + @param value1Multiplier: Multiplier for value1. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param value2Unit: Value2 units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param value1Unit: Value1 units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param value2Multiplier: Multiplier for value2. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + """ + #: The time for the first time point. + self.startTime = startTime + + #: Multiplier for value1. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.value1Multiplier = value1Multiplier + + #: Value2 units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.value2Unit = value2Unit + + #: Value1 units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.value1Unit = value1Unit + + #: Multiplier for value2. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.value2Multiplier = value2Multiplier + + super(BasicIntervalSchedule, self).__init__(*args, **kw_args) + + _attrs = ["startTime", "value1Multiplier", "value2Unit", "value1Unit", "value2Multiplier"] + _attr_types = {"startTime": str, "value1Multiplier": str, "value2Unit": str, "value1Unit": str, "value2Multiplier": str} + _defaults = {"startTime": '', "value1Multiplier": "M", "value2Unit": "N", "value1Unit": "N", "value2Multiplier": "M"} + _enums = {"value1Multiplier": "UnitMultiplier", "value2Unit": "UnitSymbol", "value1Unit": "UnitSymbol", "value2Multiplier": "UnitMultiplier"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Core/Bay.py b/CIM16/IEC61970/Core/Bay.py new file mode 100755 index 00000000..ca090ae6 --- /dev/null +++ b/CIM16/IEC61970/Core/Bay.py @@ -0,0 +1,97 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class Bay(EquipmentContainer): + """A collection of power system resources (within a given substation) including conducting equipment, protection relays, measurements, and telemetry.A collection of power system resources (within a given substation) including conducting equipment, protection relays, measurements, and telemetry. + """ + + def __init__(self, bayPowerMeasFlag=False, bayEnergyMeasFlag=False, busBarConfiguration="doubleBus", breakerConfiguration="breakerAndAHalf", VoltageLevel=None, Substation=None, *args, **kw_args): + """Initialises a new 'Bay' instance. + + @param bayPowerMeasFlag: Indicates the presence/absence of active/reactive power measurements. + @param bayEnergyMeasFlag: Indicates the presence/absence of energy measurements. + @param busBarConfiguration: Bus bar configuration. Values are: "doubleBus", "ringBus", "singleBus", "mainWithTransfer" + @param breakerConfiguration: Breaker configuration. Values are: "breakerAndAHalf", "noBreaker", "singleBreaker", "doubleBreaker" + @param VoltageLevel: The association is used in the naming hierarchy. + @param Substation: The association is used in the naming hierarchy. + """ + #: Indicates the presence/absence of active/reactive power measurements. + self.bayPowerMeasFlag = bayPowerMeasFlag + + #: Indicates the presence/absence of energy measurements. + self.bayEnergyMeasFlag = bayEnergyMeasFlag + + #: Bus bar configuration. Values are: "doubleBus", "ringBus", "singleBus", "mainWithTransfer" + self.busBarConfiguration = busBarConfiguration + + #: Breaker configuration. Values are: "breakerAndAHalf", "noBreaker", "singleBreaker", "doubleBreaker" + self.breakerConfiguration = breakerConfiguration + + self._VoltageLevel = None + self.VoltageLevel = VoltageLevel + + self._Substation = None + self.Substation = Substation + + super(Bay, self).__init__(*args, **kw_args) + + _attrs = ["bayPowerMeasFlag", "bayEnergyMeasFlag", "busBarConfiguration", "breakerConfiguration"] + _attr_types = {"bayPowerMeasFlag": bool, "bayEnergyMeasFlag": bool, "busBarConfiguration": str, "breakerConfiguration": str} + _defaults = {"bayPowerMeasFlag": False, "bayEnergyMeasFlag": False, "busBarConfiguration": "doubleBus", "breakerConfiguration": "breakerAndAHalf"} + _enums = {"busBarConfiguration": "BusbarConfiguration", "breakerConfiguration": "BreakerConfiguration"} + _refs = ["VoltageLevel", "Substation"] + _many_refs = [] + + def getVoltageLevel(self): + """The association is used in the naming hierarchy. + """ + return self._VoltageLevel + + def setVoltageLevel(self, value): + if self._VoltageLevel is not None: + filtered = [x for x in self.VoltageLevel.Bays if x != self] + self._VoltageLevel._Bays = filtered + + self._VoltageLevel = value + if self._VoltageLevel is not None: + if self not in self._VoltageLevel._Bays: + self._VoltageLevel._Bays.append(self) + + VoltageLevel = property(getVoltageLevel, setVoltageLevel) + + def getSubstation(self): + """The association is used in the naming hierarchy. + """ + return self._Substation + + def setSubstation(self, value): + if self._Substation is not None: + filtered = [x for x in self.Substation.Bays if x != self] + self._Substation._Bays = filtered + + self._Substation = value + if self._Substation is not None: + if self not in self._Substation._Bays: + self._Substation._Bays.append(self) + + Substation = property(getSubstation, setSubstation) + diff --git a/CIM16/IEC61970/Core/ConductingEquipment.py b/CIM16/IEC61970/Core/ConductingEquipment.py new file mode 100755 index 00000000..7e7276a2 --- /dev/null +++ b/CIM16/IEC61970/Core/ConductingEquipment.py @@ -0,0 +1,189 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Equipment import Equipment + +class ConductingEquipment(Equipment): + """The parts of the power system that are designed to carry current or that are conductively connected therewith. ConductingEquipment is contained within an EquipmentContainer that may be a Substation, or a VoltageLevel or a Bay within a Substation.The parts of the power system that are designed to carry current or that are conductively connected therewith. ConductingEquipment is contained within an EquipmentContainer that may be a Substation, or a VoltageLevel or a Bay within a Substation. + """ + + def __init__(self, BaseVoltage=None, ClearanceTags=None, ProtectionEquipments=None, Terminals=None, OutageStepRoles=None, SvStatus=None, *args, **kw_args): + """Initialises a new 'ConductingEquipment' instance. + + @param BaseVoltage: Use association to ConductingEquipment only when there is no VoltageLevel container used. + @param ClearanceTags: Conducting equipment may have multiple clearance tags for authorized field work + @param ProtectionEquipments: Protection equipment may be used to protect specific Conducting Equipment. Multiple equipment may be protected or monitored by multiple protection equipment. + @param Terminals: ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + @param OutageStepRoles: + @param SvStatus: The status state associated with the conducting equipment. + """ + self._BaseVoltage = None + self.BaseVoltage = BaseVoltage + + self._ClearanceTags = [] + self.ClearanceTags = [] if ClearanceTags is None else ClearanceTags + + self._ProtectionEquipments = [] + self.ProtectionEquipments = [] if ProtectionEquipments is None else ProtectionEquipments + + self._Terminals = [] + self.Terminals = [] if Terminals is None else Terminals + + self._OutageStepRoles = [] + self.OutageStepRoles = [] if OutageStepRoles is None else OutageStepRoles + + self._SvStatus = None + self.SvStatus = SvStatus + + super(ConductingEquipment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["BaseVoltage", "ClearanceTags", "ProtectionEquipments", "Terminals", "OutageStepRoles", "SvStatus"] + _many_refs = ["ClearanceTags", "ProtectionEquipments", "Terminals", "OutageStepRoles"] + + def getBaseVoltage(self): + """Use association to ConductingEquipment only when there is no VoltageLevel container used. + """ + return self._BaseVoltage + + def setBaseVoltage(self, value): + if self._BaseVoltage is not None: + filtered = [x for x in self.BaseVoltage.ConductingEquipment if x != self] + self._BaseVoltage._ConductingEquipment = filtered + + self._BaseVoltage = value + if self._BaseVoltage is not None: + if self not in self._BaseVoltage._ConductingEquipment: + self._BaseVoltage._ConductingEquipment.append(self) + + BaseVoltage = property(getBaseVoltage, setBaseVoltage) + + def getClearanceTags(self): + """Conducting equipment may have multiple clearance tags for authorized field work + """ + return self._ClearanceTags + + def setClearanceTags(self, value): + for x in self._ClearanceTags: + x.ConductingEquipment = None + for y in value: + y._ConductingEquipment = self + self._ClearanceTags = value + + ClearanceTags = property(getClearanceTags, setClearanceTags) + + def addClearanceTags(self, *ClearanceTags): + for obj in ClearanceTags: + obj.ConductingEquipment = self + + def removeClearanceTags(self, *ClearanceTags): + for obj in ClearanceTags: + obj.ConductingEquipment = None + + def getProtectionEquipments(self): + """Protection equipment may be used to protect specific Conducting Equipment. Multiple equipment may be protected or monitored by multiple protection equipment. + """ + return self._ProtectionEquipments + + def setProtectionEquipments(self, value): + for p in self._ProtectionEquipments: + filtered = [q for q in p.ConductingEquipments if q != self] + self._ProtectionEquipments._ConductingEquipments = filtered + for r in value: + if self not in r._ConductingEquipments: + r._ConductingEquipments.append(self) + self._ProtectionEquipments = value + + ProtectionEquipments = property(getProtectionEquipments, setProtectionEquipments) + + def addProtectionEquipments(self, *ProtectionEquipments): + for obj in ProtectionEquipments: + if self not in obj._ConductingEquipments: + obj._ConductingEquipments.append(self) + self._ProtectionEquipments.append(obj) + + def removeProtectionEquipments(self, *ProtectionEquipments): + for obj in ProtectionEquipments: + if self in obj._ConductingEquipments: + obj._ConductingEquipments.remove(self) + self._ProtectionEquipments.remove(obj) + + def getTerminals(self): + """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + """ + return self._Terminals + + def setTerminals(self, value): + for x in self._Terminals: + x.ConductingEquipment = None + for y in value: + y._ConductingEquipment = self + self._Terminals = value + + Terminals = property(getTerminals, setTerminals) + + def addTerminals(self, *Terminals): + for obj in Terminals: + obj.ConductingEquipment = self + + def removeTerminals(self, *Terminals): + for obj in Terminals: + obj.ConductingEquipment = None + + def getOutageStepRoles(self): + + return self._OutageStepRoles + + def setOutageStepRoles(self, value): + for x in self._OutageStepRoles: + x.ConductingEquipment = None + for y in value: + y._ConductingEquipment = self + self._OutageStepRoles = value + + OutageStepRoles = property(getOutageStepRoles, setOutageStepRoles) + + def addOutageStepRoles(self, *OutageStepRoles): + for obj in OutageStepRoles: + obj.ConductingEquipment = self + + def removeOutageStepRoles(self, *OutageStepRoles): + for obj in OutageStepRoles: + obj.ConductingEquipment = None + + def getSvStatus(self): + """The status state associated with the conducting equipment. + """ + return self._SvStatus + + def setSvStatus(self, value): + if self._SvStatus is not None: + self._SvStatus._ConductingEquipment = None + + self._SvStatus = value + if self._SvStatus is not None: + self._SvStatus.ConductingEquipment = None + self._SvStatus._ConductingEquipment = self + + SvStatus = property(getSvStatus, setSvStatus) + diff --git a/CIM16/IEC61970/Core/ConnectivityNode.py b/CIM16/IEC61970/Core/ConnectivityNode.py new file mode 100755 index 00000000..64502518 --- /dev/null +++ b/CIM16/IEC61970/Core/ConnectivityNode.py @@ -0,0 +1,107 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ConnectivityNode(IdentifiedObject): + """Connectivity nodes are points where terminals of conducting equipment are connected together with zero impedance.Connectivity nodes are points where terminals of conducting equipment are connected together with zero impedance. + """ + + def __init__(self, TopologicalNode=None, ConnectivityNodeContainer=None, Terminals=None, *args, **kw_args): + """Initialises a new 'ConnectivityNode' instance. + + @param TopologicalNode: Several ConnectivityNode(s) may combine together to form a single TopologicalNode, depending on the current state of the network. + @param ConnectivityNodeContainer: Container of this connectivity node. + @param Terminals: Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + """ + self._TopologicalNode = None + self.TopologicalNode = TopologicalNode + + self._ConnectivityNodeContainer = None + self.ConnectivityNodeContainer = ConnectivityNodeContainer + + self._Terminals = [] + self.Terminals = [] if Terminals is None else Terminals + + super(ConnectivityNode, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TopologicalNode", "ConnectivityNodeContainer", "Terminals"] + _many_refs = ["Terminals"] + + def getTopologicalNode(self): + """Several ConnectivityNode(s) may combine together to form a single TopologicalNode, depending on the current state of the network. + """ + return self._TopologicalNode + + def setTopologicalNode(self, value): + if self._TopologicalNode is not None: + filtered = [x for x in self.TopologicalNode.ConnectivityNodes if x != self] + self._TopologicalNode._ConnectivityNodes = filtered + + self._TopologicalNode = value + if self._TopologicalNode is not None: + if self not in self._TopologicalNode._ConnectivityNodes: + self._TopologicalNode._ConnectivityNodes.append(self) + + TopologicalNode = property(getTopologicalNode, setTopologicalNode) + + def getConnectivityNodeContainer(self): + """Container of this connectivity node. + """ + return self._ConnectivityNodeContainer + + def setConnectivityNodeContainer(self, value): + if self._ConnectivityNodeContainer is not None: + filtered = [x for x in self.ConnectivityNodeContainer.ConnectivityNodes if x != self] + self._ConnectivityNodeContainer._ConnectivityNodes = filtered + + self._ConnectivityNodeContainer = value + if self._ConnectivityNodeContainer is not None: + if self not in self._ConnectivityNodeContainer._ConnectivityNodes: + self._ConnectivityNodeContainer._ConnectivityNodes.append(self) + + ConnectivityNodeContainer = property(getConnectivityNodeContainer, setConnectivityNodeContainer) + + def getTerminals(self): + """Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + """ + return self._Terminals + + def setTerminals(self, value): + for x in self._Terminals: + x.ConnectivityNode = None + for y in value: + y._ConnectivityNode = self + self._Terminals = value + + Terminals = property(getTerminals, setTerminals) + + def addTerminals(self, *Terminals): + for obj in Terminals: + obj.ConnectivityNode = self + + def removeTerminals(self, *Terminals): + for obj in Terminals: + obj.ConnectivityNode = None + diff --git a/CIM16/IEC61970/Core/ConnectivityNodeContainer.py b/CIM16/IEC61970/Core/ConnectivityNodeContainer.py new file mode 100755 index 00000000..28f285b7 --- /dev/null +++ b/CIM16/IEC61970/Core/ConnectivityNodeContainer.py @@ -0,0 +1,91 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class ConnectivityNodeContainer(PowerSystemResource): + """A base class for all objects that may contain ConnectivityNodes or TopologicalNodes.A base class for all objects that may contain ConnectivityNodes or TopologicalNodes. + """ + + def __init__(self, TopologicalNode=None, ConnectivityNodes=None, *args, **kw_args): + """Initialises a new 'ConnectivityNodeContainer' instance. + + @param TopologicalNode: The topological nodes which belong to this connectivity node container. + @param ConnectivityNodes: Connectivity nodes contained by this container. + """ + self._TopologicalNode = [] + self.TopologicalNode = [] if TopologicalNode is None else TopologicalNode + + self._ConnectivityNodes = [] + self.ConnectivityNodes = [] if ConnectivityNodes is None else ConnectivityNodes + + super(ConnectivityNodeContainer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TopologicalNode", "ConnectivityNodes"] + _many_refs = ["TopologicalNode", "ConnectivityNodes"] + + def getTopologicalNode(self): + """The topological nodes which belong to this connectivity node container. + """ + return self._TopologicalNode + + def setTopologicalNode(self, value): + for x in self._TopologicalNode: + x.ConnectivityNodeContainer = None + for y in value: + y._ConnectivityNodeContainer = self + self._TopologicalNode = value + + TopologicalNode = property(getTopologicalNode, setTopologicalNode) + + def addTopologicalNode(self, *TopologicalNode): + for obj in TopologicalNode: + obj.ConnectivityNodeContainer = self + + def removeTopologicalNode(self, *TopologicalNode): + for obj in TopologicalNode: + obj.ConnectivityNodeContainer = None + + def getConnectivityNodes(self): + """Connectivity nodes contained by this container. + """ + return self._ConnectivityNodes + + def setConnectivityNodes(self, value): + for x in self._ConnectivityNodes: + x.ConnectivityNodeContainer = None + for y in value: + y._ConnectivityNodeContainer = self + self._ConnectivityNodes = value + + ConnectivityNodes = property(getConnectivityNodes, setConnectivityNodes) + + def addConnectivityNodes(self, *ConnectivityNodes): + for obj in ConnectivityNodes: + obj.ConnectivityNodeContainer = self + + def removeConnectivityNodes(self, *ConnectivityNodes): + for obj in ConnectivityNodes: + obj.ConnectivityNodeContainer = None + diff --git a/CIM16/IEC61970/Core/Curve.py b/CIM16/IEC61970/Core/Curve.py new file mode 100755 index 00000000..303785d9 --- /dev/null +++ b/CIM16/IEC61970/Core/Curve.py @@ -0,0 +1,101 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Curve(IdentifiedObject): + """A multi-purpose curve or functional relationship between an independent variable (X-axis) and dependent (Y-axis) variables.A multi-purpose curve or functional relationship between an independent variable (X-axis) and dependent (Y-axis) variables. + """ + + def __init__(self, xUnit="N", y1Multiplier="M", y2Unit="N", y3Multiplier="M", y1Unit="N", xMultiplier="M", y3Unit="N", y2Multiplier="M", curveStyle="formula", CurveDatas=None, *args, **kw_args): + """Initialises a new 'Curve' instance. + + @param xUnit: The X-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param y1Multiplier: Multiplier for Y1-axis Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param y2Unit: The Y2-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param y3Multiplier: Multiplier for Y3-axis. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param y1Unit: The Y1-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param xMultiplier: Multiplier for X-axis. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param y3Unit: The Y3-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param y2Multiplier: Multiplier for Y2-axis. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param curveStyle: The style or shape of the curve. Values are: "formula", "constantYValue", "straightLineYValues", "rampYValue" + @param CurveDatas: The point data values that define a curve + """ + #: The X-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.xUnit = xUnit + + #: Multiplier for Y1-axis Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.y1Multiplier = y1Multiplier + + #: The Y2-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.y2Unit = y2Unit + + #: Multiplier for Y3-axis. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.y3Multiplier = y3Multiplier + + #: The Y1-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.y1Unit = y1Unit + + #: Multiplier for X-axis. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.xMultiplier = xMultiplier + + #: The Y3-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.y3Unit = y3Unit + + #: Multiplier for Y2-axis. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.y2Multiplier = y2Multiplier + + #: The style or shape of the curve. Values are: "formula", "constantYValue", "straightLineYValues", "rampYValue" + self.curveStyle = curveStyle + + self._CurveDatas = [] + self.CurveDatas = [] if CurveDatas is None else CurveDatas + + super(Curve, self).__init__(*args, **kw_args) + + _attrs = ["xUnit", "y1Multiplier", "y2Unit", "y3Multiplier", "y1Unit", "xMultiplier", "y3Unit", "y2Multiplier", "curveStyle"] + _attr_types = {"xUnit": str, "y1Multiplier": str, "y2Unit": str, "y3Multiplier": str, "y1Unit": str, "xMultiplier": str, "y3Unit": str, "y2Multiplier": str, "curveStyle": str} + _defaults = {"xUnit": "N", "y1Multiplier": "M", "y2Unit": "N", "y3Multiplier": "M", "y1Unit": "N", "xMultiplier": "M", "y3Unit": "N", "y2Multiplier": "M", "curveStyle": "formula"} + _enums = {"xUnit": "UnitSymbol", "y1Multiplier": "UnitMultiplier", "y2Unit": "UnitSymbol", "y3Multiplier": "UnitMultiplier", "y1Unit": "UnitSymbol", "xMultiplier": "UnitMultiplier", "y3Unit": "UnitSymbol", "y2Multiplier": "UnitMultiplier", "curveStyle": "CurveStyle"} + _refs = ["CurveDatas"] + _many_refs = ["CurveDatas"] + + def getCurveDatas(self): + """The point data values that define a curve + """ + return self._CurveDatas + + def setCurveDatas(self, value): + for x in self._CurveDatas: + x.Curve = None + for y in value: + y._Curve = self + self._CurveDatas = value + + CurveDatas = property(getCurveDatas, setCurveDatas) + + def addCurveDatas(self, *CurveDatas): + for obj in CurveDatas: + obj.Curve = self + + def removeCurveDatas(self, *CurveDatas): + for obj in CurveDatas: + obj.Curve = None + diff --git a/CIM16/IEC61970/Core/CurveData.py b/CIM16/IEC61970/Core/CurveData.py new file mode 100755 index 00000000..3c1d643e --- /dev/null +++ b/CIM16/IEC61970/Core/CurveData.py @@ -0,0 +1,76 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class CurveData(Element): + """Multi-purpose data points for defining a curve.Multi-purpose data points for defining a curve. + """ + + def __init__(self, y3value=0.0, xvalue=0.0, y2value=0.0, y1value=0.0, Curve=None, *args, **kw_args): + """Initialises a new 'CurveData' instance. + + @param y3value: The data value of the third Y-axis variable (if present), depending on the Y-axis units + @param xvalue: The data value of the X-axis variable, depending on the X-axis units + @param y2value: The data value of the second Y-axis variable (if present), depending on the Y-axis units + @param y1value: The data value of the first Y-axis variable, depending on the Y-axis units + @param Curve: The Curve defined by this CurveData. + """ + #: The data value of the third Y-axis variable (if present), depending on the Y-axis units + self.y3value = y3value + + #: The data value of the X-axis variable, depending on the X-axis units + self.xvalue = xvalue + + #: The data value of the second Y-axis variable (if present), depending on the Y-axis units + self.y2value = y2value + + #: The data value of the first Y-axis variable, depending on the Y-axis units + self.y1value = y1value + + self._Curve = None + self.Curve = Curve + + super(CurveData, self).__init__(*args, **kw_args) + + _attrs = ["y3value", "xvalue", "y2value", "y1value"] + _attr_types = {"y3value": float, "xvalue": float, "y2value": float, "y1value": float} + _defaults = {"y3value": 0.0, "xvalue": 0.0, "y2value": 0.0, "y1value": 0.0} + _enums = {} + _refs = ["Curve"] + _many_refs = [] + + def getCurve(self): + """The Curve defined by this CurveData. + """ + return self._Curve + + def setCurve(self, value): + if self._Curve is not None: + filtered = [x for x in self.Curve.CurveDatas if x != self] + self._Curve._CurveDatas = filtered + + self._Curve = value + if self._Curve is not None: + if self not in self._Curve._CurveDatas: + self._Curve._CurveDatas.append(self) + + Curve = property(getCurve, setCurve) + diff --git a/CIM16/IEC61970/Core/Equipment.py b/CIM16/IEC61970/Core/Equipment.py new file mode 100755 index 00000000..7a1b0cd7 --- /dev/null +++ b/CIM16/IEC61970/Core/Equipment.py @@ -0,0 +1,125 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class Equipment(PowerSystemResource): + """The parts of a power system that are physical devices, electronic or mechanicalThe parts of a power system that are physical devices, electronic or mechanical + """ + + def __init__(self, normallyInService=False, aggregate=False, ContingencyEquipment=None, CustomerAgreements=None, EquipmentContainer=None, *args, **kw_args): + """Initialises a new 'Equipment' instance. + + @param normallyInService: The equipment is normally in service. + @param aggregate: The single instance of equipment represents multiple pieces of equipment that have been modeled together as an aggregate. Examples would be PowerTransformers or SychronousMachines operating in parallel modeled as a single aggregate PowerTransformer or aggregate SynchronousMachine. This is not to be used to indicate equipment that is part of a group of interdependent equipment produced by a network production program. + @param ContingencyEquipment: The contingency element associated with the equipment. + @param CustomerAgreements: + @param EquipmentContainer: The association is used in the naming hierarchy. + """ + #: The equipment is normally in service. + self.normallyInService = normallyInService + + #: The single instance of equipment represents multiple pieces of equipment that have been modeled together as an aggregate. Examples would be PowerTransformers or SychronousMachines operating in parallel modeled as a single aggregate PowerTransformer or aggregate SynchronousMachine. This is not to be used to indicate equipment that is part of a group of interdependent equipment produced by a network production program. + self.aggregate = aggregate + + self._ContingencyEquipment = [] + self.ContingencyEquipment = [] if ContingencyEquipment is None else ContingencyEquipment + + self._CustomerAgreements = [] + self.CustomerAgreements = [] if CustomerAgreements is None else CustomerAgreements + + self._EquipmentContainer = None + self.EquipmentContainer = EquipmentContainer + + super(Equipment, self).__init__(*args, **kw_args) + + _attrs = ["normallyInService", "aggregate"] + _attr_types = {"normallyInService": bool, "aggregate": bool} + _defaults = {"normallyInService": False, "aggregate": False} + _enums = {} + _refs = ["ContingencyEquipment", "CustomerAgreements", "EquipmentContainer"] + _many_refs = ["ContingencyEquipment", "CustomerAgreements"] + + def getContingencyEquipment(self): + """The contingency element associated with the equipment. + """ + return self._ContingencyEquipment + + def setContingencyEquipment(self, value): + for x in self._ContingencyEquipment: + x.Equipment = None + for y in value: + y._Equipment = self + self._ContingencyEquipment = value + + ContingencyEquipment = property(getContingencyEquipment, setContingencyEquipment) + + def addContingencyEquipment(self, *ContingencyEquipment): + for obj in ContingencyEquipment: + obj.Equipment = self + + def removeContingencyEquipment(self, *ContingencyEquipment): + for obj in ContingencyEquipment: + obj.Equipment = None + + def getCustomerAgreements(self): + + return self._CustomerAgreements + + def setCustomerAgreements(self, value): + for p in self._CustomerAgreements: + filtered = [q for q in p.Equipments if q != self] + self._CustomerAgreements._Equipments = filtered + for r in value: + if self not in r._Equipments: + r._Equipments.append(self) + self._CustomerAgreements = value + + CustomerAgreements = property(getCustomerAgreements, setCustomerAgreements) + + def addCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + if self not in obj._Equipments: + obj._Equipments.append(self) + self._CustomerAgreements.append(obj) + + def removeCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + if self in obj._Equipments: + obj._Equipments.remove(self) + self._CustomerAgreements.remove(obj) + + def getEquipmentContainer(self): + """The association is used in the naming hierarchy. + """ + return self._EquipmentContainer + + def setEquipmentContainer(self, value): + if self._EquipmentContainer is not None: + filtered = [x for x in self.EquipmentContainer.Equipments if x != self] + self._EquipmentContainer._Equipments = filtered + + self._EquipmentContainer = value + if self._EquipmentContainer is not None: + if self not in self._EquipmentContainer._Equipments: + self._EquipmentContainer._Equipments.append(self) + + EquipmentContainer = property(getEquipmentContainer, setEquipmentContainer) + diff --git a/CIM16/IEC61970/Core/EquipmentContainer.py b/CIM16/IEC61970/Core/EquipmentContainer.py new file mode 100755 index 00000000..d631db58 --- /dev/null +++ b/CIM16/IEC61970/Core/EquipmentContainer.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConnectivityNodeContainer import ConnectivityNodeContainer + +class EquipmentContainer(ConnectivityNodeContainer): + """A modeling construct to provide a root class for containing equipment.A modeling construct to provide a root class for containing equipment. + """ + + def __init__(self, Equipments=None, *args, **kw_args): + """Initialises a new 'EquipmentContainer' instance. + + @param Equipments: The association is used in the naming hierarchy. + """ + self._Equipments = [] + self.Equipments = [] if Equipments is None else Equipments + + super(EquipmentContainer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Equipments"] + _many_refs = ["Equipments"] + + def getEquipments(self): + """The association is used in the naming hierarchy. + """ + return self._Equipments + + def setEquipments(self, value): + for x in self._Equipments: + x.EquipmentContainer = None + for y in value: + y._EquipmentContainer = self + self._Equipments = value + + Equipments = property(getEquipments, setEquipments) + + def addEquipments(self, *Equipments): + for obj in Equipments: + obj.EquipmentContainer = self + + def removeEquipments(self, *Equipments): + for obj in Equipments: + obj.EquipmentContainer = None + diff --git a/CIM16/IEC61970/Core/GeographicalRegion.py b/CIM16/IEC61970/Core/GeographicalRegion.py new file mode 100755 index 00000000..2b98d643 --- /dev/null +++ b/CIM16/IEC61970/Core/GeographicalRegion.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GeographicalRegion(IdentifiedObject): + """A geographical region of a power system network model.A geographical region of a power system network model. + """ + + def __init__(self, Regions=None, *args, **kw_args): + """Initialises a new 'GeographicalRegion' instance. + + @param Regions: The association is used in the naming hierarchy. + """ + self._Regions = [] + self.Regions = [] if Regions is None else Regions + + super(GeographicalRegion, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Regions"] + _many_refs = ["Regions"] + + def getRegions(self): + """The association is used in the naming hierarchy. + """ + return self._Regions + + def setRegions(self, value): + for x in self._Regions: + x.Region = None + for y in value: + y._Region = self + self._Regions = value + + Regions = property(getRegions, setRegions) + + def addRegions(self, *Regions): + for obj in Regions: + obj.Region = self + + def removeRegions(self, *Regions): + for obj in Regions: + obj.Region = None + diff --git a/CIM16/IEC61970/Core/IdentifiedObject.py b/CIM16/IEC61970/Core/IdentifiedObject.py new file mode 100755 index 00000000..cddf8e7c --- /dev/null +++ b/CIM16/IEC61970/Core/IdentifiedObject.py @@ -0,0 +1,124 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class IdentifiedObject(Element): + """This is a root class to provide common identification for all classes needing identification and naming attributesThis is a root class to provide common identification for all classes needing identification and naming attributes + """ + + def __init__(self, mRID='', aliasName='', name='', Names=None, DiagramObjects=None, ModelingAuthoritySet=None, *args, **kw_args): + """Initialises a new 'IdentifiedObject' instance. + + @param mRID: A Model Authority issues mRIDs. Given that each Model Authority has a unique id and this id is part of the mRID, then the mRID is globally unique. Global uniqeness is easily achived by using a UUID for the mRID. It is strongly recommended to do this. For CIMXML data files the mRID is mapped to rdf:ID or rdf:about attributes that identifies CIM object elements. + @param aliasName: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + @param name: The name is any free human readable and possibly non unique text naming the object. + @param Names: All names of this identified object. + @param DiagramObjects: The diagram objects that are associated with the domain object + @param ModelingAuthoritySet: An IdentifiedObject belongs to a Modeling Authority Set for purposes of defining a group of data maintained by the same Modeling Authority. + """ + #: A Model Authority issues mRIDs. Given that each Model Authority has a unique id and this id is part of the mRID, then the mRID is globally unique. Global uniqeness is easily achived by using a UUID for the mRID. It is strongly recommended to do this. For CIMXML data files the mRID is mapped to rdf:ID or rdf:about attributes that identifies CIM object elements. + self.mRID = mRID + + #: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + self.aliasName = aliasName + + #: The name is any free human readable and possibly non unique text naming the object. + self.name = name + + self._Names = [] + self.Names = [] if Names is None else Names + + self._DiagramObjects = [] + self.DiagramObjects = [] if DiagramObjects is None else DiagramObjects + + self._ModelingAuthoritySet = None + self.ModelingAuthoritySet = ModelingAuthoritySet + + super(IdentifiedObject, self).__init__(*args, **kw_args) + + _attrs = ["mRID", "aliasName", "name"] + _attr_types = {"mRID": str, "aliasName": str, "name": str} + _defaults = {"mRID": '', "aliasName": '', "name": ''} + _enums = {} + _refs = ["Names", "DiagramObjects", "ModelingAuthoritySet"] + _many_refs = ["Names", "DiagramObjects"] + + def getNames(self): + """All names of this identified object. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.IdentifiedObject = None + for y in value: + y._IdentifiedObject = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = self + + def removeNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = None + + def getDiagramObjects(self): + """The diagram objects that are associated with the domain object + """ + return self._DiagramObjects + + def setDiagramObjects(self, value): + for x in self._DiagramObjects: + x.IdentifiedObject = None + for y in value: + y._IdentifiedObject = self + self._DiagramObjects = value + + DiagramObjects = property(getDiagramObjects, setDiagramObjects) + + def addDiagramObjects(self, *DiagramObjects): + for obj in DiagramObjects: + obj.IdentifiedObject = self + + def removeDiagramObjects(self, *DiagramObjects): + for obj in DiagramObjects: + obj.IdentifiedObject = None + + def getModelingAuthoritySet(self): + """An IdentifiedObject belongs to a Modeling Authority Set for purposes of defining a group of data maintained by the same Modeling Authority. + """ + return self._ModelingAuthoritySet + + def setModelingAuthoritySet(self, value): + if self._ModelingAuthoritySet is not None: + filtered = [x for x in self.ModelingAuthoritySet.IdentifiedObjects if x != self] + self._ModelingAuthoritySet._IdentifiedObjects = filtered + + self._ModelingAuthoritySet = value + if self._ModelingAuthoritySet is not None: + if self not in self._ModelingAuthoritySet._IdentifiedObjects: + self._ModelingAuthoritySet._IdentifiedObjects.append(self) + + ModelingAuthoritySet = property(getModelingAuthoritySet, setModelingAuthoritySet) + diff --git a/CIM16/IEC61970/Core/IrregularIntervalSchedule.py b/CIM16/IEC61970/Core/IrregularIntervalSchedule.py new file mode 100755 index 00000000..52b0abbf --- /dev/null +++ b/CIM16/IEC61970/Core/IrregularIntervalSchedule.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.BasicIntervalSchedule import BasicIntervalSchedule + +class IrregularIntervalSchedule(BasicIntervalSchedule): + """The schedule has TimePoints where the time between them varies.The schedule has TimePoints where the time between them varies. + """ + + def __init__(self, TimePoints=None, *args, **kw_args): + """Initialises a new 'IrregularIntervalSchedule' instance. + + @param TimePoints: The point data values that define a curve + """ + self._TimePoints = [] + self.TimePoints = [] if TimePoints is None else TimePoints + + super(IrregularIntervalSchedule, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TimePoints"] + _many_refs = ["TimePoints"] + + def getTimePoints(self): + """The point data values that define a curve + """ + return self._TimePoints + + def setTimePoints(self, value): + for x in self._TimePoints: + x.IntervalSchedule = None + for y in value: + y._IntervalSchedule = self + self._TimePoints = value + + TimePoints = property(getTimePoints, setTimePoints) + + def addTimePoints(self, *TimePoints): + for obj in TimePoints: + obj.IntervalSchedule = self + + def removeTimePoints(self, *TimePoints): + for obj in TimePoints: + obj.IntervalSchedule = None + diff --git a/CIM16/IEC61970/Core/IrregularTimePoint.py b/CIM16/IEC61970/Core/IrregularTimePoint.py new file mode 100755 index 00000000..082daa36 --- /dev/null +++ b/CIM16/IEC61970/Core/IrregularTimePoint.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class IrregularTimePoint(Element): + """TimePoints for a schedule where the time between the points varies.TimePoints for a schedule where the time between the points varies. + """ + + def __init__(self, time=0.0, value1=0.0, value2=0.0, IntervalSchedule=None, *args, **kw_args): + """Initialises a new 'IrregularTimePoint' instance. + + @param time: The time is relative the BasicTimeSchedule.startTime. + @param value1: The first value at the time. The meaning of the value is defined by the class inhering the IrregularIntervalSchedule. + @param value2: The second value at the time. The meaning of the value is defined by the class inhering the IrregularIntervalSchedule. + @param IntervalSchedule: An IrregularTimePoint belongs to an IrregularIntervalSchedule. + """ + #: The time is relative the BasicTimeSchedule.startTime. + self.time = time + + #: The first value at the time. The meaning of the value is defined by the class inhering the IrregularIntervalSchedule. + self.value1 = value1 + + #: The second value at the time. The meaning of the value is defined by the class inhering the IrregularIntervalSchedule. + self.value2 = value2 + + self._IntervalSchedule = None + self.IntervalSchedule = IntervalSchedule + + super(IrregularTimePoint, self).__init__(*args, **kw_args) + + _attrs = ["time", "value1", "value2"] + _attr_types = {"time": float, "value1": float, "value2": float} + _defaults = {"time": 0.0, "value1": 0.0, "value2": 0.0} + _enums = {} + _refs = ["IntervalSchedule"] + _many_refs = [] + + def getIntervalSchedule(self): + """An IrregularTimePoint belongs to an IrregularIntervalSchedule. + """ + return self._IntervalSchedule + + def setIntervalSchedule(self, value): + if self._IntervalSchedule is not None: + filtered = [x for x in self.IntervalSchedule.TimePoints if x != self] + self._IntervalSchedule._TimePoints = filtered + + self._IntervalSchedule = value + if self._IntervalSchedule is not None: + if self not in self._IntervalSchedule._TimePoints: + self._IntervalSchedule._TimePoints.append(self) + + IntervalSchedule = property(getIntervalSchedule, setIntervalSchedule) + diff --git a/CIM16/IEC61970/Core/Name.py b/CIM16/IEC61970/Core/Name.py new file mode 100755 index 00000000..55ce8059 --- /dev/null +++ b/CIM16/IEC61970/Core/Name.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class Name(Element): + """The Name class provides the means to define any number of human readable names for an object. A name is not to be used for defining inter-object relationships. For inter-object relationships instead use the object identification 'mRID'.The Name class provides the means to define any number of human readable names for an object. A name is not to be used for defining inter-object relationships. For inter-object relationships instead use the object identification 'mRID'. + """ + + def __init__(self, name='', NameType=None, IdentifiedObject=None, *args, **kw_args): + """Initialises a new 'Name' instance. + + @param name: Any free text that name the object. + @param NameType: Type of this name. + @param IdentifiedObject: Identified object that this name designates. + """ + #: Any free text that name the object. + self.name = name + + self._NameType = None + self.NameType = NameType + + self._IdentifiedObject = None + self.IdentifiedObject = IdentifiedObject + + super(Name, self).__init__(*args, **kw_args) + + _attrs = ["name"] + _attr_types = {"name": str} + _defaults = {"name": ''} + _enums = {} + _refs = ["NameType", "IdentifiedObject"] + _many_refs = [] + + def getNameType(self): + """Type of this name. + """ + return self._NameType + + def setNameType(self, value): + if self._NameType is not None: + filtered = [x for x in self.NameType.Names if x != self] + self._NameType._Names = filtered + + self._NameType = value + if self._NameType is not None: + if self not in self._NameType._Names: + self._NameType._Names.append(self) + + NameType = property(getNameType, setNameType) + + def getIdentifiedObject(self): + """Identified object that this name designates. + """ + return self._IdentifiedObject + + def setIdentifiedObject(self, value): + if self._IdentifiedObject is not None: + filtered = [x for x in self.IdentifiedObject.Names if x != self] + self._IdentifiedObject._Names = filtered + + self._IdentifiedObject = value + if self._IdentifiedObject is not None: + if self not in self._IdentifiedObject._Names: + self._IdentifiedObject._Names.append(self) + + IdentifiedObject = property(getIdentifiedObject, setIdentifiedObject) + diff --git a/CIM16/IEC61970/Core/NameType.py b/CIM16/IEC61970/Core/NameType.py new file mode 100755 index 00000000..dcc9aba7 --- /dev/null +++ b/CIM16/IEC61970/Core/NameType.py @@ -0,0 +1,94 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class NameType(Element): + """Type of name. Possible values for attribute 'name' are implementation dependent but standard profiles may specify types. An enterprise may have multiple IT systems each having its own local name for the same object, e.g. a planning system may have different names from an EMS. An object may also have different names within the same IT system, e.g. localName and aliasName as defined in CIM version 14. Their definitions from CIM14 are The localName is a human readable name of the object. It is only used with objects organized in a naming hierarchy. localName: A free text name local to a node in a naming hierarchy similar to a file directory structure. A power system related naming hierarchy may be: Substation, VoltageLevel, Equipment etc. Children of the same parent in such a hierarchy have names that typically are unique among them. aliasName: A free text alternate name typically used in tabular reports where the column width is limited.Type of name. Possible values for attribute 'name' are implementation dependent but standard profiles may specify types. An enterprise may have multiple IT systems each having its own local name for the same object, e.g. a planning system may have different names from an EMS. An object may also have different names within the same IT system, e.g. localName and aliasName as defined in CIM version 14. Their definitions from CIM14 are The localName is a human readable name of the object. It is only used with objects organized in a naming hierarchy. localName: A free text name local to a node in a naming hierarchy similar to a file directory structure. A power system related naming hierarchy may be: Substation, VoltageLevel, Equipment etc. Children of the same parent in such a hierarchy have names that typically are unique among them. aliasName: A free text alternate name typically used in tabular reports where the column width is limited. + """ + + def __init__(self, name='', description='', Names=None, NameTypeAuthority=None, *args, **kw_args): + """Initialises a new 'NameType' instance. + + @param name: Name of the name type. + @param description: Description of the name type. + @param Names: All names of this type. + @param NameTypeAuthority: Authority responsible for managing names of this type. + """ + #: Name of the name type. + self.name = name + + #: Description of the name type. + self.description = description + + self._Names = [] + self.Names = [] if Names is None else Names + + self._NameTypeAuthority = None + self.NameTypeAuthority = NameTypeAuthority + + super(NameType, self).__init__(*args, **kw_args) + + _attrs = ["name", "description"] + _attr_types = {"name": str, "description": str} + _defaults = {"name": '', "description": ''} + _enums = {} + _refs = ["Names", "NameTypeAuthority"] + _many_refs = ["Names"] + + def getNames(self): + """All names of this type. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.NameType = None + for y in value: + y._NameType = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.NameType = self + + def removeNames(self, *Names): + for obj in Names: + obj.NameType = None + + def getNameTypeAuthority(self): + """Authority responsible for managing names of this type. + """ + return self._NameTypeAuthority + + def setNameTypeAuthority(self, value): + if self._NameTypeAuthority is not None: + filtered = [x for x in self.NameTypeAuthority.NameTypes if x != self] + self._NameTypeAuthority._NameTypes = filtered + + self._NameTypeAuthority = value + if self._NameTypeAuthority is not None: + if self not in self._NameTypeAuthority._NameTypes: + self._NameTypeAuthority._NameTypes.append(self) + + NameTypeAuthority = property(getNameTypeAuthority, setNameTypeAuthority) + diff --git a/CIM16/IEC61970/Core/NameTypeAuthority.py b/CIM16/IEC61970/Core/NameTypeAuthority.py new file mode 100755 index 00000000..d5af2ef7 --- /dev/null +++ b/CIM16/IEC61970/Core/NameTypeAuthority.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class NameTypeAuthority(Element): + """Authority responsible for creation and management of names of a given type; typically an organization or an enterprise system.Authority responsible for creation and management of names of a given type; typically an organization or an enterprise system. + """ + + def __init__(self, name='', description='', NameTypes=None, *args, **kw_args): + """Initialises a new 'NameTypeAuthority' instance. + + @param name: Name of the name type authority. + @param description: Description of the name type authority. + @param NameTypes: All name types managed by this authority. + """ + #: Name of the name type authority. + self.name = name + + #: Description of the name type authority. + self.description = description + + self._NameTypes = [] + self.NameTypes = [] if NameTypes is None else NameTypes + + super(NameTypeAuthority, self).__init__(*args, **kw_args) + + _attrs = ["name", "description"] + _attr_types = {"name": str, "description": str} + _defaults = {"name": '', "description": ''} + _enums = {} + _refs = ["NameTypes"] + _many_refs = ["NameTypes"] + + def getNameTypes(self): + """All name types managed by this authority. + """ + return self._NameTypes + + def setNameTypes(self, value): + for x in self._NameTypes: + x.NameTypeAuthority = None + for y in value: + y._NameTypeAuthority = self + self._NameTypes = value + + NameTypes = property(getNameTypes, setNameTypes) + + def addNameTypes(self, *NameTypes): + for obj in NameTypes: + obj.NameTypeAuthority = self + + def removeNameTypes(self, *NameTypes): + for obj in NameTypes: + obj.NameTypeAuthority = None + diff --git a/CIM16/IEC61970/Core/OperatingParticipant.py b/CIM16/IEC61970/Core/OperatingParticipant.py new file mode 100755 index 00000000..fb75117e --- /dev/null +++ b/CIM16/IEC61970/Core/OperatingParticipant.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class OperatingParticipant(IdentifiedObject): + """An operator of multiple PowerSystemResource objects. Note multple OperatingParticipants may operate the same PowerSystemResource object. This can be used for modeling jointly owned units where each owner operates as a contractual share.An operator of multiple PowerSystemResource objects. Note multple OperatingParticipants may operate the same PowerSystemResource object. This can be used for modeling jointly owned units where each owner operates as a contractual share. + """ + + def __init__(self, OperatingShare=None, *args, **kw_args): + """Initialises a new 'OperatingParticipant' instance. + + @param OperatingShare: The operating shares of an operating participant. An operating participant can be reused for any number of PSR's. + """ + self._OperatingShare = [] + self.OperatingShare = [] if OperatingShare is None else OperatingShare + + super(OperatingParticipant, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["OperatingShare"] + _many_refs = ["OperatingShare"] + + def getOperatingShare(self): + """The operating shares of an operating participant. An operating participant can be reused for any number of PSR's. + """ + return self._OperatingShare + + def setOperatingShare(self, value): + for x in self._OperatingShare: + x.OperatingParticipant = None + for y in value: + y._OperatingParticipant = self + self._OperatingShare = value + + OperatingShare = property(getOperatingShare, setOperatingShare) + + def addOperatingShare(self, *OperatingShare): + for obj in OperatingShare: + obj.OperatingParticipant = self + + def removeOperatingShare(self, *OperatingShare): + for obj in OperatingShare: + obj.OperatingParticipant = None + diff --git a/CIM16/IEC61970/Core/OperatingShare.py b/CIM16/IEC61970/Core/OperatingShare.py new file mode 100755 index 00000000..9bebcdfb --- /dev/null +++ b/CIM16/IEC61970/Core/OperatingShare.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class OperatingShare(Element): + """Specifies the contract relationship between a PowerSystemResource and a contract participant.Specifies the contract relationship between a PowerSystemResource and a contract participant. + """ + + def __init__(self, percentage=0.0, PowerSystemResource=None, OperatingParticipant=None, *args, **kw_args): + """Initialises a new 'OperatingShare' instance. + + @param percentage: Percentage ownership for this device. The percentage indicates the percentage ownership of the PSROwner for the PowerSystemResource. The total percentage ownership for a PowerSystemResource should add to 100%. + @param PowerSystemResource: The PowerSystemResource to which the attribues apply. The percentage ownership of all owners of a PowerSystemResource should add to 100%. + @param OperatingParticipant: The linkage to a owners and its linkage attributes like percentage ownership. The ownership percentage should add to 100% for all owners of a PowerSystemResource, but a PSROwner may own any percentage of any number of PowerSystemResource objects. + """ + #: Percentage ownership for this device. The percentage indicates the percentage ownership of the PSROwner for the PowerSystemResource. The total percentage ownership for a PowerSystemResource should add to 100%. + self.percentage = percentage + + self._PowerSystemResource = None + self.PowerSystemResource = PowerSystemResource + + self._OperatingParticipant = None + self.OperatingParticipant = OperatingParticipant + + super(OperatingShare, self).__init__(*args, **kw_args) + + _attrs = ["percentage"] + _attr_types = {"percentage": float} + _defaults = {"percentage": 0.0} + _enums = {} + _refs = ["PowerSystemResource", "OperatingParticipant"] + _many_refs = [] + + def getPowerSystemResource(self): + """The PowerSystemResource to which the attribues apply. The percentage ownership of all owners of a PowerSystemResource should add to 100%. + """ + return self._PowerSystemResource + + def setPowerSystemResource(self, value): + if self._PowerSystemResource is not None: + filtered = [x for x in self.PowerSystemResource.OperatingShare if x != self] + self._PowerSystemResource._OperatingShare = filtered + + self._PowerSystemResource = value + if self._PowerSystemResource is not None: + if self not in self._PowerSystemResource._OperatingShare: + self._PowerSystemResource._OperatingShare.append(self) + + PowerSystemResource = property(getPowerSystemResource, setPowerSystemResource) + + def getOperatingParticipant(self): + """The linkage to a owners and its linkage attributes like percentage ownership. The ownership percentage should add to 100% for all owners of a PowerSystemResource, but a PSROwner may own any percentage of any number of PowerSystemResource objects. + """ + return self._OperatingParticipant + + def setOperatingParticipant(self, value): + if self._OperatingParticipant is not None: + filtered = [x for x in self.OperatingParticipant.OperatingShare if x != self] + self._OperatingParticipant._OperatingShare = filtered + + self._OperatingParticipant = value + if self._OperatingParticipant is not None: + if self not in self._OperatingParticipant._OperatingShare: + self._OperatingParticipant._OperatingShare.append(self) + + OperatingParticipant = property(getOperatingParticipant, setOperatingParticipant) + diff --git a/CIM16/IEC61970/Core/PSRType.py b/CIM16/IEC61970/Core/PSRType.py new file mode 100755 index 00000000..3f6bd471 --- /dev/null +++ b/CIM16/IEC61970/Core/PSRType.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PSRType(IdentifiedObject): + """Classifying instances of the same class, e.g. overhead and underground ACLineSegments. This classification mechanism is intended to provide flexibility outside the scope of this standard, i.e. provide customisation that is non standard.Classifying instances of the same class, e.g. overhead and underground ACLineSegments. This classification mechanism is intended to provide flexibility outside the scope of this standard, i.e. provide customisation that is non standard. + """ + + def __init__(self, PowerSystemResources=None, *args, **kw_args): + """Initialises a new 'PSRType' instance. + + @param PowerSystemResources: Power system resources classified with this PSRType. + """ + self._PowerSystemResources = [] + self.PowerSystemResources = [] if PowerSystemResources is None else PowerSystemResources + + super(PSRType, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["PowerSystemResources"] + _many_refs = ["PowerSystemResources"] + + def getPowerSystemResources(self): + """Power system resources classified with this PSRType. + """ + return self._PowerSystemResources + + def setPowerSystemResources(self, value): + for x in self._PowerSystemResources: + x.PSRType = None + for y in value: + y._PSRType = self + self._PowerSystemResources = value + + PowerSystemResources = property(getPowerSystemResources, setPowerSystemResources) + + def addPowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + obj.PSRType = self + + def removePowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + obj.PSRType = None + diff --git a/CIM16/IEC61970/Core/PowerSystemResource.py b/CIM16/IEC61970/Core/PowerSystemResource.py new file mode 100755 index 00000000..e3ec6f77 --- /dev/null +++ b/CIM16/IEC61970/Core/PowerSystemResource.py @@ -0,0 +1,436 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PowerSystemResource(IdentifiedObject): + """A power system resource can be an item of equipment such as a Switch, an EquipmentContainer containing many individual items of equipment such as a Substation, or an organisational entity such as Company or SubControlArea. This provides for the nesting of collections of PowerSystemResources within other PowerSystemResources. For example, a Switch could be a member of a Substation and a Substation could be a member of a division of a Company.A power system resource can be an item of equipment such as a Switch, an EquipmentContainer containing many individual items of equipment such as a Substation, or an organisational entity such as Company or SubControlArea. This provides for the nesting of collections of PowerSystemResources within other PowerSystemResources. For example, a Switch could be a member of a Substation and a Substation could be a member of a division of a Company. + """ + + def __init__(self, ChangeItems=None, ScheduleSteps=None, SafetyDocuments=None, OperatingShare=None, DocumentRoles=None, PsrLists=None, Measurements=None, ReportingGroup=None, PSRType=None, Assets=None, ErpOrganisationRoles=None, Location=None, PSREvent=None, NetworkDataSets=None, OutageSchedule=None, *args, **kw_args): + """Initialises a new 'PowerSystemResource' instance. + + @param ChangeItems: + @param ScheduleSteps: + @param SafetyDocuments: + @param OperatingShare: The linkage to any number of operating share objects. + @param DocumentRoles: + @param PsrLists: + @param Measurements: The Measurements that are included in the naming hierarchy where the PSR is the containing object + @param ReportingGroup: Reporting groups to which this PSR belongs. + @param PSRType: PSRType (custom classification) for this PowerSystemResource. + @param Assets: All assets represented by this power system resource. For example, multiple conductor assets are electrically modelled as a single AC line segment. + @param ErpOrganisationRoles: + @param Location: Location of this power system resource. + @param PSREvent: All events associated with this power system resource. + @param NetworkDataSets: + @param OutageSchedule: A power system resource may have an outage schedule + """ + self._ChangeItems = [] + self.ChangeItems = [] if ChangeItems is None else ChangeItems + + self._ScheduleSteps = [] + self.ScheduleSteps = [] if ScheduleSteps is None else ScheduleSteps + + self._SafetyDocuments = [] + self.SafetyDocuments = [] if SafetyDocuments is None else SafetyDocuments + + self._OperatingShare = [] + self.OperatingShare = [] if OperatingShare is None else OperatingShare + + self._DocumentRoles = [] + self.DocumentRoles = [] if DocumentRoles is None else DocumentRoles + + self._PsrLists = [] + self.PsrLists = [] if PsrLists is None else PsrLists + + self._Measurements = [] + self.Measurements = [] if Measurements is None else Measurements + + self._ReportingGroup = [] + self.ReportingGroup = [] if ReportingGroup is None else ReportingGroup + + self._PSRType = None + self.PSRType = PSRType + + self._Assets = [] + self.Assets = [] if Assets is None else Assets + + self._ErpOrganisationRoles = [] + self.ErpOrganisationRoles = [] if ErpOrganisationRoles is None else ErpOrganisationRoles + + self._Location = None + self.Location = Location + + self._PSREvent = [] + self.PSREvent = [] if PSREvent is None else PSREvent + + self._NetworkDataSets = [] + self.NetworkDataSets = [] if NetworkDataSets is None else NetworkDataSets + + self._OutageSchedule = None + self.OutageSchedule = OutageSchedule + + super(PowerSystemResource, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ChangeItems", "ScheduleSteps", "SafetyDocuments", "OperatingShare", "DocumentRoles", "PsrLists", "Measurements", "ReportingGroup", "PSRType", "Assets", "ErpOrganisationRoles", "Location", "PSREvent", "NetworkDataSets", "OutageSchedule"] + _many_refs = ["ChangeItems", "ScheduleSteps", "SafetyDocuments", "OperatingShare", "DocumentRoles", "PsrLists", "Measurements", "ReportingGroup", "Assets", "ErpOrganisationRoles", "PSREvent", "NetworkDataSets"] + + def getChangeItems(self): + + return self._ChangeItems + + def setChangeItems(self, value): + for x in self._ChangeItems: + x.PowerSystemResource = None + for y in value: + y._PowerSystemResource = self + self._ChangeItems = value + + ChangeItems = property(getChangeItems, setChangeItems) + + def addChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.PowerSystemResource = self + + def removeChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.PowerSystemResource = None + + def getScheduleSteps(self): + + return self._ScheduleSteps + + def setScheduleSteps(self, value): + for p in self._ScheduleSteps: + filtered = [q for q in p.PowerSystemResources if q != self] + self._ScheduleSteps._PowerSystemResources = filtered + for r in value: + if self not in r._PowerSystemResources: + r._PowerSystemResources.append(self) + self._ScheduleSteps = value + + ScheduleSteps = property(getScheduleSteps, setScheduleSteps) + + def addScheduleSteps(self, *ScheduleSteps): + for obj in ScheduleSteps: + if self not in obj._PowerSystemResources: + obj._PowerSystemResources.append(self) + self._ScheduleSteps.append(obj) + + def removeScheduleSteps(self, *ScheduleSteps): + for obj in ScheduleSteps: + if self in obj._PowerSystemResources: + obj._PowerSystemResources.remove(self) + self._ScheduleSteps.remove(obj) + + def getSafetyDocuments(self): + + return self._SafetyDocuments + + def setSafetyDocuments(self, value): + for x in self._SafetyDocuments: + x.PowerSystemResource = None + for y in value: + y._PowerSystemResource = self + self._SafetyDocuments = value + + SafetyDocuments = property(getSafetyDocuments, setSafetyDocuments) + + def addSafetyDocuments(self, *SafetyDocuments): + for obj in SafetyDocuments: + obj.PowerSystemResource = self + + def removeSafetyDocuments(self, *SafetyDocuments): + for obj in SafetyDocuments: + obj.PowerSystemResource = None + + def getOperatingShare(self): + """The linkage to any number of operating share objects. + """ + return self._OperatingShare + + def setOperatingShare(self, value): + for x in self._OperatingShare: + x.PowerSystemResource = None + for y in value: + y._PowerSystemResource = self + self._OperatingShare = value + + OperatingShare = property(getOperatingShare, setOperatingShare) + + def addOperatingShare(self, *OperatingShare): + for obj in OperatingShare: + obj.PowerSystemResource = self + + def removeOperatingShare(self, *OperatingShare): + for obj in OperatingShare: + obj.PowerSystemResource = None + + def getDocumentRoles(self): + + return self._DocumentRoles + + def setDocumentRoles(self, value): + for x in self._DocumentRoles: + x.PowerSystemResource = None + for y in value: + y._PowerSystemResource = self + self._DocumentRoles = value + + DocumentRoles = property(getDocumentRoles, setDocumentRoles) + + def addDocumentRoles(self, *DocumentRoles): + for obj in DocumentRoles: + obj.PowerSystemResource = self + + def removeDocumentRoles(self, *DocumentRoles): + for obj in DocumentRoles: + obj.PowerSystemResource = None + + def getPsrLists(self): + + return self._PsrLists + + def setPsrLists(self, value): + for p in self._PsrLists: + filtered = [q for q in p.PowerSystemResources if q != self] + self._PsrLists._PowerSystemResources = filtered + for r in value: + if self not in r._PowerSystemResources: + r._PowerSystemResources.append(self) + self._PsrLists = value + + PsrLists = property(getPsrLists, setPsrLists) + + def addPsrLists(self, *PsrLists): + for obj in PsrLists: + if self not in obj._PowerSystemResources: + obj._PowerSystemResources.append(self) + self._PsrLists.append(obj) + + def removePsrLists(self, *PsrLists): + for obj in PsrLists: + if self in obj._PowerSystemResources: + obj._PowerSystemResources.remove(self) + self._PsrLists.remove(obj) + + def getMeasurements(self): + """The Measurements that are included in the naming hierarchy where the PSR is the containing object + """ + return self._Measurements + + def setMeasurements(self, value): + for x in self._Measurements: + x.PowerSystemResource = None + for y in value: + y._PowerSystemResource = self + self._Measurements = value + + Measurements = property(getMeasurements, setMeasurements) + + def addMeasurements(self, *Measurements): + for obj in Measurements: + obj.PowerSystemResource = self + + def removeMeasurements(self, *Measurements): + for obj in Measurements: + obj.PowerSystemResource = None + + def getReportingGroup(self): + """Reporting groups to which this PSR belongs. + """ + return self._ReportingGroup + + def setReportingGroup(self, value): + for p in self._ReportingGroup: + filtered = [q for q in p.PowerSystemResource if q != self] + self._ReportingGroup._PowerSystemResource = filtered + for r in value: + if self not in r._PowerSystemResource: + r._PowerSystemResource.append(self) + self._ReportingGroup = value + + ReportingGroup = property(getReportingGroup, setReportingGroup) + + def addReportingGroup(self, *ReportingGroup): + for obj in ReportingGroup: + if self not in obj._PowerSystemResource: + obj._PowerSystemResource.append(self) + self._ReportingGroup.append(obj) + + def removeReportingGroup(self, *ReportingGroup): + for obj in ReportingGroup: + if self in obj._PowerSystemResource: + obj._PowerSystemResource.remove(self) + self._ReportingGroup.remove(obj) + + def getPSRType(self): + """PSRType (custom classification) for this PowerSystemResource. + """ + return self._PSRType + + def setPSRType(self, value): + if self._PSRType is not None: + filtered = [x for x in self.PSRType.PowerSystemResources if x != self] + self._PSRType._PowerSystemResources = filtered + + self._PSRType = value + if self._PSRType is not None: + if self not in self._PSRType._PowerSystemResources: + self._PSRType._PowerSystemResources.append(self) + + PSRType = property(getPSRType, setPSRType) + + def getAssets(self): + """All assets represented by this power system resource. For example, multiple conductor assets are electrically modelled as a single AC line segment. + """ + return self._Assets + + def setAssets(self, value): + for p in self._Assets: + filtered = [q for q in p.PowerSystemResources if q != self] + self._Assets._PowerSystemResources = filtered + for r in value: + if self not in r._PowerSystemResources: + r._PowerSystemResources.append(self) + self._Assets = value + + Assets = property(getAssets, setAssets) + + def addAssets(self, *Assets): + for obj in Assets: + if self not in obj._PowerSystemResources: + obj._PowerSystemResources.append(self) + self._Assets.append(obj) + + def removeAssets(self, *Assets): + for obj in Assets: + if self in obj._PowerSystemResources: + obj._PowerSystemResources.remove(self) + self._Assets.remove(obj) + + def getErpOrganisationRoles(self): + + return self._ErpOrganisationRoles + + def setErpOrganisationRoles(self, value): + for x in self._ErpOrganisationRoles: + x.PowerSystemResource = None + for y in value: + y._PowerSystemResource = self + self._ErpOrganisationRoles = value + + ErpOrganisationRoles = property(getErpOrganisationRoles, setErpOrganisationRoles) + + def addErpOrganisationRoles(self, *ErpOrganisationRoles): + for obj in ErpOrganisationRoles: + obj.PowerSystemResource = self + + def removeErpOrganisationRoles(self, *ErpOrganisationRoles): + for obj in ErpOrganisationRoles: + obj.PowerSystemResource = None + + def getLocation(self): + """Location of this power system resource. + """ + return self._Location + + def setLocation(self, value): + if self._Location is not None: + filtered = [x for x in self.Location.PowerSystemResources if x != self] + self._Location._PowerSystemResources = filtered + + self._Location = value + if self._Location is not None: + if self not in self._Location._PowerSystemResources: + self._Location._PowerSystemResources.append(self) + + Location = property(getLocation, setLocation) + + def getPSREvent(self): + """All events associated with this power system resource. + """ + return self._PSREvent + + def setPSREvent(self, value): + for x in self._PSREvent: + x.PowerSystemResource = None + for y in value: + y._PowerSystemResource = self + self._PSREvent = value + + PSREvent = property(getPSREvent, setPSREvent) + + def addPSREvent(self, *PSREvent): + for obj in PSREvent: + obj.PowerSystemResource = self + + def removePSREvent(self, *PSREvent): + for obj in PSREvent: + obj.PowerSystemResource = None + + def getNetworkDataSets(self): + + return self._NetworkDataSets + + def setNetworkDataSets(self, value): + for p in self._NetworkDataSets: + filtered = [q for q in p.PowerSystemResources if q != self] + self._NetworkDataSets._PowerSystemResources = filtered + for r in value: + if self not in r._PowerSystemResources: + r._PowerSystemResources.append(self) + self._NetworkDataSets = value + + NetworkDataSets = property(getNetworkDataSets, setNetworkDataSets) + + def addNetworkDataSets(self, *NetworkDataSets): + for obj in NetworkDataSets: + if self not in obj._PowerSystemResources: + obj._PowerSystemResources.append(self) + self._NetworkDataSets.append(obj) + + def removeNetworkDataSets(self, *NetworkDataSets): + for obj in NetworkDataSets: + if self in obj._PowerSystemResources: + obj._PowerSystemResources.remove(self) + self._NetworkDataSets.remove(obj) + + def getOutageSchedule(self): + """A power system resource may have an outage schedule + """ + return self._OutageSchedule + + def setOutageSchedule(self, value): + if self._OutageSchedule is not None: + self._OutageSchedule._PowerSystemResource = None + + self._OutageSchedule = value + if self._OutageSchedule is not None: + self._OutageSchedule.PowerSystemResource = None + self._OutageSchedule._PowerSystemResource = self + + OutageSchedule = property(getOutageSchedule, setOutageSchedule) + diff --git a/CIM16/IEC61970/Core/PsrList.py b/CIM16/IEC61970/Core/PsrList.py new file mode 100755 index 00000000..49c524ce --- /dev/null +++ b/CIM16/IEC61970/Core/PsrList.py @@ -0,0 +1,74 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PsrList(IdentifiedObject): + """Arbitrary list of PowerSystemResources. Can be used for various purposes, including grouping for report generation.Arbitrary list of PowerSystemResources. Can be used for various purposes, including grouping for report generation. + """ + + def __init__(self, typePSRList='', PowerSystemResources=None, *args, **kw_args): + """Initialises a new 'PsrList' instance. + + @param typePSRList: Type of power system resources in this list. + @param PowerSystemResources: + """ + #: Type of power system resources in this list. + self.typePSRList = typePSRList + + self._PowerSystemResources = [] + self.PowerSystemResources = [] if PowerSystemResources is None else PowerSystemResources + + super(PsrList, self).__init__(*args, **kw_args) + + _attrs = ["typePSRList"] + _attr_types = {"typePSRList": str} + _defaults = {"typePSRList": ''} + _enums = {} + _refs = ["PowerSystemResources"] + _many_refs = ["PowerSystemResources"] + + def getPowerSystemResources(self): + + return self._PowerSystemResources + + def setPowerSystemResources(self, value): + for p in self._PowerSystemResources: + filtered = [q for q in p.PsrLists if q != self] + self._PowerSystemResources._PsrLists = filtered + for r in value: + if self not in r._PsrLists: + r._PsrLists.append(self) + self._PowerSystemResources = value + + PowerSystemResources = property(getPowerSystemResources, setPowerSystemResources) + + def addPowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + if self not in obj._PsrLists: + obj._PsrLists.append(self) + self._PowerSystemResources.append(obj) + + def removePowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + if self in obj._PsrLists: + obj._PsrLists.remove(self) + self._PowerSystemResources.remove(obj) + diff --git a/CIM16/IEC61970/Core/RegularIntervalSchedule.py b/CIM16/IEC61970/Core/RegularIntervalSchedule.py new file mode 100755 index 00000000..fea9119a --- /dev/null +++ b/CIM16/IEC61970/Core/RegularIntervalSchedule.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.BasicIntervalSchedule import BasicIntervalSchedule + +class RegularIntervalSchedule(BasicIntervalSchedule): + """The schedule has TimePoints where the time between them is constant.The schedule has TimePoints where the time between them is constant. + """ + + def __init__(self, endTime='', timeStep=0.0, TimePoints=None, *args, **kw_args): + """Initialises a new 'RegularIntervalSchedule' instance. + + @param endTime: The time for the last time point. + @param timeStep: The time between each pair of subsequent RegularTimePoints. + @param TimePoints: The point data values that define a curve + """ + #: The time for the last time point. + self.endTime = endTime + + #: The time between each pair of subsequent RegularTimePoints. + self.timeStep = timeStep + + self._TimePoints = [] + self.TimePoints = [] if TimePoints is None else TimePoints + + super(RegularIntervalSchedule, self).__init__(*args, **kw_args) + + _attrs = ["endTime", "timeStep"] + _attr_types = {"endTime": str, "timeStep": float} + _defaults = {"endTime": '', "timeStep": 0.0} + _enums = {} + _refs = ["TimePoints"] + _many_refs = ["TimePoints"] + + def getTimePoints(self): + """The point data values that define a curve + """ + return self._TimePoints + + def setTimePoints(self, value): + for x in self._TimePoints: + x.IntervalSchedule = None + for y in value: + y._IntervalSchedule = self + self._TimePoints = value + + TimePoints = property(getTimePoints, setTimePoints) + + def addTimePoints(self, *TimePoints): + for obj in TimePoints: + obj.IntervalSchedule = self + + def removeTimePoints(self, *TimePoints): + for obj in TimePoints: + obj.IntervalSchedule = None + diff --git a/CIM16/IEC61970/Core/RegularTimePoint.py b/CIM16/IEC61970/Core/RegularTimePoint.py new file mode 100755 index 00000000..aabc0b23 --- /dev/null +++ b/CIM16/IEC61970/Core/RegularTimePoint.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class RegularTimePoint(Element): + """TimePoints for a schedule where the time between the points is constant.TimePoints for a schedule where the time between the points is constant. + """ + + def __init__(self, value2=0.0, value1=0.0, sequenceNumber=0, IntervalSchedule=None, *args, **kw_args): + """Initialises a new 'RegularTimePoint' instance. + + @param value2: The second value at the time. The meaning of the value is defined by the class inhering the RegularIntervalSchedule. + @param value1: The first value at the time. The meaning of the value is defined by the class inhering the RegularIntervalSchedule. + @param sequenceNumber: The position of the RegularTimePoint in the sequence. Note that time points don't have to be sequential, i.e. time points may be omitted. The actual time for a RegularTimePoint is computed by multiplying the RegularIntervalSchedule.timeStep with the RegularTimePoint.sequenceNumber and add the BasicIntervalSchedule.startTime. + @param IntervalSchedule: A RegularTimePoint belongs to a RegularIntervalSchedule. + """ + #: The second value at the time. The meaning of the value is defined by the class inhering the RegularIntervalSchedule. + self.value2 = value2 + + #: The first value at the time. The meaning of the value is defined by the class inhering the RegularIntervalSchedule. + self.value1 = value1 + + #: The position of the RegularTimePoint in the sequence. Note that time points don't have to be sequential, i.e. time points may be omitted. The actual time for a RegularTimePoint is computed by multiplying the RegularIntervalSchedule.timeStep with the RegularTimePoint.sequenceNumber and add the BasicIntervalSchedule.startTime. + self.sequenceNumber = sequenceNumber + + self._IntervalSchedule = None + self.IntervalSchedule = IntervalSchedule + + super(RegularTimePoint, self).__init__(*args, **kw_args) + + _attrs = ["value2", "value1", "sequenceNumber"] + _attr_types = {"value2": float, "value1": float, "sequenceNumber": int} + _defaults = {"value2": 0.0, "value1": 0.0, "sequenceNumber": 0} + _enums = {} + _refs = ["IntervalSchedule"] + _many_refs = [] + + def getIntervalSchedule(self): + """A RegularTimePoint belongs to a RegularIntervalSchedule. + """ + return self._IntervalSchedule + + def setIntervalSchedule(self, value): + if self._IntervalSchedule is not None: + filtered = [x for x in self.IntervalSchedule.TimePoints if x != self] + self._IntervalSchedule._TimePoints = filtered + + self._IntervalSchedule = value + if self._IntervalSchedule is not None: + if self not in self._IntervalSchedule._TimePoints: + self._IntervalSchedule._TimePoints.append(self) + + IntervalSchedule = property(getIntervalSchedule, setIntervalSchedule) + diff --git a/CIM16/IEC61970/Core/ReportingGroup.py b/CIM16/IEC61970/Core/ReportingGroup.py new file mode 100755 index 00000000..c5c57567 --- /dev/null +++ b/CIM16/IEC61970/Core/ReportingGroup.py @@ -0,0 +1,144 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ReportingGroup(IdentifiedObject): + """A reporting group is used for various ad-hoc groupings used for reporting.A reporting group is used for various ad-hoc groupings used for reporting. + """ + + def __init__(self, BusNameMarker=None, ReportingSuperGroup=None, TopologicalNode=None, PowerSystemResource=None, *args, **kw_args): + """Initialises a new 'ReportingGroup' instance. + + @param BusNameMarker: The BusNameMarkers that belong to this reporting group. + @param ReportingSuperGroup: Reporting super group to which this reporting group belongs. + @param TopologicalNode: The topological nodes that belong to the reporting group. + @param PowerSystemResource: PSR's which belong to this reporting group. + """ + self._BusNameMarker = [] + self.BusNameMarker = [] if BusNameMarker is None else BusNameMarker + + self._ReportingSuperGroup = None + self.ReportingSuperGroup = ReportingSuperGroup + + self._TopologicalNode = [] + self.TopologicalNode = [] if TopologicalNode is None else TopologicalNode + + self._PowerSystemResource = [] + self.PowerSystemResource = [] if PowerSystemResource is None else PowerSystemResource + + super(ReportingGroup, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["BusNameMarker", "ReportingSuperGroup", "TopologicalNode", "PowerSystemResource"] + _many_refs = ["BusNameMarker", "TopologicalNode", "PowerSystemResource"] + + def getBusNameMarker(self): + """The BusNameMarkers that belong to this reporting group. + """ + return self._BusNameMarker + + def setBusNameMarker(self, value): + for x in self._BusNameMarker: + x.ReportingGroup = None + for y in value: + y._ReportingGroup = self + self._BusNameMarker = value + + BusNameMarker = property(getBusNameMarker, setBusNameMarker) + + def addBusNameMarker(self, *BusNameMarker): + for obj in BusNameMarker: + obj.ReportingGroup = self + + def removeBusNameMarker(self, *BusNameMarker): + for obj in BusNameMarker: + obj.ReportingGroup = None + + def getReportingSuperGroup(self): + """Reporting super group to which this reporting group belongs. + """ + return self._ReportingSuperGroup + + def setReportingSuperGroup(self, value): + if self._ReportingSuperGroup is not None: + filtered = [x for x in self.ReportingSuperGroup.ReportingGroup if x != self] + self._ReportingSuperGroup._ReportingGroup = filtered + + self._ReportingSuperGroup = value + if self._ReportingSuperGroup is not None: + if self not in self._ReportingSuperGroup._ReportingGroup: + self._ReportingSuperGroup._ReportingGroup.append(self) + + ReportingSuperGroup = property(getReportingSuperGroup, setReportingSuperGroup) + + def getTopologicalNode(self): + """The topological nodes that belong to the reporting group. + """ + return self._TopologicalNode + + def setTopologicalNode(self, value): + for x in self._TopologicalNode: + x.ReportingGroup = None + for y in value: + y._ReportingGroup = self + self._TopologicalNode = value + + TopologicalNode = property(getTopologicalNode, setTopologicalNode) + + def addTopologicalNode(self, *TopologicalNode): + for obj in TopologicalNode: + obj.ReportingGroup = self + + def removeTopologicalNode(self, *TopologicalNode): + for obj in TopologicalNode: + obj.ReportingGroup = None + + def getPowerSystemResource(self): + """PSR's which belong to this reporting group. + """ + return self._PowerSystemResource + + def setPowerSystemResource(self, value): + for p in self._PowerSystemResource: + filtered = [q for q in p.ReportingGroup if q != self] + self._PowerSystemResource._ReportingGroup = filtered + for r in value: + if self not in r._ReportingGroup: + r._ReportingGroup.append(self) + self._PowerSystemResource = value + + PowerSystemResource = property(getPowerSystemResource, setPowerSystemResource) + + def addPowerSystemResource(self, *PowerSystemResource): + for obj in PowerSystemResource: + if self not in obj._ReportingGroup: + obj._ReportingGroup.append(self) + self._PowerSystemResource.append(obj) + + def removePowerSystemResource(self, *PowerSystemResource): + for obj in PowerSystemResource: + if self in obj._ReportingGroup: + obj._ReportingGroup.remove(self) + self._PowerSystemResource.remove(obj) + diff --git a/CIM16/IEC61970/Core/ReportingSuperGroup.py b/CIM16/IEC61970/Core/ReportingSuperGroup.py new file mode 100755 index 00000000..b3df483c --- /dev/null +++ b/CIM16/IEC61970/Core/ReportingSuperGroup.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ReportingSuperGroup(IdentifiedObject): + """A reporting super group, groups reporting groups for a higher level report.A reporting super group, groups reporting groups for a higher level report. + """ + + def __init__(self, ReportingGroup=None, *args, **kw_args): + """Initialises a new 'ReportingSuperGroup' instance. + + @param ReportingGroup: Reporting groups that are grouped under this group group. + """ + self._ReportingGroup = [] + self.ReportingGroup = [] if ReportingGroup is None else ReportingGroup + + super(ReportingSuperGroup, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ReportingGroup"] + _many_refs = ["ReportingGroup"] + + def getReportingGroup(self): + """Reporting groups that are grouped under this group group. + """ + return self._ReportingGroup + + def setReportingGroup(self, value): + for x in self._ReportingGroup: + x.ReportingSuperGroup = None + for y in value: + y._ReportingSuperGroup = self + self._ReportingGroup = value + + ReportingGroup = property(getReportingGroup, setReportingGroup) + + def addReportingGroup(self, *ReportingGroup): + for obj in ReportingGroup: + obj.ReportingSuperGroup = self + + def removeReportingGroup(self, *ReportingGroup): + for obj in ReportingGroup: + obj.ReportingSuperGroup = None + diff --git a/CIM16/IEC61970/Core/SubGeographicalRegion.py b/CIM16/IEC61970/Core/SubGeographicalRegion.py new file mode 100755 index 00000000..cabdf9c2 --- /dev/null +++ b/CIM16/IEC61970/Core/SubGeographicalRegion.py @@ -0,0 +1,112 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class SubGeographicalRegion(IdentifiedObject): + """A subset of a geographical region of a power system network model.A subset of a geographical region of a power system network model. + """ + + def __init__(self, Substations=None, Lines=None, Region=None, *args, **kw_args): + """Initialises a new 'SubGeographicalRegion' instance. + + @param Substations: The association is used in the naming hierarchy. + @param Lines: A Line can be contained by a SubGeographical Region. + @param Region: The association is used in the naming hierarchy. + """ + self._Substations = [] + self.Substations = [] if Substations is None else Substations + + self._Lines = [] + self.Lines = [] if Lines is None else Lines + + self._Region = None + self.Region = Region + + super(SubGeographicalRegion, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Substations", "Lines", "Region"] + _many_refs = ["Substations", "Lines"] + + def getSubstations(self): + """The association is used in the naming hierarchy. + """ + return self._Substations + + def setSubstations(self, value): + for x in self._Substations: + x.Region = None + for y in value: + y._Region = self + self._Substations = value + + Substations = property(getSubstations, setSubstations) + + def addSubstations(self, *Substations): + for obj in Substations: + obj.Region = self + + def removeSubstations(self, *Substations): + for obj in Substations: + obj.Region = None + + def getLines(self): + """A Line can be contained by a SubGeographical Region. + """ + return self._Lines + + def setLines(self, value): + for x in self._Lines: + x.Region = None + for y in value: + y._Region = self + self._Lines = value + + Lines = property(getLines, setLines) + + def addLines(self, *Lines): + for obj in Lines: + obj.Region = self + + def removeLines(self, *Lines): + for obj in Lines: + obj.Region = None + + def getRegion(self): + """The association is used in the naming hierarchy. + """ + return self._Region + + def setRegion(self, value): + if self._Region is not None: + filtered = [x for x in self.Region.Regions if x != self] + self._Region._Regions = filtered + + self._Region = value + if self._Region is not None: + if self not in self._Region._Regions: + self._Region._Regions.append(self) + + Region = property(getRegion, setRegion) + diff --git a/CIM16/IEC61970/Core/Substation.py b/CIM16/IEC61970/Core/Substation.py new file mode 100755 index 00000000..8afb90af --- /dev/null +++ b/CIM16/IEC61970/Core/Substation.py @@ -0,0 +1,112 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class Substation(EquipmentContainer): + """A collection of equipment for purposes other than generation or utilization, through which electric energy in bulk is passed for the purposes of switching or modifying its characteristics.A collection of equipment for purposes other than generation or utilization, through which electric energy in bulk is passed for the purposes of switching or modifying its characteristics. + """ + + def __init__(self, Bays=None, VoltageLevels=None, Region=None, *args, **kw_args): + """Initialises a new 'Substation' instance. + + @param Bays: The association is used in the naming hierarchy. + @param VoltageLevels: The association is used in the naming hierarchy. + @param Region: The association is used in the naming hierarchy. + """ + self._Bays = [] + self.Bays = [] if Bays is None else Bays + + self._VoltageLevels = [] + self.VoltageLevels = [] if VoltageLevels is None else VoltageLevels + + self._Region = None + self.Region = Region + + super(Substation, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Bays", "VoltageLevels", "Region"] + _many_refs = ["Bays", "VoltageLevels"] + + def getBays(self): + """The association is used in the naming hierarchy. + """ + return self._Bays + + def setBays(self, value): + for x in self._Bays: + x.Substation = None + for y in value: + y._Substation = self + self._Bays = value + + Bays = property(getBays, setBays) + + def addBays(self, *Bays): + for obj in Bays: + obj.Substation = self + + def removeBays(self, *Bays): + for obj in Bays: + obj.Substation = None + + def getVoltageLevels(self): + """The association is used in the naming hierarchy. + """ + return self._VoltageLevels + + def setVoltageLevels(self, value): + for x in self._VoltageLevels: + x.Substation = None + for y in value: + y._Substation = self + self._VoltageLevels = value + + VoltageLevels = property(getVoltageLevels, setVoltageLevels) + + def addVoltageLevels(self, *VoltageLevels): + for obj in VoltageLevels: + obj.Substation = self + + def removeVoltageLevels(self, *VoltageLevels): + for obj in VoltageLevels: + obj.Substation = None + + def getRegion(self): + """The association is used in the naming hierarchy. + """ + return self._Region + + def setRegion(self, value): + if self._Region is not None: + filtered = [x for x in self.Region.Substations if x != self] + self._Region._Substations = filtered + + self._Region = value + if self._Region is not None: + if self not in self._Region._Substations: + self._Region._Substations.append(self) + + Region = property(getRegion, setRegion) + diff --git a/CIM16/IEC61970/Core/Terminal.py b/CIM16/IEC61970/Core/Terminal.py new file mode 100755 index 00000000..fa1f7b61 --- /dev/null +++ b/CIM16/IEC61970/Core/Terminal.py @@ -0,0 +1,407 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Terminal(IdentifiedObject): + """An electrical connection point to a piece of conducting equipment. Terminals are connected at physical connection points called 'connectivity nodes'.An electrical connection point to a piece of conducting equipment. Terminals are connected at physical connection points called 'connectivity nodes'. + """ + + def __init__(self, phases="s12N", connected=False, sequenceNumber=0, BushingInfo=None, TieFlow=None, HasSecond_MutualCoupling=None, OperationalLimitSet=None, Measurements=None, ConductingEquipment=None, RegulatingControl=None, HasFirst_MutualCoupling=None, AuxiliaryEquipment=None, TransformerEnd=None, ConnectivityNode=None, BranchGroupTerminal=None, BusNameMarker=None, SvPowerFlow=None, TopologicalNode=None, *args, **kw_args): + """Initialises a new 'Terminal' instance. + + @param phases: Represents the normal network phasing condition. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param connected: The connected status is related to a bus-branch model and the TopologicalNode-Terminal relation. True implies the Terminal is connected to the related TopologicalNode and false implies it is not. In a bus-branch model the connected status is used to tell if equipment is disconnected without having to change the connectivity described by the TopologicalNode-Terminal relation. A valid case is that ConductingEquipment can be connected in one end and open in the other. In particular for an ACLineSegment where the charging can be significant this is a relevant case. + @param sequenceNumber: The orientation of the terminal connections for a multiple terminal conducting equipment. The sequence numbering starts with 1 and additional terminals should follow in increasing order. The first terminal is the 'starting point' for a two terminal branch. In the case of class TransformerWinding only one terminal is used so its sequenceNumber must be 1. + @param BushingInfo: + @param TieFlow: The control area tie flows to which this terminal associates. + @param HasSecond_MutualCoupling: Mutual couplings with the branch associated as the first branch. + @param OperationalLimitSet: The operatinal limits sets that applie specifically to this terminal. Other operational limits sets may apply to this terminal through the association to Equipment. + @param Measurements: One or more measurements may be associated with a terminal in the network. Measurement-Terminal defines where the measurement is placed in the network topology. Some Measurements represent quantities related to a particular sensor position, e.g. a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. The sensing position is captured by the Measurement - Terminal association that makes it possible to place the sensing position at a well defined place. The place is defined by the connection of the Terminal to ConductingEquipment. + @param ConductingEquipment: ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + @param RegulatingControl: The terminal is regulated by a control. + @param HasFirst_MutualCoupling: Mutual couplings associated with the branch as the first branch. + @param AuxiliaryEquipment: + @param TransformerEnd: All transformer ends connected at this external terminal. + @param ConnectivityNode: Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + @param BranchGroupTerminal: The directed branch group terminals for which the terminal is monitored. + @param BusNameMarker: The BusNameMarker used to name the bus (TopologicalNode) with the Terminal having the BusNameMarker. A bus typically have multiple Terminals connected and in of normal topologies Terminals with different BusNameMarker may be connected to the bus. In such cases the BusNameMarker can be arbitrarily selected. + @param SvPowerFlow: The power flow state associated with the terminal. + @param TopologicalNode: The topological node associated with the terminal. This can be used as an alternative to the connectivity node path to topological node, thus making it unneccesary to model connedtivity nodes in some cases. Note that the if connectivity nodes are in the model, this association would proably not be used. + """ + #: Represents the normal network phasing condition. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.phases = phases + + #: The connected status is related to a bus-branch model and the TopologicalNode-Terminal relation. True implies the Terminal is connected to the related TopologicalNode and false implies it is not. In a bus-branch model the connected status is used to tell if equipment is disconnected without having to change the connectivity described by the TopologicalNode-Terminal relation. A valid case is that ConductingEquipment can be connected in one end and open in the other. In particular for an ACLineSegment where the charging can be significant this is a relevant case. + self.connected = connected + + #: The orientation of the terminal connections for a multiple terminal conducting equipment. The sequence numbering starts with 1 and additional terminals should follow in increasing order. The first terminal is the 'starting point' for a two terminal branch. In the case of class TransformerWinding only one terminal is used so its sequenceNumber must be 1. + self.sequenceNumber = sequenceNumber + + self._BushingInfo = None + self.BushingInfo = BushingInfo + + self._TieFlow = [] + self.TieFlow = [] if TieFlow is None else TieFlow + + self._HasSecond_MutualCoupling = [] + self.HasSecond_MutualCoupling = [] if HasSecond_MutualCoupling is None else HasSecond_MutualCoupling + + self._OperationalLimitSet = [] + self.OperationalLimitSet = [] if OperationalLimitSet is None else OperationalLimitSet + + self._Measurements = [] + self.Measurements = [] if Measurements is None else Measurements + + self._ConductingEquipment = None + self.ConductingEquipment = ConductingEquipment + + self._RegulatingControl = [] + self.RegulatingControl = [] if RegulatingControl is None else RegulatingControl + + self._HasFirst_MutualCoupling = [] + self.HasFirst_MutualCoupling = [] if HasFirst_MutualCoupling is None else HasFirst_MutualCoupling + + self._AuxiliaryEquipment = [] + self.AuxiliaryEquipment = [] if AuxiliaryEquipment is None else AuxiliaryEquipment + + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + self._ConnectivityNode = None + self.ConnectivityNode = ConnectivityNode + + self._BranchGroupTerminal = [] + self.BranchGroupTerminal = [] if BranchGroupTerminal is None else BranchGroupTerminal + + self._BusNameMarker = None + self.BusNameMarker = BusNameMarker + + self._SvPowerFlow = None + self.SvPowerFlow = SvPowerFlow + + self._TopologicalNode = None + self.TopologicalNode = TopologicalNode + + super(Terminal, self).__init__(*args, **kw_args) + + _attrs = ["phases", "connected", "sequenceNumber"] + _attr_types = {"phases": str, "connected": bool, "sequenceNumber": int} + _defaults = {"phases": "s12N", "connected": False, "sequenceNumber": 0} + _enums = {"phases": "PhaseCode"} + _refs = ["BushingInfo", "TieFlow", "HasSecond_MutualCoupling", "OperationalLimitSet", "Measurements", "ConductingEquipment", "RegulatingControl", "HasFirst_MutualCoupling", "AuxiliaryEquipment", "TransformerEnd", "ConnectivityNode", "BranchGroupTerminal", "BusNameMarker", "SvPowerFlow", "TopologicalNode"] + _many_refs = ["TieFlow", "HasSecond_MutualCoupling", "OperationalLimitSet", "Measurements", "RegulatingControl", "HasFirst_MutualCoupling", "AuxiliaryEquipment", "TransformerEnd", "BranchGroupTerminal"] + + def getBushingInfo(self): + + return self._BushingInfo + + def setBushingInfo(self, value): + if self._BushingInfo is not None: + self._BushingInfo._Terminal = None + + self._BushingInfo = value + if self._BushingInfo is not None: + self._BushingInfo.Terminal = None + self._BushingInfo._Terminal = self + + BushingInfo = property(getBushingInfo, setBushingInfo) + + def getTieFlow(self): + """The control area tie flows to which this terminal associates. + """ + return self._TieFlow + + def setTieFlow(self, value): + for x in self._TieFlow: + x.Terminal = None + for y in value: + y._Terminal = self + self._TieFlow = value + + TieFlow = property(getTieFlow, setTieFlow) + + def addTieFlow(self, *TieFlow): + for obj in TieFlow: + obj.Terminal = self + + def removeTieFlow(self, *TieFlow): + for obj in TieFlow: + obj.Terminal = None + + def getHasSecond_MutualCoupling(self): + """Mutual couplings with the branch associated as the first branch. + """ + return self._HasSecond_MutualCoupling + + def setHasSecond_MutualCoupling(self, value): + for x in self._HasSecond_MutualCoupling: + x.Second_Terminal = None + for y in value: + y._Second_Terminal = self + self._HasSecond_MutualCoupling = value + + HasSecond_MutualCoupling = property(getHasSecond_MutualCoupling, setHasSecond_MutualCoupling) + + def addHasSecond_MutualCoupling(self, *HasSecond_MutualCoupling): + for obj in HasSecond_MutualCoupling: + obj.Second_Terminal = self + + def removeHasSecond_MutualCoupling(self, *HasSecond_MutualCoupling): + for obj in HasSecond_MutualCoupling: + obj.Second_Terminal = None + + def getOperationalLimitSet(self): + """The operatinal limits sets that applie specifically to this terminal. Other operational limits sets may apply to this terminal through the association to Equipment. + """ + return self._OperationalLimitSet + + def setOperationalLimitSet(self, value): + for x in self._OperationalLimitSet: + x.Terminal = None + for y in value: + y._Terminal = self + self._OperationalLimitSet = value + + OperationalLimitSet = property(getOperationalLimitSet, setOperationalLimitSet) + + def addOperationalLimitSet(self, *OperationalLimitSet): + for obj in OperationalLimitSet: + obj.Terminal = self + + def removeOperationalLimitSet(self, *OperationalLimitSet): + for obj in OperationalLimitSet: + obj.Terminal = None + + def getMeasurements(self): + """One or more measurements may be associated with a terminal in the network. Measurement-Terminal defines where the measurement is placed in the network topology. Some Measurements represent quantities related to a particular sensor position, e.g. a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. The sensing position is captured by the Measurement - Terminal association that makes it possible to place the sensing position at a well defined place. The place is defined by the connection of the Terminal to ConductingEquipment. + """ + return self._Measurements + + def setMeasurements(self, value): + for x in self._Measurements: + x.Terminal = None + for y in value: + y._Terminal = self + self._Measurements = value + + Measurements = property(getMeasurements, setMeasurements) + + def addMeasurements(self, *Measurements): + for obj in Measurements: + obj.Terminal = self + + def removeMeasurements(self, *Measurements): + for obj in Measurements: + obj.Terminal = None + + def getConductingEquipment(self): + """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + """ + return self._ConductingEquipment + + def setConductingEquipment(self, value): + if self._ConductingEquipment is not None: + filtered = [x for x in self.ConductingEquipment.Terminals if x != self] + self._ConductingEquipment._Terminals = filtered + + self._ConductingEquipment = value + if self._ConductingEquipment is not None: + if self not in self._ConductingEquipment._Terminals: + self._ConductingEquipment._Terminals.append(self) + + ConductingEquipment = property(getConductingEquipment, setConductingEquipment) + + def getRegulatingControl(self): + """The terminal is regulated by a control. + """ + return self._RegulatingControl + + def setRegulatingControl(self, value): + for x in self._RegulatingControl: + x.Terminal = None + for y in value: + y._Terminal = self + self._RegulatingControl = value + + RegulatingControl = property(getRegulatingControl, setRegulatingControl) + + def addRegulatingControl(self, *RegulatingControl): + for obj in RegulatingControl: + obj.Terminal = self + + def removeRegulatingControl(self, *RegulatingControl): + for obj in RegulatingControl: + obj.Terminal = None + + def getHasFirst_MutualCoupling(self): + """Mutual couplings associated with the branch as the first branch. + """ + return self._HasFirst_MutualCoupling + + def setHasFirst_MutualCoupling(self, value): + for x in self._HasFirst_MutualCoupling: + x.First_Terminal = None + for y in value: + y._First_Terminal = self + self._HasFirst_MutualCoupling = value + + HasFirst_MutualCoupling = property(getHasFirst_MutualCoupling, setHasFirst_MutualCoupling) + + def addHasFirst_MutualCoupling(self, *HasFirst_MutualCoupling): + for obj in HasFirst_MutualCoupling: + obj.First_Terminal = self + + def removeHasFirst_MutualCoupling(self, *HasFirst_MutualCoupling): + for obj in HasFirst_MutualCoupling: + obj.First_Terminal = None + + def getAuxiliaryEquipment(self): + + return self._AuxiliaryEquipment + + def setAuxiliaryEquipment(self, value): + for x in self._AuxiliaryEquipment: + x.Terminal = None + for y in value: + y._Terminal = self + self._AuxiliaryEquipment = value + + AuxiliaryEquipment = property(getAuxiliaryEquipment, setAuxiliaryEquipment) + + def addAuxiliaryEquipment(self, *AuxiliaryEquipment): + for obj in AuxiliaryEquipment: + obj.Terminal = self + + def removeAuxiliaryEquipment(self, *AuxiliaryEquipment): + for obj in AuxiliaryEquipment: + obj.Terminal = None + + def getTransformerEnd(self): + """All transformer ends connected at this external terminal. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.Terminal = None + for y in value: + y._Terminal = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.Terminal = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.Terminal = None + + def getConnectivityNode(self): + """Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + """ + return self._ConnectivityNode + + def setConnectivityNode(self, value): + if self._ConnectivityNode is not None: + filtered = [x for x in self.ConnectivityNode.Terminals if x != self] + self._ConnectivityNode._Terminals = filtered + + self._ConnectivityNode = value + if self._ConnectivityNode is not None: + if self not in self._ConnectivityNode._Terminals: + self._ConnectivityNode._Terminals.append(self) + + ConnectivityNode = property(getConnectivityNode, setConnectivityNode) + + def getBranchGroupTerminal(self): + """The directed branch group terminals for which the terminal is monitored. + """ + return self._BranchGroupTerminal + + def setBranchGroupTerminal(self, value): + for x in self._BranchGroupTerminal: + x.Terminal = None + for y in value: + y._Terminal = self + self._BranchGroupTerminal = value + + BranchGroupTerminal = property(getBranchGroupTerminal, setBranchGroupTerminal) + + def addBranchGroupTerminal(self, *BranchGroupTerminal): + for obj in BranchGroupTerminal: + obj.Terminal = self + + def removeBranchGroupTerminal(self, *BranchGroupTerminal): + for obj in BranchGroupTerminal: + obj.Terminal = None + + def getBusNameMarker(self): + """The BusNameMarker used to name the bus (TopologicalNode) with the Terminal having the BusNameMarker. A bus typically have multiple Terminals connected and in of normal topologies Terminals with different BusNameMarker may be connected to the bus. In such cases the BusNameMarker can be arbitrarily selected. + """ + return self._BusNameMarker + + def setBusNameMarker(self, value): + if self._BusNameMarker is not None: + filtered = [x for x in self.BusNameMarker.Terminal if x != self] + self._BusNameMarker._Terminal = filtered + + self._BusNameMarker = value + if self._BusNameMarker is not None: + if self not in self._BusNameMarker._Terminal: + self._BusNameMarker._Terminal.append(self) + + BusNameMarker = property(getBusNameMarker, setBusNameMarker) + + def getSvPowerFlow(self): + """The power flow state associated with the terminal. + """ + return self._SvPowerFlow + + def setSvPowerFlow(self, value): + if self._SvPowerFlow is not None: + self._SvPowerFlow._Terminal = None + + self._SvPowerFlow = value + if self._SvPowerFlow is not None: + self._SvPowerFlow.Terminal = None + self._SvPowerFlow._Terminal = self + + SvPowerFlow = property(getSvPowerFlow, setSvPowerFlow) + + def getTopologicalNode(self): + """The topological node associated with the terminal. This can be used as an alternative to the connectivity node path to topological node, thus making it unneccesary to model connedtivity nodes in some cases. Note that the if connectivity nodes are in the model, this association would proably not be used. + """ + return self._TopologicalNode + + def setTopologicalNode(self, value): + if self._TopologicalNode is not None: + filtered = [x for x in self.TopologicalNode.Terminal if x != self] + self._TopologicalNode._Terminal = filtered + + self._TopologicalNode = value + if self._TopologicalNode is not None: + if self not in self._TopologicalNode._Terminal: + self._TopologicalNode._Terminal.append(self) + + TopologicalNode = property(getTopologicalNode, setTopologicalNode) + diff --git a/CIM16/IEC61970/Core/VoltageLevel.py b/CIM16/IEC61970/Core/VoltageLevel.py new file mode 100755 index 00000000..de64e5ca --- /dev/null +++ b/CIM16/IEC61970/Core/VoltageLevel.py @@ -0,0 +1,115 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class VoltageLevel(EquipmentContainer): + """A collection of equipment at one common system voltage forming a switchgear. The equipment typically consist of breakers, busbars, instrumentation, control, regulation and protection devices as well as assemblies of all these.A collection of equipment at one common system voltage forming a switchgear. The equipment typically consist of breakers, busbars, instrumentation, control, regulation and protection devices as well as assemblies of all these. + """ + + def __init__(self, highVoltageLimit=0.0, lowVoltageLimit=0.0, Bays=None, Substation=None, BaseVoltage=None, *args, **kw_args): + """Initialises a new 'VoltageLevel' instance. + + @param highVoltageLimit: The bus bar's high voltage limit + @param lowVoltageLimit: The bus bar's low voltage limit + @param Bays: The association is used in the naming hierarchy. + @param Substation: The association is used in the naming hierarchy. + @param BaseVoltage: The base voltage used for all equipment within the VoltageLevel. + """ + #: The bus bar's high voltage limit + self.highVoltageLimit = highVoltageLimit + + #: The bus bar's low voltage limit + self.lowVoltageLimit = lowVoltageLimit + + self._Bays = [] + self.Bays = [] if Bays is None else Bays + + self._Substation = None + self.Substation = Substation + + self._BaseVoltage = None + self.BaseVoltage = BaseVoltage + + super(VoltageLevel, self).__init__(*args, **kw_args) + + _attrs = ["highVoltageLimit", "lowVoltageLimit"] + _attr_types = {"highVoltageLimit": float, "lowVoltageLimit": float} + _defaults = {"highVoltageLimit": 0.0, "lowVoltageLimit": 0.0} + _enums = {} + _refs = ["Bays", "Substation", "BaseVoltage"] + _many_refs = ["Bays"] + + def getBays(self): + """The association is used in the naming hierarchy. + """ + return self._Bays + + def setBays(self, value): + for x in self._Bays: + x.VoltageLevel = None + for y in value: + y._VoltageLevel = self + self._Bays = value + + Bays = property(getBays, setBays) + + def addBays(self, *Bays): + for obj in Bays: + obj.VoltageLevel = self + + def removeBays(self, *Bays): + for obj in Bays: + obj.VoltageLevel = None + + def getSubstation(self): + """The association is used in the naming hierarchy. + """ + return self._Substation + + def setSubstation(self, value): + if self._Substation is not None: + filtered = [x for x in self.Substation.VoltageLevels if x != self] + self._Substation._VoltageLevels = filtered + + self._Substation = value + if self._Substation is not None: + if self not in self._Substation._VoltageLevels: + self._Substation._VoltageLevels.append(self) + + Substation = property(getSubstation, setSubstation) + + def getBaseVoltage(self): + """The base voltage used for all equipment within the VoltageLevel. + """ + return self._BaseVoltage + + def setBaseVoltage(self, value): + if self._BaseVoltage is not None: + filtered = [x for x in self.BaseVoltage.VoltageLevel if x != self] + self._BaseVoltage._VoltageLevel = filtered + + self._BaseVoltage = value + if self._BaseVoltage is not None: + if self not in self._BaseVoltage._VoltageLevel: + self._BaseVoltage._VoltageLevel.append(self) + + BaseVoltage = property(getBaseVoltage, setBaseVoltage) + diff --git a/CIM16/IEC61970/Core/__init__.py b/CIM16/IEC61970/Core/__init__.py new file mode 100755 index 00000000..b810d5e5 --- /dev/null +++ b/CIM16/IEC61970/Core/__init__.py @@ -0,0 +1,83 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""Contains the core PowerSystemResource and ConductingEquipment entities shared by all applications plus common collections of those entities. Not all applications require all the Core entities. This package does not depend on any other package except the Domain package, but most of the other packages have associations and generalizations that depend on it. +""" + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource +from CIM16.IEC61970.Core.NameTypeAuthority import NameTypeAuthority +from CIM16.IEC61970.Core.Equipment import Equipment +from CIM16.IEC61970.Core.ConductingEquipment import ConductingEquipment +from CIM16.IEC61970.Core.RegularTimePoint import RegularTimePoint +from CIM16.IEC61970.Core.ConnectivityNode import ConnectivityNode +from CIM16.IEC61970.Core.PSRType import PSRType +from CIM16.IEC61970.Core.ConnectivityNodeContainer import ConnectivityNodeContainer +from CIM16.IEC61970.Core.Bay import Bay +from CIM16.IEC61970.Core.EquipmentContainer import EquipmentContainer +from CIM16.IEC61970.Core.ReportingGroup import ReportingGroup +from CIM16.IEC61970.Core.BasePower import BasePower +from CIM16.IEC61970.Core.PsrList import PsrList +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject +from CIM16.IEC61970.Core.BasicIntervalSchedule import BasicIntervalSchedule +from CIM16.IEC61970.Core.Curve import Curve +from CIM16.IEC61970.Core.GeographicalRegion import GeographicalRegion +from CIM16.IEC61970.Core.CurveData import CurveData +from CIM16.IEC61970.Core.SubGeographicalRegion import SubGeographicalRegion +from CIM16.IEC61970.Core.NameType import NameType +from CIM16.IEC61970.Core.Substation import Substation +from CIM16.IEC61970.Core.Name import Name +from CIM16.IEC61970.Core.BaseVoltage import BaseVoltage +from CIM16.IEC61970.Core.Terminal import Terminal +from CIM16.IEC61970.Core.IrregularIntervalSchedule import IrregularIntervalSchedule +from CIM16.IEC61970.Core.RegularIntervalSchedule import RegularIntervalSchedule +from CIM16.IEC61970.Core.OperatingParticipant import OperatingParticipant +from CIM16.IEC61970.Core.OperatingShare import OperatingShare +from CIM16.IEC61970.Core.VoltageLevel import VoltageLevel +from CIM16.IEC61970.Core.ReportingSuperGroup import ReportingSuperGroup +from CIM16.IEC61970.Core.IrregularTimePoint import IrregularTimePoint + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Core" +nsPrefix = "cimCore" + + +class BreakerConfiguration(str): + """Values are: breakerAndAHalf, noBreaker, singleBreaker, doubleBreaker + """ + pass + +class CompanyType(str): + """Values are: municipal, isPrivate, pool + """ + pass + +class PhaseCode(str): + """Values are: s12N, BN, BC, ABN, s2N, N, ACN, BCN, ABCN, AC, s1N, AN, B, AB, C, A, CN, ABC + """ + pass + +class CurveStyle(str): + """Values are: formula, constantYValue, straightLineYValues, rampYValue + """ + pass + +class BusbarConfiguration(str): + """Values are: doubleBus, ringBus, singleBus, mainWithTransfer + """ + pass diff --git a/CIM16/IEC61970/CutsJumpers/Clamp.py b/CIM16/IEC61970/CutsJumpers/Clamp.py new file mode 100755 index 00000000..4e3799eb --- /dev/null +++ b/CIM16/IEC61970/CutsJumpers/Clamp.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Clamp(ConductingEquipment): + """A Clamp is a galvanic connection at a line segment where other equipment is connected. A Clamp does not cut the line segment. A Clamp is ConductingEquipment and has one Terminal with an associated ConnectivityNode. Any other ConductingEquipment can be connected to the Clamp ConnectivityNode.A Clamp is a galvanic connection at a line segment where other equipment is connected. A Clamp does not cut the line segment. A Clamp is ConductingEquipment and has one Terminal with an associated ConnectivityNode. Any other ConductingEquipment can be connected to the Clamp ConnectivityNode. + """ + + def __init__(self, lengthFromTerminal1=0.0, ACLineSegment=None, *args, **kw_args): + """Initialises a new 'Clamp' instance. + + @param lengthFromTerminal1: The length to the place where the cut is located starting from side one of the cut line segment, i.e. the line segment Terminal with sequenceNumber = 1. + @param ACLineSegment: + """ + #: The length to the place where the cut is located starting from side one of the cut line segment, i.e. the line segment Terminal with sequenceNumber = 1. + self.lengthFromTerminal1 = lengthFromTerminal1 + + self._ACLineSegment = None + self.ACLineSegment = ACLineSegment + + super(Clamp, self).__init__(*args, **kw_args) + + _attrs = ["lengthFromTerminal1"] + _attr_types = {"lengthFromTerminal1": float} + _defaults = {"lengthFromTerminal1": 0.0} + _enums = {} + _refs = ["ACLineSegment"] + _many_refs = [] + + def getACLineSegment(self): + + return self._ACLineSegment + + def setACLineSegment(self, value): + if self._ACLineSegment is not None: + filtered = [x for x in self.ACLineSegment.Clamp if x != self] + self._ACLineSegment._Clamp = filtered + + self._ACLineSegment = value + if self._ACLineSegment is not None: + if self not in self._ACLineSegment._Clamp: + self._ACLineSegment._Clamp.append(self) + + ACLineSegment = property(getACLineSegment, setACLineSegment) + diff --git a/CIM16/IEC61970/CutsJumpers/Cut.py b/CIM16/IEC61970/CutsJumpers/Cut.py new file mode 100755 index 00000000..403a900e --- /dev/null +++ b/CIM16/IEC61970/CutsJumpers/Cut.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.Switch import Switch + +class Cut(Switch): + """A Cut separates a line segment into two parts. The Cut appears as a Switch inserted between these two parts and connects them together. As the Cut is normally “open” there is no galvanic connection between the two line segment parts. But it is possible to 'close' the Cut to get galvanic connection. The Cut Terminals are oriented towards the line segment Terminals with the same sequenceNumber. Hence the Cut Terminal with sequenceNumber=1 is oriented to the line segment with Terminal.sequenceNumber=1. The Cut Terminals also act as connection points for jumpers and other equipment, e.g. a mobile generator. To enable this ConnectivityNoces are placed at the Cut Terminals. Once the ConnectivityNodes are in place any ConductingEquipment can be connected at them.A Cut separates a line segment into two parts. The Cut appears as a Switch inserted between these two parts and connects them together. As the Cut is normally “open” there is no galvanic connection between the two line segment parts. But it is possible to 'close' the Cut to get galvanic connection. The Cut Terminals are oriented towards the line segment Terminals with the same sequenceNumber. Hence the Cut Terminal with sequenceNumber=1 is oriented to the line segment with Terminal.sequenceNumber=1. The Cut Terminals also act as connection points for jumpers and other equipment, e.g. a mobile generator. To enable this ConnectivityNoces are placed at the Cut Terminals. Once the ConnectivityNodes are in place any ConductingEquipment can be connected at them. + """ + + def __init__(self, lengthFromTerminal1=0.0, ACLineSegment=None, *args, **kw_args): + """Initialises a new 'Cut' instance. + + @param lengthFromTerminal1: The length to the place where the cut is located starting from side one of the cut line segment, i.e. the line segment Terminal with sequenceNumber = 1. + @param ACLineSegment: + """ + #: The length to the place where the cut is located starting from side one of the cut line segment, i.e. the line segment Terminal with sequenceNumber = 1. + self.lengthFromTerminal1 = lengthFromTerminal1 + + self._ACLineSegment = None + self.ACLineSegment = ACLineSegment + + super(Cut, self).__init__(*args, **kw_args) + + _attrs = ["lengthFromTerminal1"] + _attr_types = {"lengthFromTerminal1": float} + _defaults = {"lengthFromTerminal1": 0.0} + _enums = {} + _refs = ["ACLineSegment"] + _many_refs = [] + + def getACLineSegment(self): + + return self._ACLineSegment + + def setACLineSegment(self, value): + if self._ACLineSegment is not None: + filtered = [x for x in self.ACLineSegment.Cut if x != self] + self._ACLineSegment._Cut = filtered + + self._ACLineSegment = value + if self._ACLineSegment is not None: + if self not in self._ACLineSegment._Cut: + self._ACLineSegment._Cut.append(self) + + ACLineSegment = property(getACLineSegment, setACLineSegment) + diff --git a/CIM16/IEC61970/CutsJumpers/__init__.py b/CIM16/IEC61970/CutsJumpers/__init__.py new file mode 100755 index 00000000..86af6ab7 --- /dev/null +++ b/CIM16/IEC61970/CutsJumpers/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +from CIM16.IEC61970.CutsJumpers.Cut import Cut +from CIM16.IEC61970.CutsJumpers.Clamp import Clamp + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#CutsJumpers" +nsPrefix = "cimCutsJumpers" + diff --git a/CIM16/IEC61970/Domain/DateTimeInterval.py b/CIM16/IEC61970/Domain/DateTimeInterval.py new file mode 100755 index 00000000..02174874 --- /dev/null +++ b/CIM16/IEC61970/Domain/DateTimeInterval.py @@ -0,0 +1,45 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class DateTimeInterval(object): + """Interval of date and time.Interval of date and time. + """ + + def __init__(self, start='', end=''): + """Initialises a new 'DateTimeInterval' instance. + + @param start: Date and time that this interval started. + @param end: Date and time that this interval ended. + """ + #: Date and time that this interval started. + self.start = start + + #: Date and time that this interval ended. + self.end = end + + + _attrs = ["start", "end"] + _attr_types = {"start": str, "end": str} + _defaults = {"start": '', "end": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Domain/__init__.py b/CIM16/IEC61970/Domain/__init__.py new file mode 100755 index 00000000..a522d845 --- /dev/null +++ b/CIM16/IEC61970/Domain/__init__.py @@ -0,0 +1,267 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The domain package define primitive datatypes that are used by classes in other packages. Stereotypes are used to describe the datatypes. The following sterotypes are defined <<enumeration>> A list of permissable constant values. <<Primitive>> The most basic data types that all other data types derive from. <<CIMDataType>> A datatype that contains a value attribute, an optional unit of measure and a unit multiplier. The unit and multiplier are specified as a static variable initialized to the allowed value. <<Compound>> A composite of two or more attributes. +""" + +from CIM16.IEC61970.Domain.DateTimeInterval import DateTimeInterval + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Domain" +nsPrefix = "cimDomain" + + +class UnitSymbol(str): + """Values are: N, A, rad, VAh, Pa, J, h, Hz, VArh, ohm, H, m3, deg, V, oC, F, Wh, s, g, min, S, none, W, VAr, m2, m, VA + """ + pass + +class Currency(str): + """Values are: CAD, EUR, CHF, INR, AUD, USD, RUR, GBP, CNY, SEK, JPY, other, NOK, DKK + """ + pass + +class UnitMultiplier(str): + """Values are: M, G, d, micro, c, p, n, T, k, m, none + """ + pass + +class ReactancePerLength(float): + """Reactance (imaginary part of impedance) per unit of length, at rated frequency. + """ + pass + +class ApparentPower(float): + """Product of the RMS value of the voltage and the RMS value of the current + """ + pass + +class Damping(float): + """Per-unit active power variation with per-unit frequency referenced on the system apparent power base. Typical values in range 1.0 - 2.0. + """ + pass + +class Susceptance(float): + """Imaginary part of admittance. + """ + pass + +class ResistancePerLength(float): + """Resistance (real part of impedance) per unit of length. + """ + pass + +class PU(float): + """Per Unit - a positive or negative value referred to a defined base. Values typically range from -10 to +10. + """ + pass + +class CurrentFlow(float): + """Electrical current (positive flow is out of the ConductingEquipment into the ConnectivityNode) + """ + pass + +class AngleDegrees(float): + """Measurement of angle in degrees + """ + pass + +class CostRate(float): + """Cost, in units of currency, per hour of elapsed time + """ + pass + +class CostPerEnergyUnit(float): + """Cost, in units of currency, per quantity of electrical energy generated. + """ + pass + +class Displacement(float): + """Unit of displacement relative a reference position, hence can be negative. + """ + pass + +class Voltage(float): + """Electrical voltage. + """ + pass + +class Reactance(float): + """Reactance (imaginary part of impedance), at rated frequency. + """ + pass + +class Pressure(float): + """Pressure in Pascal. + """ + pass + +class Temperature(float): + """Value of temperature in degrees Celsius. + """ + pass + +class RotationSpeed(float): + """Number of revolutions per second. + """ + pass + +class SusceptancePerLength(float): + """Imaginary part of admittance per unit of length. + """ + pass + +class StringQuantity(str): + """Quantity with string value (when it is not important whether it is an integral or a floating point number) and associated unit information. + """ + pass + +class ActivePowerChangeRate(float): + pass + +class AbsoluteDate(str): + """Date and time as 'yyyy-mm-dd', which conforms with ISO 8601. UTC time zone is specified as 'yyyy-mm-ddZ'. A local timezone relative UTC is specified as 'yyyy-mm-dd(+/-)hh:mm'. + """ + pass + +class ActivePower(float): + """Product of RMS value of the voltage and the RMS value of the in-phase component of the current + """ + pass + +class Volume(float): + """Volume. + """ + pass + +class Conductance(float): + """Factor by which voltage must be multiplied to give corresponding power lost from a circuit. Real part of admittance. + """ + pass + +class Inductance(float): + """Inductance. + """ + pass + +class ReactivePower(float): + """Product of RMS value of the voltage and the RMS value of the quadrature component of the current. + """ + pass + +class AngleRadians(float): + """Phase angle in radians + """ + pass + +class Frequency(float): + """Cycles per second + """ + pass + +class Capacitance(float): + """A Farad, the typical unit, is the capacitance in which a charge of 1 coulomb produces 1 volt potential difference between its terminals. + """ + pass + +class Money(float): + """Amount of money + """ + pass + +class RealEnergy(float): + """Real electrical energy + """ + pass + +class KWActivePower(float): + """Active power in kilowatts. + """ + pass + +class Minutes(float): + """Time in minutes + """ + pass + +class Impedance(float): + """Ratio of voltage to current. + """ + pass + +class VoltagePerReactivePower(float): + """Voltage variation with reactive power + """ + pass + +class VolumeFlowRate(float): + pass + +class ConductancePerLength(float): + """Real part of admittance per unit of length. + """ + pass + +class PerCent(float): + """Normally 0 - 100 on a defined base + """ + pass + +class Weight(float): + """The weight of an object. + """ + pass + +class Resistance(float): + """Resistance (real part of impedance). + """ + pass + +class Seconds(float): + """Time, in seconds + """ + pass + +class FloatQuantity(float): + """Quantity with float value and associated unit information. + """ + pass + +class WaterLevel(float): + """Reservoir water level referred to a given datum such as mean sea level. + """ + pass + +class Length(float): + """Unit of length. + """ + pass + +class Hours(float): + """Time, in hours + """ + pass + +class IntegerQuantity(str): + """Quantity with integer value and associated unit information. + """ + pass + +class CostPerVolume(float): + pass diff --git a/CIM16/IEC61970/Dynamics/DynamicsFunctionBlock.py b/CIM16/IEC61970/Dynamics/DynamicsFunctionBlock.py new file mode 100755 index 00000000..1e9d34dd --- /dev/null +++ b/CIM16/IEC61970/Dynamics/DynamicsFunctionBlock.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified date: 05/06/2017 + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class DynamicsFunctionBlock(IdentifiedObject): + + def __init__(self, enabled=False, *args, **kw_args): + + self.enabled = enabled + + super(DynamicsFunctionBlock, self).__init__(*args, **kw_args) + + _attrs = ["enabled"] + _attr_types = {"enabled": bool} + _defaults = {"enabled": False} + _enums = {} + _refs = [] + _many_refs = [] + + diff --git a/CIM16/IEC61970/Dynamics/RotatingMachineDynamics.py b/CIM16/IEC61970/Dynamics/RotatingMachineDynamics.py new file mode 100755 index 00000000..c866ee7a --- /dev/null +++ b/CIM16/IEC61970/Dynamics/RotatingMachineDynamics.py @@ -0,0 +1,53 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified date: 05/06/2017 + +from CIM16.IEC61970.Dynamics.DynamicsFunctionBlock import DynamicsFunctionBlock +#unclear what this should refeer to + +class RotatingMachineDynamics(DynamicsFunctionBlock): + + def __init__(self, damping=0.0, inertia=0.0, saturationFactor=0.0, saturationFactor120=0.0, statorLeakageReactance=0.0, statorResistance=0.0, *args, **kw_args): + """Initialises a new 'RotatingMachineDynamics' instance.""" + + self.damping = damping + + self.inertia = inertia + + self.saturationFactor = saturationFactor + + self.saturationFactor120 = saturationFactor120 + + self.statorLeakageReactance = statorLeakageReactance + + self.statorResistance = statorResistance + + super(RotatingMachineDynamics, self).__init__(*args, **kw_args) + + _attrs = ["damping", "inertia", "saturationFactor", "saturationFactor120", "statorLeakageReactance", "statorResistance"] + _attr_types = {"damping": float, "inertia": float,"saturationFactor": float, "saturationFactor120": float, "statorLeakageReactance": float, "statorResistance": float} + _defaults = {"damping": 0.0, "inertia": 0.0,"saturationFactor": 0.0, "saturationFactor120": 0.0, "statorLeakageReactance": 0.0, "statorResistance": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + + diff --git a/CIM16/IEC61970/Dynamics/SynchronousMachineDetailed.py b/CIM16/IEC61970/Dynamics/SynchronousMachineDetailed.py new file mode 100755 index 00000000..3f86ad0f --- /dev/null +++ b/CIM16/IEC61970/Dynamics/SynchronousMachineDetailed.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified date: 05/06/2017 + +from CIM16.IEC61970.Dynamics.SynchronousMachineDynamics import SynchronousMachineDynamics + +class SynchronousMachineDetailed(SynchronousMachineDynamics): + + def __init__(self, efdBaseRatio=0.0, ifdBaseType=None, saturationFactor120QAxis=0.0, saturationFactorQAxis=0.0, *args, **kw_args): + + self.efdBaseRatio = efdBaseRatio + + self.ifdBaseType = ifdBaseType + + self.saturationFactor120QAxis = saturationFactor120QAxis + + self.saturationFactorQAxis = saturationFactorQAxis + + super(SynchronousMachineDetailed, self).__init__(*args, **kw_args) + + _attrs = ["efdBaseRatio", "saturationFactor120QAxis", "saturationFactorQAxis"] + _attr_types = {"efdBaseRatio": float, "saturationFactor120QAxis": float, "saturationFactorQAxis": float} + _defaults = {"efdBaseRatio": 0.0, "saturationFactor120QAxis": 0.0, "saturationFactorQAxis": 0.0} + _enums = {"ifdBaseType": "ifdBaseKind"} + _refs = [] + _many_refs = [] + + diff --git a/CIM16/IEC61970/Dynamics/SynchronousMachineDynamics.py b/CIM16/IEC61970/Dynamics/SynchronousMachineDynamics.py new file mode 100755 index 00000000..f1ca827c --- /dev/null +++ b/CIM16/IEC61970/Dynamics/SynchronousMachineDynamics.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified date: 05/06/2017 + +from CIM16.IEC61970.Dynamics.RotatingMachineDynamics import RotatingMachineDynamics + +class SynchronousMachineDynamics(RotatingMachineDynamics): + + def __init__(self, *args, **kw_args): + + super(SynchronousMachineDynamics, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + + diff --git a/CIM16/IEC61970/Dynamics/SynchronousMachineEquivalentCircuit.py b/CIM16/IEC61970/Dynamics/SynchronousMachineEquivalentCircuit.py new file mode 100755 index 00000000..81d4d83d --- /dev/null +++ b/CIM16/IEC61970/Dynamics/SynchronousMachineEquivalentCircuit.py @@ -0,0 +1,61 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified date: 05/06/2017 + +from CIM16.IEC61970.Dynamics.SynchronousMachineDetailed import SynchronousMachineDetailed + +class SynchronousMachineEquivalentCircuit(SynchronousMachineDetailed): + + def __init__(self, r1d=0.0, r1q=0.0, r2q=0.0, rfd=0.0, x1d=0.0, x1q=0.0, x2q=0.0, xad=0.0, xaq=0.0, xf1d=0.0, xfd=0.0, *args, **kw_args): + + self.r1d = r1d + + self.r1q = r1q + + self. r2q = r2q + + self.rfd = rfd + + self.x1d = x1d + + self.x1q = x1q + + self.x2q = x2q + + self.xad = xad + + self.xaq = xaq + + self.xf1d = xf1d + + self.xfd = xfd + + super(SynchronousMachineEquivalentCircuit, self).__init__(*args, **kw_args) + + _attrs = ["r1d", "r1q", "r2q", "rfd", "x1d", "x1q", "x2q", "xad", "xaq", "xf1d", "xfd"] + _attr_types = {"r1d": float, "r1q": float, "r2q": float, "rfd": float, "x1d": float, "x1q": float, "x2q": float, "xad": float, "xaq": float, "xf1d": float, "xfd": float} + _defaults = {"r1d": 0.0, "r1q": 0.0, "r2q": 0.0, "rfd": 0.0, "x1d": 0.0, "x1q": 0.0, "x2q": 0.0, "xad": 0.0, "xaq": 0.0, "xf1d": 0.0, "xfd": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + + diff --git a/CIM16/IEC61970/Dynamics/SynchronousMachineSimplified.py b/CIM16/IEC61970/Dynamics/SynchronousMachineSimplified.py new file mode 100755 index 00000000..448a4f01 --- /dev/null +++ b/CIM16/IEC61970/Dynamics/SynchronousMachineSimplified.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified date: 05/06/2017 + +from CIM16.IEC61970.Dynamics.SynchronousMachineDynamics import SynchronousMachineDynamics + +class SynchronousMachineSimplified(SynchronousMachineDynamics): + + def __init__(self, *args, **kw_args): + + super(SynchronousMachineSimplified, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + + diff --git a/CIM16/IEC61970/Dynamics/SynchronousMachineTimeConstantReactance.py b/CIM16/IEC61970/Dynamics/SynchronousMachineTimeConstantReactance.py new file mode 100755 index 00000000..0061b812 --- /dev/null +++ b/CIM16/IEC61970/Dynamics/SynchronousMachineTimeConstantReactance.py @@ -0,0 +1,67 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified date: 05/06/2017 + +from CIM16.IEC61970.Dynamics.SynchronousMachineDetailed import SynchronousMachineDetailed + +class SynchronousMachineTimeConstantReactance(SynchronousMachineDetailed): + + def __init__(self, ks=0.0, xDirectSync=0.0, xDirectTrans=0.0, xDirectSubtrans=0.0, xQuadSync=0.0, xQuadTrans=0.0, xQuadSubtrans=0.0, tpdo=0.0, tppdo=0.0, tpqo=0.0, tppqo=0.0, tc=0.0, rotorType=None, modelType=None, *args, **kw_args): + + self.ks = ks + + self.xDirectSync = xDirectSync + + self.xDirectTrans = xDirectTrans + + self.xDirectSubtrans = xDirectSubtrans + + self.xQuadSync = xQuadSync + + self.xQuadTrans =xQuadTrans + + self.xQuadSubtrans = xQuadSubtrans + + self.tpdo = tpdo + + self.tppdo = tppdo + + self.tpqo = tpqo + + self.tppqo = tppqo + + self.tc = tc + + self.rotorType = rotorType + + self.modelType = modelType + + super(SynchronousMachineTimeConstantReactance, self).__init__(*args, **kw_args) + + _attrs = ["ks", "xDirectSync", "xDirectTrans", "xDirectSubtrans", "xQuadSync", "xQuadTrans", "xQuadSubtrans", "tpdo", "tppdo", "tpqo", "tppqo", "tc"] + _attr_types = {"ks": float, "xDirectSync": float, "xDirectTrans": float, "xDirectSubtrans": float, "xQuadSync": float, "xQuadTrans": float, "xQuadSubtrans": float, "tpdo": float, "tppdo": float, "tpqo": float, "tppqo": float, "tc": float} + _defaults = {"ks": 0.0, "xDirectSync": 0.0, "xDirectTrans": 0.0, "xDirectSubtrans": 0.0, "xQuadSync": 0.0, "xQuadTrans": 0.0, "xQuadSubtrans": 0.0, "tpdo": 0.0, "tppdo": 0.0, "tpqo": 0.0, "tppqo": 0.0, "tc": 0.0} + _enums = {"rotorType": "RotorKind", "modelType": "SynchronousMachineModelKind"} + _refs = [] + _many_refs = [] + + diff --git a/CIM16/IEC61970/Dynamics/SynchronousMachineUserDefined.py b/CIM16/IEC61970/Dynamics/SynchronousMachineUserDefined.py new file mode 100755 index 00000000..6733013f --- /dev/null +++ b/CIM16/IEC61970/Dynamics/SynchronousMachineUserDefined.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified date: 05/06/2017 + +from CIM16.IEC61970.Dynamics.SynchronousMachineDynamics import SynchronousMachineDynamics + +class SynchronousMachineUserDefined(SynchronousMachineDynamics): + + def __init__(self, proprietary=False, *args, **kw_args): + + self.proprietary = proprietary + + super(SynchronousMachineUserDefined, self).__init__(*args, **kw_args) + + _attrs = ["proprietary"] + _attr_types = {"proprietary": bool} + _defaults = {"proprietary": False} + _enums = {} + _refs = [] + _many_refs = [] + + diff --git a/CIM16/IEC61970/Dynamics/__init__.py b/CIM16/IEC61970/Dynamics/__init__.py new file mode 100755 index 00000000..83e849ac --- /dev/null +++ b/CIM16/IEC61970/Dynamics/__init__.py @@ -0,0 +1,35 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified date: 05/06/2017 + +from CIM16.IEC61970.Dynamics.DynamicsFunctionBlock import DynamicsFunctionBlock +from CIM16.IEC61970.Dynamics.RotatingMachineDynamics import RotatingMachineDynamics +from CIM16.IEC61970.Dynamics.SynchronousMachineDynamics import SynchronousMachineDynamics +from CIM16.IEC61970.Dynamics.SynchronousMachineUserDefined import SynchronousMachineUserDefined +from CIM16.IEC61970.Dynamics.SynchronousMachineDetailed import SynchronousMachineDetailed +from CIM16.IEC61970.Dynamics.SynchronousMachineSimplified import SynchronousMachineSimplified +from CIM16.IEC61970.Dynamics.SynchronousMachineTimeConstantReactance import SynchronousMachineTimeConstantReactance +from CIM16.IEC61970.Dynamics.SynchronousMachineEquivalentCircuit import SynchronousMachineEquivalentCircuit + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Dynamics" +nsPrefix = "cimDynamics" + diff --git a/CIM16/IEC61970/Equivalents/EquivalentBranch.py b/CIM16/IEC61970/Equivalents/EquivalentBranch.py new file mode 100755 index 00000000..34f8eb3a --- /dev/null +++ b/CIM16/IEC61970/Equivalents/EquivalentBranch.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Equivalents.EquivalentEquipment import EquivalentEquipment + +class EquivalentBranch(EquivalentEquipment): + """The class represents equivalent branches.The class represents equivalent branches. + """ + + def __init__(self, x=0.0, r=0.0, *args, **kw_args): + """Initialises a new 'EquivalentBranch' instance. + + @param x: Positive sequence series reactance of the reduced branch. + @param r: Positive sequence series resistance of the reduced branch. + """ + #: Positive sequence series reactance of the reduced branch. + self.x = x + + #: Positive sequence series resistance of the reduced branch. + self.r = r + + super(EquivalentBranch, self).__init__(*args, **kw_args) + + _attrs = ["x", "r"] + _attr_types = {"x": float, "r": float} + _defaults = {"x": 0.0, "r": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Equivalents/EquivalentEquipment.py b/CIM16/IEC61970/Equivalents/EquivalentEquipment.py new file mode 100755 index 00000000..31ec375e --- /dev/null +++ b/CIM16/IEC61970/Equivalents/EquivalentEquipment.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class EquivalentEquipment(ConductingEquipment): + """The class represents equivalent objects that are the result of a network reduction. The class is the base for equivalent objects of different types.The class represents equivalent objects that are the result of a network reduction. The class is the base for equivalent objects of different types. + """ + + def __init__(self, EquivalentNetwork=None, *args, **kw_args): + """Initialises a new 'EquivalentEquipment' instance. + + @param EquivalentNetwork: The equivalent where the reduced model belongs. + """ + self._EquivalentNetwork = None + self.EquivalentNetwork = EquivalentNetwork + + super(EquivalentEquipment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["EquivalentNetwork"] + _many_refs = [] + + def getEquivalentNetwork(self): + """The equivalent where the reduced model belongs. + """ + return self._EquivalentNetwork + + def setEquivalentNetwork(self, value): + if self._EquivalentNetwork is not None: + filtered = [x for x in self.EquivalentNetwork.EquivalentEquipments if x != self] + self._EquivalentNetwork._EquivalentEquipments = filtered + + self._EquivalentNetwork = value + if self._EquivalentNetwork is not None: + if self not in self._EquivalentNetwork._EquivalentEquipments: + self._EquivalentNetwork._EquivalentEquipments.append(self) + + EquivalentNetwork = property(getEquivalentNetwork, setEquivalentNetwork) + diff --git a/CIM16/IEC61970/Equivalents/EquivalentInjection.py b/CIM16/IEC61970/Equivalents/EquivalentInjection.py new file mode 100755 index 00000000..26280412 --- /dev/null +++ b/CIM16/IEC61970/Equivalents/EquivalentInjection.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Equivalents.EquivalentEquipment import EquivalentEquipment + +class EquivalentInjection(EquivalentEquipment): + """This class represents equivalent injections (generation or load). Voltage regulation is allowed only at the local connectivity node.This class represents equivalent injections (generation or load). Voltage regulation is allowed only at the local connectivity node. + """ + + def __init__(self, regulationCapability=False, maxP=0.0, regulationStatus=False, regulationTarget=0.0, minP=0.0, *args, **kw_args): + """Initialises a new 'EquivalentInjection' instance. + + @param regulationCapability: Specifies whether or not the EquivalentInjection has the capability to regulate the local voltage. + @param maxP: Minimum active power of the injection. + @param regulationStatus: Specifies the default regulation status of the EquivalentInjection. True is regulating. False is not regulating. + @param regulationTarget: The target voltage for voltage regulation. + @param minP: Maximum active power of the injection. + """ + #: Specifies whether or not the EquivalentInjection has the capability to regulate the local voltage. + self.regulationCapability = regulationCapability + + #: Minimum active power of the injection. + self.maxP = maxP + + #: Specifies the default regulation status of the EquivalentInjection. True is regulating. False is not regulating. + self.regulationStatus = regulationStatus + + #: The target voltage for voltage regulation. + self.regulationTarget = regulationTarget + + #: Maximum active power of the injection. + self.minP = minP + + super(EquivalentInjection, self).__init__(*args, **kw_args) + + _attrs = ["regulationCapability", "maxP", "regulationStatus", "regulationTarget", "minP"] + _attr_types = {"regulationCapability": bool, "maxP": float, "regulationStatus": bool, "regulationTarget": float, "minP": float} + _defaults = {"regulationCapability": False, "maxP": 0.0, "regulationStatus": False, "regulationTarget": 0.0, "minP": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Equivalents/EquivalentNetwork.py b/CIM16/IEC61970/Equivalents/EquivalentNetwork.py new file mode 100755 index 00000000..aa5c35b6 --- /dev/null +++ b/CIM16/IEC61970/Equivalents/EquivalentNetwork.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConnectivityNodeContainer import ConnectivityNodeContainer + +class EquivalentNetwork(ConnectivityNodeContainer): + """A class that represents an external meshed network that has been reduced to an electrically equivalent model. The ConnectivityNodes contained in the equivalent are intended to reflect internal nodes of the equivalent. The boundary Connectivity nodes where the equivalent connects outside itself are NOT contained by the equivalent.A class that represents an external meshed network that has been reduced to an electrically equivalent model. The ConnectivityNodes contained in the equivalent are intended to reflect internal nodes of the equivalent. The boundary Connectivity nodes where the equivalent connects outside itself are NOT contained by the equivalent. + """ + + def __init__(self, EquivalentEquipments=None, *args, **kw_args): + """Initialises a new 'EquivalentNetwork' instance. + + @param EquivalentEquipments: The associated reduced equivalents. + """ + self._EquivalentEquipments = [] + self.EquivalentEquipments = [] if EquivalentEquipments is None else EquivalentEquipments + + super(EquivalentNetwork, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["EquivalentEquipments"] + _many_refs = ["EquivalentEquipments"] + + def getEquivalentEquipments(self): + """The associated reduced equivalents. + """ + return self._EquivalentEquipments + + def setEquivalentEquipments(self, value): + for x in self._EquivalentEquipments: + x.EquivalentNetwork = None + for y in value: + y._EquivalentNetwork = self + self._EquivalentEquipments = value + + EquivalentEquipments = property(getEquivalentEquipments, setEquivalentEquipments) + + def addEquivalentEquipments(self, *EquivalentEquipments): + for obj in EquivalentEquipments: + obj.EquivalentNetwork = self + + def removeEquivalentEquipments(self, *EquivalentEquipments): + for obj in EquivalentEquipments: + obj.EquivalentNetwork = None + diff --git a/CIM16/IEC61970/Equivalents/EquivalentShunt.py b/CIM16/IEC61970/Equivalents/EquivalentShunt.py new file mode 100755 index 00000000..fc2489ce --- /dev/null +++ b/CIM16/IEC61970/Equivalents/EquivalentShunt.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Equivalents.EquivalentEquipment import EquivalentEquipment + +class EquivalentShunt(EquivalentEquipment): + """The class represents equivalent shunts.The class represents equivalent shunts. + """ + + def __init__(self, b=0.0, g=0.0, *args, **kw_args): + """Initialises a new 'EquivalentShunt' instance. + + @param b: Positive sequence shunt susceptance. + @param g: Positive sequence shunt conductance. + """ + #: Positive sequence shunt susceptance. + self.b = b + + #: Positive sequence shunt conductance. + self.g = g + + super(EquivalentShunt, self).__init__(*args, **kw_args) + + _attrs = ["b", "g"] + _attr_types = {"b": float, "g": float} + _defaults = {"b": 0.0, "g": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Equivalents/__init__.py b/CIM16/IEC61970/Equivalents/__init__.py new file mode 100755 index 00000000..ec2eb757 --- /dev/null +++ b/CIM16/IEC61970/Equivalents/__init__.py @@ -0,0 +1,32 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The equivalents package models equivalent networks. +""" + +from CIM16.IEC61970.Equivalents.EquivalentShunt import EquivalentShunt +from CIM16.IEC61970.Equivalents.EquivalentEquipment import EquivalentEquipment +from CIM16.IEC61970.Equivalents.EquivalentNetwork import EquivalentNetwork +from CIM16.IEC61970.Equivalents.EquivalentInjection import EquivalentInjection +from CIM16.IEC61970.Equivalents.EquivalentBranch import EquivalentBranch + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Equivalents" +nsPrefix = "cimEquivalents" + diff --git a/CIM16/IEC61970/Generation/GenerationDynamics/BWRSteamSupply.py b/CIM16/IEC61970/Generation/GenerationDynamics/BWRSteamSupply.py new file mode 100755 index 00000000..47545e77 --- /dev/null +++ b/CIM16/IEC61970/Generation/GenerationDynamics/BWRSteamSupply.py @@ -0,0 +1,123 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Generation.GenerationDynamics.SteamSupply import SteamSupply + +class BWRSteamSupply(SteamSupply): + """Boiling water reactor used as a steam supply to a steam turbineBoiling water reactor used as a steam supply to a steam turbine + """ + + def __init__(self, lowerLimit=0.0, pressureSetpointTC1=0.0, pressureSetpointTC2=0.0, rodPattern=0.0, pressureSetpointGA=0.0, upperLimit=0.0, pressureLimit=0.0, rfAux5=0.0, rfAux6=0.0, rfAux3=0.0, rodPatternConstant=0.0, rfAux4=0.0, rfAux7=0.0, rfAux8=0.0, highPowerLimit=0.0, rfAux1=0.0, inCoreThermalTC=0.0, rfAux2=0.0, proportionalGain=0.0, lowPowerLimit=0.0, integralGain=0.0, *args, **kw_args): + """Initialises a new 'BWRSteamSupply' instance. + + @param lowerLimit: Initial Lower Limit + @param pressureSetpointTC1: Pressure Setpoint Time Constant + @param pressureSetpointTC2: Pressure Setpoint Time Constant + @param rodPattern: Rod Pattern + @param pressureSetpointGA: Pressure Setpoint Gain Adjuster + @param upperLimit: Initial Upper Limit + @param pressureLimit: Pressure Limit + @param rfAux5: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + @param rfAux6: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + @param rfAux3: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + @param rodPatternConstant: Constant Associated With Rod Pattern + @param rfAux4: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + @param rfAux7: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + @param rfAux8: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + @param highPowerLimit: High Power Limit + @param rfAux1: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + @param inCoreThermalTC: In-Core Thermal Time Constant + @param rfAux2: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + @param proportionalGain: Proportional Gain + @param lowPowerLimit: Low Power Limit + @param integralGain: Integral Gain + """ + #: Initial Lower Limit + self.lowerLimit = lowerLimit + + #: Pressure Setpoint Time Constant + self.pressureSetpointTC1 = pressureSetpointTC1 + + #: Pressure Setpoint Time Constant + self.pressureSetpointTC2 = pressureSetpointTC2 + + #: Rod Pattern + self.rodPattern = rodPattern + + #: Pressure Setpoint Gain Adjuster + self.pressureSetpointGA = pressureSetpointGA + + #: Initial Upper Limit + self.upperLimit = upperLimit + + #: Pressure Limit + self.pressureLimit = pressureLimit + + #: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + self.rfAux5 = rfAux5 + + #: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + self.rfAux6 = rfAux6 + + #: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + self.rfAux3 = rfAux3 + + #: Constant Associated With Rod Pattern + self.rodPatternConstant = rodPatternConstant + + #: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + self.rfAux4 = rfAux4 + + #: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + self.rfAux7 = rfAux7 + + #: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + self.rfAux8 = rfAux8 + + #: High Power Limit + self.highPowerLimit = highPowerLimit + + #: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + self.rfAux1 = rfAux1 + + #: In-Core Thermal Time Constant + self.inCoreThermalTC = inCoreThermalTC + + #: Coefficient for modeling the effect of off-nominal frequency and voltage on recirculation and core flow, which affects the BWR power output. + self.rfAux2 = rfAux2 + + #: Proportional Gain + self.proportionalGain = proportionalGain + + #: Low Power Limit + self.lowPowerLimit = lowPowerLimit + + #: Integral Gain + self.integralGain = integralGain + + super(BWRSteamSupply, self).__init__(*args, **kw_args) + + _attrs = ["lowerLimit", "pressureSetpointTC1", "pressureSetpointTC2", "rodPattern", "pressureSetpointGA", "upperLimit", "pressureLimit", "rfAux5", "rfAux6", "rfAux3", "rodPatternConstant", "rfAux4", "rfAux7", "rfAux8", "highPowerLimit", "rfAux1", "inCoreThermalTC", "rfAux2", "proportionalGain", "lowPowerLimit", "integralGain"] + _attr_types = {"lowerLimit": float, "pressureSetpointTC1": float, "pressureSetpointTC2": float, "rodPattern": float, "pressureSetpointGA": float, "upperLimit": float, "pressureLimit": float, "rfAux5": float, "rfAux6": float, "rfAux3": float, "rodPatternConstant": float, "rfAux4": float, "rfAux7": float, "rfAux8": float, "highPowerLimit": float, "rfAux1": float, "inCoreThermalTC": float, "rfAux2": float, "proportionalGain": float, "lowPowerLimit": float, "integralGain": float} + _defaults = {"lowerLimit": 0.0, "pressureSetpointTC1": 0.0, "pressureSetpointTC2": 0.0, "rodPattern": 0.0, "pressureSetpointGA": 0.0, "upperLimit": 0.0, "pressureLimit": 0.0, "rfAux5": 0.0, "rfAux6": 0.0, "rfAux3": 0.0, "rodPatternConstant": 0.0, "rfAux4": 0.0, "rfAux7": 0.0, "rfAux8": 0.0, "highPowerLimit": 0.0, "rfAux1": 0.0, "inCoreThermalTC": 0.0, "rfAux2": 0.0, "proportionalGain": 0.0, "lowPowerLimit": 0.0, "integralGain": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Generation/GenerationDynamics/CTTempActivePowerCurve.py b/CIM16/IEC61970/Generation/GenerationDynamics/CTTempActivePowerCurve.py new file mode 100755 index 00000000..47a9201d --- /dev/null +++ b/CIM16/IEC61970/Generation/GenerationDynamics/CTTempActivePowerCurve.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class CTTempActivePowerCurve(Curve): + """Relationship between the combustion turbine's power output rating in gross active power (X-axis) and the ambient air temperature (Y-axis)Relationship between the combustion turbine's power output rating in gross active power (X-axis) and the ambient air temperature (Y-axis) + """ + + def __init__(self, CombustionTurbine=None, *args, **kw_args): + """Initialises a new 'CTTempActivePowerCurve' instance. + + @param CombustionTurbine: A combustion turbine may have an active power versus ambient temperature relationship + """ + self._CombustionTurbine = None + self.CombustionTurbine = CombustionTurbine + + super(CTTempActivePowerCurve, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["CombustionTurbine"] + _many_refs = [] + + def getCombustionTurbine(self): + """A combustion turbine may have an active power versus ambient temperature relationship + """ + return self._CombustionTurbine + + def setCombustionTurbine(self, value): + if self._CombustionTurbine is not None: + self._CombustionTurbine._CTTempActivePowerCurve = None + + self._CombustionTurbine = value + if self._CombustionTurbine is not None: + self._CombustionTurbine.CTTempActivePowerCurve = None + self._CombustionTurbine._CTTempActivePowerCurve = self + + CombustionTurbine = property(getCombustionTurbine, setCombustionTurbine) + diff --git a/CIM16/IEC61970/Generation/GenerationDynamics/CombustionTurbine.py b/CIM16/IEC61970/Generation/GenerationDynamics/CombustionTurbine.py new file mode 100755 index 00000000..8f38c15f --- /dev/null +++ b/CIM16/IEC61970/Generation/GenerationDynamics/CombustionTurbine.py @@ -0,0 +1,132 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Generation.GenerationDynamics.PrimeMover import PrimeMover + +class CombustionTurbine(PrimeMover): + """A prime mover that is typically fueled by gas or light oilA prime mover that is typically fueled by gas or light oil + """ + + def __init__(self, capabilityVersusFrequency=0.0, referenceTemp=0.0, auxPowerVersusFrequency=0.0, powerVariationByTemp=0.0, auxPowerVersusVoltage=0.0, timeConstant=0.0, heatRecoveryFlag=False, ambientTemp=0.0, HeatRecoveryBoiler=None, AirCompressor=None, CTTempActivePowerCurve=None, *args, **kw_args): + """Initialises a new 'CombustionTurbine' instance. + + @param capabilityVersusFrequency: Off-nominal frequency effect on turbine capability. Per unit reduction in unit active power capability versus per unit reduction in frequency (from rated frequency). + @param referenceTemp: Reference temperature at which the output of the turbine was defined. + @param auxPowerVersusFrequency: Off-nominal frequency effect on turbine auxiliaries. Per unit reduction in auxiliary active power consumption versus per unit reduction in frequency (from rated frequency). + @param powerVariationByTemp: Per unit change in power per (versus) unit change in ambient temperature + @param auxPowerVersusVoltage: Off-nominal voltage effect on turbine auxiliaries. Per unit reduction in auxiliary active power consumption versus per unit reduction in auxiliary bus voltage (from a specified voltage level). + @param timeConstant: The time constant for the turbine. + @param heatRecoveryFlag: Flag that is set to true if the combustion turbine is associated with a heat recovery boiler + @param ambientTemp: Default ambient temperature to be used in modeling applications + @param HeatRecoveryBoiler: A combustion turbine may have a heat recovery boiler for making steam + @param AirCompressor: A CAES air compressor is driven by combustion turbine + @param CTTempActivePowerCurve: A combustion turbine may have an active power versus ambient temperature relationship + """ + #: Off-nominal frequency effect on turbine capability. Per unit reduction in unit active power capability versus per unit reduction in frequency (from rated frequency). + self.capabilityVersusFrequency = capabilityVersusFrequency + + #: Reference temperature at which the output of the turbine was defined. + self.referenceTemp = referenceTemp + + #: Off-nominal frequency effect on turbine auxiliaries. Per unit reduction in auxiliary active power consumption versus per unit reduction in frequency (from rated frequency). + self.auxPowerVersusFrequency = auxPowerVersusFrequency + + #: Per unit change in power per (versus) unit change in ambient temperature + self.powerVariationByTemp = powerVariationByTemp + + #: Off-nominal voltage effect on turbine auxiliaries. Per unit reduction in auxiliary active power consumption versus per unit reduction in auxiliary bus voltage (from a specified voltage level). + self.auxPowerVersusVoltage = auxPowerVersusVoltage + + #: The time constant for the turbine. + self.timeConstant = timeConstant + + #: Flag that is set to true if the combustion turbine is associated with a heat recovery boiler + self.heatRecoveryFlag = heatRecoveryFlag + + #: Default ambient temperature to be used in modeling applications + self.ambientTemp = ambientTemp + + self._HeatRecoveryBoiler = None + self.HeatRecoveryBoiler = HeatRecoveryBoiler + + self._AirCompressor = None + self.AirCompressor = AirCompressor + + self._CTTempActivePowerCurve = None + self.CTTempActivePowerCurve = CTTempActivePowerCurve + + super(CombustionTurbine, self).__init__(*args, **kw_args) + + _attrs = ["capabilityVersusFrequency", "referenceTemp", "auxPowerVersusFrequency", "powerVariationByTemp", "auxPowerVersusVoltage", "timeConstant", "heatRecoveryFlag", "ambientTemp"] + _attr_types = {"capabilityVersusFrequency": float, "referenceTemp": float, "auxPowerVersusFrequency": float, "powerVariationByTemp": float, "auxPowerVersusVoltage": float, "timeConstant": float, "heatRecoveryFlag": bool, "ambientTemp": float} + _defaults = {"capabilityVersusFrequency": 0.0, "referenceTemp": 0.0, "auxPowerVersusFrequency": 0.0, "powerVariationByTemp": 0.0, "auxPowerVersusVoltage": 0.0, "timeConstant": 0.0, "heatRecoveryFlag": False, "ambientTemp": 0.0} + _enums = {} + _refs = ["HeatRecoveryBoiler", "AirCompressor", "CTTempActivePowerCurve"] + _many_refs = [] + + def getHeatRecoveryBoiler(self): + """A combustion turbine may have a heat recovery boiler for making steam + """ + return self._HeatRecoveryBoiler + + def setHeatRecoveryBoiler(self, value): + if self._HeatRecoveryBoiler is not None: + filtered = [x for x in self.HeatRecoveryBoiler.CombustionTurbines if x != self] + self._HeatRecoveryBoiler._CombustionTurbines = filtered + + self._HeatRecoveryBoiler = value + if self._HeatRecoveryBoiler is not None: + if self not in self._HeatRecoveryBoiler._CombustionTurbines: + self._HeatRecoveryBoiler._CombustionTurbines.append(self) + + HeatRecoveryBoiler = property(getHeatRecoveryBoiler, setHeatRecoveryBoiler) + + def getAirCompressor(self): + """A CAES air compressor is driven by combustion turbine + """ + return self._AirCompressor + + def setAirCompressor(self, value): + if self._AirCompressor is not None: + self._AirCompressor._CombustionTurbine = None + + self._AirCompressor = value + if self._AirCompressor is not None: + self._AirCompressor.CombustionTurbine = None + self._AirCompressor._CombustionTurbine = self + + AirCompressor = property(getAirCompressor, setAirCompressor) + + def getCTTempActivePowerCurve(self): + """A combustion turbine may have an active power versus ambient temperature relationship + """ + return self._CTTempActivePowerCurve + + def setCTTempActivePowerCurve(self, value): + if self._CTTempActivePowerCurve is not None: + self._CTTempActivePowerCurve._CombustionTurbine = None + + self._CTTempActivePowerCurve = value + if self._CTTempActivePowerCurve is not None: + self._CTTempActivePowerCurve.CombustionTurbine = None + self._CTTempActivePowerCurve._CombustionTurbine = self + + CTTempActivePowerCurve = property(getCTTempActivePowerCurve, setCTTempActivePowerCurve) + diff --git a/CIM16/IEC61970/Generation/GenerationDynamics/DrumBoiler.py b/CIM16/IEC61970/Generation/GenerationDynamics/DrumBoiler.py new file mode 100755 index 00000000..781b808a --- /dev/null +++ b/CIM16/IEC61970/Generation/GenerationDynamics/DrumBoiler.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Generation.GenerationDynamics.FossilSteamSupply import FossilSteamSupply + +class DrumBoiler(FossilSteamSupply): + """Drum boilerDrum boiler + """ + + def __init__(self, drumBoilerRating=0.0, *args, **kw_args): + """Initialises a new 'DrumBoiler' instance. + + @param drumBoilerRating: Rating of drum boiler in steam units + """ + #: Rating of drum boiler in steam units + self.drumBoilerRating = drumBoilerRating + + super(DrumBoiler, self).__init__(*args, **kw_args) + + _attrs = ["drumBoilerRating"] + _attr_types = {"drumBoilerRating": float} + _defaults = {"drumBoilerRating": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Generation/GenerationDynamics/FossilSteamSupply.py b/CIM16/IEC61970/Generation/GenerationDynamics/FossilSteamSupply.py new file mode 100755 index 00000000..2f28421e --- /dev/null +++ b/CIM16/IEC61970/Generation/GenerationDynamics/FossilSteamSupply.py @@ -0,0 +1,143 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Generation.GenerationDynamics.SteamSupply import SteamSupply + +class FossilSteamSupply(SteamSupply): + """Fossil fueled boiler (e.g., coal, oil, gas)Fossil fueled boiler (e.g., coal, oil, gas) + """ + + def __init__(self, fuelDemandLimit=0.0, auxPowerVersusFrequency=0.0, mechPowerSensorLag=0.0, pressureCtrlDG=0.0, throttlePressureSP=0.0, feedWaterPG=0.0, feedWaterTC=0.0, controlPC=0.0, fuelSupplyDelay=0.0, controlPED=0.0, controlPEB=0.0, boilerControlMode="following", controlTC=0.0, minErrorRateP=0.0, superHeater1Capacity=0.0, controlErrorBiasP=0.0, pressureCtrlIG=0.0, feedWaterIG=0.0, pressureFeedback=0, auxPowerVersusVoltage=0.0, fuelSupplyTC=0.0, maxErrorRateP=0.0, superHeaterPipePD=0.0, pressureCtrlPG=0.0, superHeater2Capacity=0.0, controlIC=0.0, *args, **kw_args): + """Initialises a new 'FossilSteamSupply' instance. + + @param fuelDemandLimit: Fuel Demand Limit + @param auxPowerVersusFrequency: Off nominal frequency effect on auxiliary real power. Per unit active power variation versus per unit frequency variation. + @param mechPowerSensorLag: Mechanical Power Sensor Lag + @param pressureCtrlDG: Pressure Control Derivative Gain ratio + @param throttlePressureSP: Throttle Pressure Setpoint + @param feedWaterPG: Feedwater Proportional Gain ratio + @param feedWaterTC: Feedwater Time Constant rato + @param controlPC: Proportional Constant + @param fuelSupplyDelay: Fuel Delay + @param controlPED: Pressure Error Deadband + @param controlPEB: Pressure Error Bias ratio + @param boilerControlMode: The control mode of the boiler Values are: "following", "coordinated" + @param controlTC: Time Constant + @param minErrorRateP: Active power Minimum Error Rate Limit + @param superHeater1Capacity: Drum/Primary Superheater Capacity + @param controlErrorBiasP: Active power Error Bias ratio + @param pressureCtrlIG: Pressure Control Integral Gain ratio + @param feedWaterIG: Feedwater Integral Gain ratio + @param pressureFeedback: Pressure Feedback Indicator + @param auxPowerVersusVoltage: Off nominal voltage effect on auxiliary real power. Per unit active power variation versus per unit voltage variation. + @param fuelSupplyTC: Fuel Supply Time Constant + @param maxErrorRateP: Active power Maximum Error Rate Limit + @param superHeaterPipePD: Superheater Pipe Pressure Drop Constant + @param pressureCtrlPG: Pressure Control Proportional Gain ratio + @param superHeater2Capacity: Secondary Superheater Capacity + @param controlIC: Integral Constant + """ + #: Fuel Demand Limit + self.fuelDemandLimit = fuelDemandLimit + + #: Off nominal frequency effect on auxiliary real power. Per unit active power variation versus per unit frequency variation. + self.auxPowerVersusFrequency = auxPowerVersusFrequency + + #: Mechanical Power Sensor Lag + self.mechPowerSensorLag = mechPowerSensorLag + + #: Pressure Control Derivative Gain ratio + self.pressureCtrlDG = pressureCtrlDG + + #: Throttle Pressure Setpoint + self.throttlePressureSP = throttlePressureSP + + #: Feedwater Proportional Gain ratio + self.feedWaterPG = feedWaterPG + + #: Feedwater Time Constant rato + self.feedWaterTC = feedWaterTC + + #: Proportional Constant + self.controlPC = controlPC + + #: Fuel Delay + self.fuelSupplyDelay = fuelSupplyDelay + + #: Pressure Error Deadband + self.controlPED = controlPED + + #: Pressure Error Bias ratio + self.controlPEB = controlPEB + + #: The control mode of the boiler Values are: "following", "coordinated" + self.boilerControlMode = boilerControlMode + + #: Time Constant + self.controlTC = controlTC + + #: Active power Minimum Error Rate Limit + self.minErrorRateP = minErrorRateP + + #: Drum/Primary Superheater Capacity + self.superHeater1Capacity = superHeater1Capacity + + #: Active power Error Bias ratio + self.controlErrorBiasP = controlErrorBiasP + + #: Pressure Control Integral Gain ratio + self.pressureCtrlIG = pressureCtrlIG + + #: Feedwater Integral Gain ratio + self.feedWaterIG = feedWaterIG + + #: Pressure Feedback Indicator + self.pressureFeedback = pressureFeedback + + #: Off nominal voltage effect on auxiliary real power. Per unit active power variation versus per unit voltage variation. + self.auxPowerVersusVoltage = auxPowerVersusVoltage + + #: Fuel Supply Time Constant + self.fuelSupplyTC = fuelSupplyTC + + #: Active power Maximum Error Rate Limit + self.maxErrorRateP = maxErrorRateP + + #: Superheater Pipe Pressure Drop Constant + self.superHeaterPipePD = superHeaterPipePD + + #: Pressure Control Proportional Gain ratio + self.pressureCtrlPG = pressureCtrlPG + + #: Secondary Superheater Capacity + self.superHeater2Capacity = superHeater2Capacity + + #: Integral Constant + self.controlIC = controlIC + + super(FossilSteamSupply, self).__init__(*args, **kw_args) + + _attrs = ["fuelDemandLimit", "auxPowerVersusFrequency", "mechPowerSensorLag", "pressureCtrlDG", "throttlePressureSP", "feedWaterPG", "feedWaterTC", "controlPC", "fuelSupplyDelay", "controlPED", "controlPEB", "boilerControlMode", "controlTC", "minErrorRateP", "superHeater1Capacity", "controlErrorBiasP", "pressureCtrlIG", "feedWaterIG", "pressureFeedback", "auxPowerVersusVoltage", "fuelSupplyTC", "maxErrorRateP", "superHeaterPipePD", "pressureCtrlPG", "superHeater2Capacity", "controlIC"] + _attr_types = {"fuelDemandLimit": float, "auxPowerVersusFrequency": float, "mechPowerSensorLag": float, "pressureCtrlDG": float, "throttlePressureSP": float, "feedWaterPG": float, "feedWaterTC": float, "controlPC": float, "fuelSupplyDelay": float, "controlPED": float, "controlPEB": float, "boilerControlMode": str, "controlTC": float, "minErrorRateP": float, "superHeater1Capacity": float, "controlErrorBiasP": float, "pressureCtrlIG": float, "feedWaterIG": float, "pressureFeedback": int, "auxPowerVersusVoltage": float, "fuelSupplyTC": float, "maxErrorRateP": float, "superHeaterPipePD": float, "pressureCtrlPG": float, "superHeater2Capacity": float, "controlIC": float} + _defaults = {"fuelDemandLimit": 0.0, "auxPowerVersusFrequency": 0.0, "mechPowerSensorLag": 0.0, "pressureCtrlDG": 0.0, "throttlePressureSP": 0.0, "feedWaterPG": 0.0, "feedWaterTC": 0.0, "controlPC": 0.0, "fuelSupplyDelay": 0.0, "controlPED": 0.0, "controlPEB": 0.0, "boilerControlMode": "following", "controlTC": 0.0, "minErrorRateP": 0.0, "superHeater1Capacity": 0.0, "controlErrorBiasP": 0.0, "pressureCtrlIG": 0.0, "feedWaterIG": 0.0, "pressureFeedback": 0, "auxPowerVersusVoltage": 0.0, "fuelSupplyTC": 0.0, "maxErrorRateP": 0.0, "superHeaterPipePD": 0.0, "pressureCtrlPG": 0.0, "superHeater2Capacity": 0.0, "controlIC": 0.0} + _enums = {"boilerControlMode": "BoilerControlMode"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Generation/GenerationDynamics/HeatRecoveryBoiler.py b/CIM16/IEC61970/Generation/GenerationDynamics/HeatRecoveryBoiler.py new file mode 100755 index 00000000..ae0021e2 --- /dev/null +++ b/CIM16/IEC61970/Generation/GenerationDynamics/HeatRecoveryBoiler.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Generation.GenerationDynamics.FossilSteamSupply import FossilSteamSupply + +class HeatRecoveryBoiler(FossilSteamSupply): + """The heat recovery system associated with combustion turbines in order to produce steam for combined cycle plantsThe heat recovery system associated with combustion turbines in order to produce steam for combined cycle plants + """ + + def __init__(self, steamSupplyRating2=0.0, CombustionTurbines=None, *args, **kw_args): + """Initialises a new 'HeatRecoveryBoiler' instance. + + @param steamSupplyRating2: The steam supply rating in kilopounds per hour, if dual pressure boiler + @param CombustionTurbines: A combustion turbine may have a heat recovery boiler for making steam + """ + #: The steam supply rating in kilopounds per hour, if dual pressure boiler + self.steamSupplyRating2 = steamSupplyRating2 + + self._CombustionTurbines = [] + self.CombustionTurbines = [] if CombustionTurbines is None else CombustionTurbines + + super(HeatRecoveryBoiler, self).__init__(*args, **kw_args) + + _attrs = ["steamSupplyRating2"] + _attr_types = {"steamSupplyRating2": float} + _defaults = {"steamSupplyRating2": 0.0} + _enums = {} + _refs = ["CombustionTurbines"] + _many_refs = ["CombustionTurbines"] + + def getCombustionTurbines(self): + """A combustion turbine may have a heat recovery boiler for making steam + """ + return self._CombustionTurbines + + def setCombustionTurbines(self, value): + for x in self._CombustionTurbines: + x.HeatRecoveryBoiler = None + for y in value: + y._HeatRecoveryBoiler = self + self._CombustionTurbines = value + + CombustionTurbines = property(getCombustionTurbines, setCombustionTurbines) + + def addCombustionTurbines(self, *CombustionTurbines): + for obj in CombustionTurbines: + obj.HeatRecoveryBoiler = self + + def removeCombustionTurbines(self, *CombustionTurbines): + for obj in CombustionTurbines: + obj.HeatRecoveryBoiler = None + diff --git a/CIM16/IEC61970/Generation/GenerationDynamics/HydroTurbine.py b/CIM16/IEC61970/Generation/GenerationDynamics/HydroTurbine.py new file mode 100755 index 00000000..c6be2d79 --- /dev/null +++ b/CIM16/IEC61970/Generation/GenerationDynamics/HydroTurbine.py @@ -0,0 +1,83 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Generation.GenerationDynamics.PrimeMover import PrimeMover + +class HydroTurbine(PrimeMover): + """A water driven prime mover. Typical turbine types are: Francis, Kaplan, and Pelton.A water driven prime mover. Typical turbine types are: Francis, Kaplan, and Pelton. + """ + + def __init__(self, maxHeadMaxP=0.0, minHeadMaxP=0.0, turbineRating=0.0, gateRateLimit=0.0, turbineType="pelton", gateUpperLimit=0.0, speedRating=0.0, speedRegulation=0.0, transientDroopTime=0.0, transientRegulation=0.0, waterStartingTime=0.0, *args, **kw_args): + """Initialises a new 'HydroTurbine' instance. + + @param maxHeadMaxP: Maximum efficiency active power at maximum head conditions + @param minHeadMaxP: Maximum efficiency active power at minimum head conditions + @param turbineRating: Rated turbine active power + @param gateRateLimit: Gate Rate Limit + @param turbineType: Type of turbine. Values are: "pelton", "kaplan", "francis" + @param gateUpperLimit: Gate Upper Limit + @param speedRating: Rated speed in number of revolutions. + @param speedRegulation: Speed Regulation + @param transientDroopTime: Transient Droop Time Constant + @param transientRegulation: Transient Regulation + @param waterStartingTime: Water Starting Time + """ + #: Maximum efficiency active power at maximum head conditions + self.maxHeadMaxP = maxHeadMaxP + + #: Maximum efficiency active power at minimum head conditions + self.minHeadMaxP = minHeadMaxP + + #: Rated turbine active power + self.turbineRating = turbineRating + + #: Gate Rate Limit + self.gateRateLimit = gateRateLimit + + #: Type of turbine. Values are: "pelton", "kaplan", "francis" + self.turbineType = turbineType + + #: Gate Upper Limit + self.gateUpperLimit = gateUpperLimit + + #: Rated speed in number of revolutions. + self.speedRating = speedRating + + #: Speed Regulation + self.speedRegulation = speedRegulation + + #: Transient Droop Time Constant + self.transientDroopTime = transientDroopTime + + #: Transient Regulation + self.transientRegulation = transientRegulation + + #: Water Starting Time + self.waterStartingTime = waterStartingTime + + super(HydroTurbine, self).__init__(*args, **kw_args) + + _attrs = ["maxHeadMaxP", "minHeadMaxP", "turbineRating", "gateRateLimit", "turbineType", "gateUpperLimit", "speedRating", "speedRegulation", "transientDroopTime", "transientRegulation", "waterStartingTime"] + _attr_types = {"maxHeadMaxP": float, "minHeadMaxP": float, "turbineRating": float, "gateRateLimit": float, "turbineType": str, "gateUpperLimit": float, "speedRating": float, "speedRegulation": float, "transientDroopTime": float, "transientRegulation": float, "waterStartingTime": float} + _defaults = {"maxHeadMaxP": 0.0, "minHeadMaxP": 0.0, "turbineRating": 0.0, "gateRateLimit": 0.0, "turbineType": "pelton", "gateUpperLimit": 0.0, "speedRating": 0.0, "speedRegulation": 0.0, "transientDroopTime": 0.0, "transientRegulation": 0.0, "waterStartingTime": 0.0} + _enums = {"turbineType": "TurbineType"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Generation/GenerationDynamics/PWRSteamSupply.py b/CIM16/IEC61970/Generation/GenerationDynamics/PWRSteamSupply.py new file mode 100755 index 00000000..2b55a54c --- /dev/null +++ b/CIM16/IEC61970/Generation/GenerationDynamics/PWRSteamSupply.py @@ -0,0 +1,119 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Generation.GenerationDynamics.SteamSupply import SteamSupply + +class PWRSteamSupply(SteamSupply): + """Pressurized water reactor used as a steam supply to a steam turbinePressurized water reactor used as a steam supply to a steam turbine + """ + + def __init__(self, coreNeutronicsHT=0.0, steamFlowFG=0.0, hotLegToColdLegGain=0.0, steamPressureDropLagTC=0.0, coreHTLagTC1=0.0, coreHTLagTC2=0.0, hotLegLagTC=0.0, throttlePressureSP=0.0, hotLegSteamGain=0.0, throttlePressureFactor=0.0, coldLegFBLagTC=0.0, pressureCG=0.0, steamPressureFG=0.0, feedbackFactor=0.0, coreNeutronicsEffTC=0.0, coldLegFG2=0.0, coldLegFG1=0.0, coldLegLagTC=0.0, coldLegFBLeadTC2=0.0, coldLegFBLeadTC1=0.0, *args, **kw_args): + """Initialises a new 'PWRSteamSupply' instance. + + @param coreNeutronicsHT: Core Neutronics And Heat Transfer + @param steamFlowFG: Steam Flow Feedback Gain + @param hotLegToColdLegGain: Hot Leg To Cold Leg Gain + @param steamPressureDropLagTC: Steam Pressure Drop Lag Time Constant + @param coreHTLagTC1: Core Heat Transfer Lag Time Constant + @param coreHTLagTC2: Core Heat Transfer Lag Time Constant + @param hotLegLagTC: Hot Leg Lag Time Constant + @param throttlePressureSP: Throttle Pressure Setpoint + @param hotLegSteamGain: Hot Leg Steam Gain + @param throttlePressureFactor: Throttle Pressure Factor + @param coldLegFBLagTC: Cold Leg Feedback Lag Time Constant + @param pressureCG: Pressure Control Gain + @param steamPressureFG: Steam Pressure Feedback Gain + @param feedbackFactor: Feedback Factor + @param coreNeutronicsEffTC: Core Neutronics Effective Time Constant + @param coldLegFG2: Cold Leg Feedback Gain 2 + @param coldLegFG1: Cold Leg Feedback Gain 1 + @param coldLegLagTC: Cold Leg Lag Time Constant + @param coldLegFBLeadTC2: Cold Leg Feedback Lead Time Constant + @param coldLegFBLeadTC1: Cold Leg Feedback Lead Time Constant + """ + #: Core Neutronics And Heat Transfer + self.coreNeutronicsHT = coreNeutronicsHT + + #: Steam Flow Feedback Gain + self.steamFlowFG = steamFlowFG + + #: Hot Leg To Cold Leg Gain + self.hotLegToColdLegGain = hotLegToColdLegGain + + #: Steam Pressure Drop Lag Time Constant + self.steamPressureDropLagTC = steamPressureDropLagTC + + #: Core Heat Transfer Lag Time Constant + self.coreHTLagTC1 = coreHTLagTC1 + + #: Core Heat Transfer Lag Time Constant + self.coreHTLagTC2 = coreHTLagTC2 + + #: Hot Leg Lag Time Constant + self.hotLegLagTC = hotLegLagTC + + #: Throttle Pressure Setpoint + self.throttlePressureSP = throttlePressureSP + + #: Hot Leg Steam Gain + self.hotLegSteamGain = hotLegSteamGain + + #: Throttle Pressure Factor + self.throttlePressureFactor = throttlePressureFactor + + #: Cold Leg Feedback Lag Time Constant + self.coldLegFBLagTC = coldLegFBLagTC + + #: Pressure Control Gain + self.pressureCG = pressureCG + + #: Steam Pressure Feedback Gain + self.steamPressureFG = steamPressureFG + + #: Feedback Factor + self.feedbackFactor = feedbackFactor + + #: Core Neutronics Effective Time Constant + self.coreNeutronicsEffTC = coreNeutronicsEffTC + + #: Cold Leg Feedback Gain 2 + self.coldLegFG2 = coldLegFG2 + + #: Cold Leg Feedback Gain 1 + self.coldLegFG1 = coldLegFG1 + + #: Cold Leg Lag Time Constant + self.coldLegLagTC = coldLegLagTC + + #: Cold Leg Feedback Lead Time Constant + self.coldLegFBLeadTC2 = coldLegFBLeadTC2 + + #: Cold Leg Feedback Lead Time Constant + self.coldLegFBLeadTC1 = coldLegFBLeadTC1 + + super(PWRSteamSupply, self).__init__(*args, **kw_args) + + _attrs = ["coreNeutronicsHT", "steamFlowFG", "hotLegToColdLegGain", "steamPressureDropLagTC", "coreHTLagTC1", "coreHTLagTC2", "hotLegLagTC", "throttlePressureSP", "hotLegSteamGain", "throttlePressureFactor", "coldLegFBLagTC", "pressureCG", "steamPressureFG", "feedbackFactor", "coreNeutronicsEffTC", "coldLegFG2", "coldLegFG1", "coldLegLagTC", "coldLegFBLeadTC2", "coldLegFBLeadTC1"] + _attr_types = {"coreNeutronicsHT": float, "steamFlowFG": float, "hotLegToColdLegGain": float, "steamPressureDropLagTC": float, "coreHTLagTC1": float, "coreHTLagTC2": float, "hotLegLagTC": float, "throttlePressureSP": float, "hotLegSteamGain": float, "throttlePressureFactor": float, "coldLegFBLagTC": float, "pressureCG": float, "steamPressureFG": float, "feedbackFactor": float, "coreNeutronicsEffTC": float, "coldLegFG2": float, "coldLegFG1": float, "coldLegLagTC": float, "coldLegFBLeadTC2": float, "coldLegFBLeadTC1": float} + _defaults = {"coreNeutronicsHT": 0.0, "steamFlowFG": 0.0, "hotLegToColdLegGain": 0.0, "steamPressureDropLagTC": 0.0, "coreHTLagTC1": 0.0, "coreHTLagTC2": 0.0, "hotLegLagTC": 0.0, "throttlePressureSP": 0.0, "hotLegSteamGain": 0.0, "throttlePressureFactor": 0.0, "coldLegFBLagTC": 0.0, "pressureCG": 0.0, "steamPressureFG": 0.0, "feedbackFactor": 0.0, "coreNeutronicsEffTC": 0.0, "coldLegFG2": 0.0, "coldLegFG1": 0.0, "coldLegLagTC": 0.0, "coldLegFBLeadTC2": 0.0, "coldLegFBLeadTC1": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Generation/GenerationDynamics/PrimeMover.py b/CIM16/IEC61970/Generation/GenerationDynamics/PrimeMover.py new file mode 100755 index 00000000..61cd58df --- /dev/null +++ b/CIM16/IEC61970/Generation/GenerationDynamics/PrimeMover.py @@ -0,0 +1,75 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class PrimeMover(PowerSystemResource): + """The machine used to develop mechanical energy used to drive a generator.The machine used to develop mechanical energy used to drive a generator. + """ + + def __init__(self, primeMoverRating=0.0, SynchronousMachines=None, *args, **kw_args): + """Initialises a new 'PrimeMover' instance. + + @param primeMoverRating: Rating of prime mover + @param SynchronousMachines: Synchronous machines this Prime mover drives. + """ + #: Rating of prime mover + self.primeMoverRating = primeMoverRating + + self._SynchronousMachines = [] + self.SynchronousMachines = [] if SynchronousMachines is None else SynchronousMachines + + super(PrimeMover, self).__init__(*args, **kw_args) + + _attrs = ["primeMoverRating"] + _attr_types = {"primeMoverRating": float} + _defaults = {"primeMoverRating": 0.0} + _enums = {} + _refs = ["SynchronousMachines"] + _many_refs = ["SynchronousMachines"] + + def getSynchronousMachines(self): + """Synchronous machines this Prime mover drives. + """ + return self._SynchronousMachines + + def setSynchronousMachines(self, value): + for p in self._SynchronousMachines: + filtered = [q for q in p.PrimeMovers if q != self] + self._SynchronousMachines._PrimeMovers = filtered + for r in value: + if self not in r._PrimeMovers: + r._PrimeMovers.append(self) + self._SynchronousMachines = value + + SynchronousMachines = property(getSynchronousMachines, setSynchronousMachines) + + def addSynchronousMachines(self, *SynchronousMachines): + for obj in SynchronousMachines: + if self not in obj._PrimeMovers: + obj._PrimeMovers.append(self) + self._SynchronousMachines.append(obj) + + def removeSynchronousMachines(self, *SynchronousMachines): + for obj in SynchronousMachines: + if self in obj._PrimeMovers: + obj._PrimeMovers.remove(self) + self._SynchronousMachines.remove(obj) + diff --git a/CIM16/IEC61970/Generation/GenerationDynamics/SteamSupply.py b/CIM16/IEC61970/Generation/GenerationDynamics/SteamSupply.py new file mode 100755 index 00000000..69ed2ba8 --- /dev/null +++ b/CIM16/IEC61970/Generation/GenerationDynamics/SteamSupply.py @@ -0,0 +1,75 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class SteamSupply(PowerSystemResource): + """Steam supply for steam turbineSteam supply for steam turbine + """ + + def __init__(self, steamSupplyRating=0.0, SteamTurbines=None, *args, **kw_args): + """Initialises a new 'SteamSupply' instance. + + @param steamSupplyRating: Rating of steam supply + @param SteamTurbines: Steam turbines may have steam supplied by a steam supply + """ + #: Rating of steam supply + self.steamSupplyRating = steamSupplyRating + + self._SteamTurbines = [] + self.SteamTurbines = [] if SteamTurbines is None else SteamTurbines + + super(SteamSupply, self).__init__(*args, **kw_args) + + _attrs = ["steamSupplyRating"] + _attr_types = {"steamSupplyRating": float} + _defaults = {"steamSupplyRating": 0.0} + _enums = {} + _refs = ["SteamTurbines"] + _many_refs = ["SteamTurbines"] + + def getSteamTurbines(self): + """Steam turbines may have steam supplied by a steam supply + """ + return self._SteamTurbines + + def setSteamTurbines(self, value): + for p in self._SteamTurbines: + filtered = [q for q in p.SteamSupplys if q != self] + self._SteamTurbines._SteamSupplys = filtered + for r in value: + if self not in r._SteamSupplys: + r._SteamSupplys.append(self) + self._SteamTurbines = value + + SteamTurbines = property(getSteamTurbines, setSteamTurbines) + + def addSteamTurbines(self, *SteamTurbines): + for obj in SteamTurbines: + if self not in obj._SteamSupplys: + obj._SteamSupplys.append(self) + self._SteamTurbines.append(obj) + + def removeSteamTurbines(self, *SteamTurbines): + for obj in SteamTurbines: + if self in obj._SteamSupplys: + obj._SteamSupplys.remove(self) + self._SteamTurbines.remove(obj) + diff --git a/CIM16/IEC61970/Generation/GenerationDynamics/SteamTurbine.py b/CIM16/IEC61970/Generation/GenerationDynamics/SteamTurbine.py new file mode 100755 index 00000000..a9c2efa2 --- /dev/null +++ b/CIM16/IEC61970/Generation/GenerationDynamics/SteamTurbine.py @@ -0,0 +1,119 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Generation.GenerationDynamics.PrimeMover import PrimeMover + +class SteamTurbine(PrimeMover): + """Steam turbineSteam turbine + """ + + def __init__(self, shaft1PowerIP=0.0, shaft2PowerIP=0.0, crossoverTC=0.0, shaft1PowerLP1=0.0, shaft1PowerLP2=0.0, reheater1TC=0.0, shaft2PowerLP1=0.0, shaft2PowerLP2=0.0, reheater2TC=0.0, steamChestTC=0.0, shaft1PowerHP=0.0, shaft2PowerHP=0.0, SteamSupplys=None, *args, **kw_args): + """Initialises a new 'SteamTurbine' instance. + + @param shaft1PowerIP: Fraction Of Power From Shaft 1 Intermediate Pressure Turbine output + @param shaft2PowerIP: Fraction Of Power From Shaft 2 Intermediate Pressure Turbine output + @param crossoverTC: Crossover Time Constant + @param shaft1PowerLP1: Fraction Of Power From Shaft 1 First Low Pressure Turbine output + @param shaft1PowerLP2: Fraction Of Power From Shaft 1 Second Low Pressure Turbine output + @param reheater1TC: First Reheater Time Constant + @param shaft2PowerLP1: Fraction Of Power From Shaft 2 First Low Pressure Turbine output + @param shaft2PowerLP2: Fraction Of Power From Shaft 2 Second Low Pressure Turbine output + @param reheater2TC: Second Reheater Time Constant + @param steamChestTC: Steam Chest Time Constant + @param shaft1PowerHP: Fraction Of Power From Shaft 1 High Pressure Turbine output + @param shaft2PowerHP: Fraction Of Power From Shaft 2 High Pressure Turbine output + @param SteamSupplys: Steam turbines may have steam supplied by a steam supply + """ + #: Fraction Of Power From Shaft 1 Intermediate Pressure Turbine output + self.shaft1PowerIP = shaft1PowerIP + + #: Fraction Of Power From Shaft 2 Intermediate Pressure Turbine output + self.shaft2PowerIP = shaft2PowerIP + + #: Crossover Time Constant + self.crossoverTC = crossoverTC + + #: Fraction Of Power From Shaft 1 First Low Pressure Turbine output + self.shaft1PowerLP1 = shaft1PowerLP1 + + #: Fraction Of Power From Shaft 1 Second Low Pressure Turbine output + self.shaft1PowerLP2 = shaft1PowerLP2 + + #: First Reheater Time Constant + self.reheater1TC = reheater1TC + + #: Fraction Of Power From Shaft 2 First Low Pressure Turbine output + self.shaft2PowerLP1 = shaft2PowerLP1 + + #: Fraction Of Power From Shaft 2 Second Low Pressure Turbine output + self.shaft2PowerLP2 = shaft2PowerLP2 + + #: Second Reheater Time Constant + self.reheater2TC = reheater2TC + + #: Steam Chest Time Constant + self.steamChestTC = steamChestTC + + #: Fraction Of Power From Shaft 1 High Pressure Turbine output + self.shaft1PowerHP = shaft1PowerHP + + #: Fraction Of Power From Shaft 2 High Pressure Turbine output + self.shaft2PowerHP = shaft2PowerHP + + self._SteamSupplys = [] + self.SteamSupplys = [] if SteamSupplys is None else SteamSupplys + + super(SteamTurbine, self).__init__(*args, **kw_args) + + _attrs = ["shaft1PowerIP", "shaft2PowerIP", "crossoverTC", "shaft1PowerLP1", "shaft1PowerLP2", "reheater1TC", "shaft2PowerLP1", "shaft2PowerLP2", "reheater2TC", "steamChestTC", "shaft1PowerHP", "shaft2PowerHP"] + _attr_types = {"shaft1PowerIP": float, "shaft2PowerIP": float, "crossoverTC": float, "shaft1PowerLP1": float, "shaft1PowerLP2": float, "reheater1TC": float, "shaft2PowerLP1": float, "shaft2PowerLP2": float, "reheater2TC": float, "steamChestTC": float, "shaft1PowerHP": float, "shaft2PowerHP": float} + _defaults = {"shaft1PowerIP": 0.0, "shaft2PowerIP": 0.0, "crossoverTC": 0.0, "shaft1PowerLP1": 0.0, "shaft1PowerLP2": 0.0, "reheater1TC": 0.0, "shaft2PowerLP1": 0.0, "shaft2PowerLP2": 0.0, "reheater2TC": 0.0, "steamChestTC": 0.0, "shaft1PowerHP": 0.0, "shaft2PowerHP": 0.0} + _enums = {} + _refs = ["SteamSupplys"] + _many_refs = ["SteamSupplys"] + + def getSteamSupplys(self): + """Steam turbines may have steam supplied by a steam supply + """ + return self._SteamSupplys + + def setSteamSupplys(self, value): + for p in self._SteamSupplys: + filtered = [q for q in p.SteamTurbines if q != self] + self._SteamSupplys._SteamTurbines = filtered + for r in value: + if self not in r._SteamTurbines: + r._SteamTurbines.append(self) + self._SteamSupplys = value + + SteamSupplys = property(getSteamSupplys, setSteamSupplys) + + def addSteamSupplys(self, *SteamSupplys): + for obj in SteamSupplys: + if self not in obj._SteamTurbines: + obj._SteamTurbines.append(self) + self._SteamSupplys.append(obj) + + def removeSteamSupplys(self, *SteamSupplys): + for obj in SteamSupplys: + if self in obj._SteamTurbines: + obj._SteamTurbines.remove(self) + self._SteamSupplys.remove(obj) + diff --git a/CIM16/IEC61970/Generation/GenerationDynamics/Subcritical.py b/CIM16/IEC61970/Generation/GenerationDynamics/Subcritical.py new file mode 100755 index 00000000..6b4cab93 --- /dev/null +++ b/CIM16/IEC61970/Generation/GenerationDynamics/Subcritical.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Generation.GenerationDynamics.FossilSteamSupply import FossilSteamSupply + +class Subcritical(FossilSteamSupply): + """Once-through subcritical boilerOnce-through subcritical boiler + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Subcritical' instance. + + """ + super(Subcritical, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Generation/GenerationDynamics/Supercritical.py b/CIM16/IEC61970/Generation/GenerationDynamics/Supercritical.py new file mode 100755 index 00000000..92be3050 --- /dev/null +++ b/CIM16/IEC61970/Generation/GenerationDynamics/Supercritical.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Generation.GenerationDynamics.FossilSteamSupply import FossilSteamSupply + +class Supercritical(FossilSteamSupply): + """Once-through supercritical boilerOnce-through supercritical boiler + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Supercritical' instance. + + """ + super(Supercritical, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Generation/GenerationDynamics/__init__.py b/CIM16/IEC61970/Generation/GenerationDynamics/__init__.py new file mode 100755 index 00000000..1ff10b92 --- /dev/null +++ b/CIM16/IEC61970/Generation/GenerationDynamics/__init__.py @@ -0,0 +1,50 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The Generation Dynamics package contains prime movers, such as turbines and boilers, which are needed for simulation and educational purposes. +""" + +from CIM16.IEC61970.Generation.GenerationDynamics.BWRSteamSupply import BWRSteamSupply +from CIM16.IEC61970.Generation.GenerationDynamics.HydroTurbine import HydroTurbine +from CIM16.IEC61970.Generation.GenerationDynamics.SteamTurbine import SteamTurbine +from CIM16.IEC61970.Generation.GenerationDynamics.SteamSupply import SteamSupply +from CIM16.IEC61970.Generation.GenerationDynamics.FossilSteamSupply import FossilSteamSupply +from CIM16.IEC61970.Generation.GenerationDynamics.Subcritical import Subcritical +from CIM16.IEC61970.Generation.GenerationDynamics.PWRSteamSupply import PWRSteamSupply +from CIM16.IEC61970.Generation.GenerationDynamics.PrimeMover import PrimeMover +from CIM16.IEC61970.Generation.GenerationDynamics.CombustionTurbine import CombustionTurbine +from CIM16.IEC61970.Generation.GenerationDynamics.HeatRecoveryBoiler import HeatRecoveryBoiler +from CIM16.IEC61970.Generation.GenerationDynamics.Supercritical import Supercritical +from CIM16.IEC61970.Generation.GenerationDynamics.DrumBoiler import DrumBoiler +from CIM16.IEC61970.Generation.GenerationDynamics.CTTempActivePowerCurve import CTTempActivePowerCurve + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#GenerationDynamics" +nsPrefix = "cimGenerationDynamics" + + +class TurbineType(str): + """Values are: pelton, kaplan, francis + """ + pass + +class BoilerControlMode(str): + """Values are: following, coordinated + """ + pass diff --git a/CIM16/IEC61970/Generation/Production/AirCompressor.py b/CIM16/IEC61970/Generation/Production/AirCompressor.py new file mode 100755 index 00000000..6dc588d6 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/AirCompressor.py @@ -0,0 +1,83 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class AirCompressor(PowerSystemResource): + """Combustion turbine air compressor which is an integral part of a compressed air energy storage (CAES) plantCombustion turbine air compressor which is an integral part of a compressed air energy storage (CAES) plant + """ + + def __init__(self, airCompressorRating=0.0, CombustionTurbine=None, CAESPlant=None, *args, **kw_args): + """Initialises a new 'AirCompressor' instance. + + @param airCompressorRating: Rating of the CAES air compressor + @param CombustionTurbine: A CAES air compressor is driven by combustion turbine + @param CAESPlant: An air compressor may be a member of a compressed air energy storage plant + """ + #: Rating of the CAES air compressor + self.airCompressorRating = airCompressorRating + + self._CombustionTurbine = None + self.CombustionTurbine = CombustionTurbine + + self._CAESPlant = None + self.CAESPlant = CAESPlant + + super(AirCompressor, self).__init__(*args, **kw_args) + + _attrs = ["airCompressorRating"] + _attr_types = {"airCompressorRating": float} + _defaults = {"airCompressorRating": 0.0} + _enums = {} + _refs = ["CombustionTurbine", "CAESPlant"] + _many_refs = [] + + def getCombustionTurbine(self): + """A CAES air compressor is driven by combustion turbine + """ + return self._CombustionTurbine + + def setCombustionTurbine(self, value): + if self._CombustionTurbine is not None: + self._CombustionTurbine._AirCompressor = None + + self._CombustionTurbine = value + if self._CombustionTurbine is not None: + self._CombustionTurbine.AirCompressor = None + self._CombustionTurbine._AirCompressor = self + + CombustionTurbine = property(getCombustionTurbine, setCombustionTurbine) + + def getCAESPlant(self): + """An air compressor may be a member of a compressed air energy storage plant + """ + return self._CAESPlant + + def setCAESPlant(self, value): + if self._CAESPlant is not None: + self._CAESPlant._AirCompressor = None + + self._CAESPlant = value + if self._CAESPlant is not None: + self._CAESPlant.AirCompressor = None + self._CAESPlant._AirCompressor = self + + CAESPlant = property(getCAESPlant, setCAESPlant) + diff --git a/CIM16/IEC61970/Generation/Production/CAESPlant.py b/CIM16/IEC61970/Generation/Production/CAESPlant.py new file mode 100755 index 00000000..0a5f97df --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/CAESPlant.py @@ -0,0 +1,87 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class CAESPlant(PowerSystemResource): + """Compressed air energy storage plantCompressed air energy storage plant + """ + + def __init__(self, ratedCapacityP=0.0, energyStorageCapacity=0.0, AirCompressor=None, ThermalGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'CAESPlant' instance. + + @param ratedCapacityP: The CAES plant's gross rated generating capacity + @param energyStorageCapacity: The rated energy storage capacity. + @param AirCompressor: An air compressor may be a member of a compressed air energy storage plant + @param ThermalGeneratingUnit: A thermal generating unit may be a member of a compressed air energy storage plant + """ + #: The CAES plant's gross rated generating capacity + self.ratedCapacityP = ratedCapacityP + + #: The rated energy storage capacity. + self.energyStorageCapacity = energyStorageCapacity + + self._AirCompressor = None + self.AirCompressor = AirCompressor + + self._ThermalGeneratingUnit = None + self.ThermalGeneratingUnit = ThermalGeneratingUnit + + super(CAESPlant, self).__init__(*args, **kw_args) + + _attrs = ["ratedCapacityP", "energyStorageCapacity"] + _attr_types = {"ratedCapacityP": float, "energyStorageCapacity": float} + _defaults = {"ratedCapacityP": 0.0, "energyStorageCapacity": 0.0} + _enums = {} + _refs = ["AirCompressor", "ThermalGeneratingUnit"] + _many_refs = [] + + def getAirCompressor(self): + """An air compressor may be a member of a compressed air energy storage plant + """ + return self._AirCompressor + + def setAirCompressor(self, value): + if self._AirCompressor is not None: + self._AirCompressor._CAESPlant = None + + self._AirCompressor = value + if self._AirCompressor is not None: + self._AirCompressor.CAESPlant = None + self._AirCompressor._CAESPlant = self + + AirCompressor = property(getAirCompressor, setAirCompressor) + + def getThermalGeneratingUnit(self): + """A thermal generating unit may be a member of a compressed air energy storage plant + """ + return self._ThermalGeneratingUnit + + def setThermalGeneratingUnit(self, value): + if self._ThermalGeneratingUnit is not None: + self._ThermalGeneratingUnit._CAESPlant = None + + self._ThermalGeneratingUnit = value + if self._ThermalGeneratingUnit is not None: + self._ThermalGeneratingUnit.CAESPlant = None + self._ThermalGeneratingUnit._CAESPlant = self + + ThermalGeneratingUnit = property(getThermalGeneratingUnit, setThermalGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/CogenerationPlant.py b/CIM16/IEC61970/Generation/Production/CogenerationPlant.py new file mode 100755 index 00000000..e6c7ad38 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/CogenerationPlant.py @@ -0,0 +1,105 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class CogenerationPlant(PowerSystemResource): + """A set of thermal generating units for the production of electrical energy and process steam (usually from the output of the steam turbines). The steam sendout is typically used for industrial purposes or for municipal heating and cooling.A set of thermal generating units for the production of electrical energy and process steam (usually from the output of the steam turbines). The steam sendout is typically used for industrial purposes or for municipal heating and cooling. + """ + + def __init__(self, cogenLPSteamRating=0.0, cogenLPSendoutRating=0.0, ratedP=0.0, cogenHPSendoutRating=0.0, cogenHPSteamRating=0.0, SteamSendoutSchedule=None, ThermalGeneratingUnits=None, *args, **kw_args): + """Initialises a new 'CogenerationPlant' instance. + + @param cogenLPSteamRating: The low pressure steam rating + @param cogenLPSendoutRating: The low pressure steam sendout + @param ratedP: The rated output active power of the cogeneration plant + @param cogenHPSendoutRating: The high pressure steam sendout + @param cogenHPSteamRating: The high pressure steam rating + @param SteamSendoutSchedule: A cogeneration plant has a steam sendout schedule + @param ThermalGeneratingUnits: A thermal generating unit may be a member of a cogeneration plant + """ + #: The low pressure steam rating + self.cogenLPSteamRating = cogenLPSteamRating + + #: The low pressure steam sendout + self.cogenLPSendoutRating = cogenLPSendoutRating + + #: The rated output active power of the cogeneration plant + self.ratedP = ratedP + + #: The high pressure steam sendout + self.cogenHPSendoutRating = cogenHPSendoutRating + + #: The high pressure steam rating + self.cogenHPSteamRating = cogenHPSteamRating + + self._SteamSendoutSchedule = None + self.SteamSendoutSchedule = SteamSendoutSchedule + + self._ThermalGeneratingUnits = [] + self.ThermalGeneratingUnits = [] if ThermalGeneratingUnits is None else ThermalGeneratingUnits + + super(CogenerationPlant, self).__init__(*args, **kw_args) + + _attrs = ["cogenLPSteamRating", "cogenLPSendoutRating", "ratedP", "cogenHPSendoutRating", "cogenHPSteamRating"] + _attr_types = {"cogenLPSteamRating": float, "cogenLPSendoutRating": float, "ratedP": float, "cogenHPSendoutRating": float, "cogenHPSteamRating": float} + _defaults = {"cogenLPSteamRating": 0.0, "cogenLPSendoutRating": 0.0, "ratedP": 0.0, "cogenHPSendoutRating": 0.0, "cogenHPSteamRating": 0.0} + _enums = {} + _refs = ["SteamSendoutSchedule", "ThermalGeneratingUnits"] + _many_refs = ["ThermalGeneratingUnits"] + + def getSteamSendoutSchedule(self): + """A cogeneration plant has a steam sendout schedule + """ + return self._SteamSendoutSchedule + + def setSteamSendoutSchedule(self, value): + if self._SteamSendoutSchedule is not None: + self._SteamSendoutSchedule._CogenerationPlant = None + + self._SteamSendoutSchedule = value + if self._SteamSendoutSchedule is not None: + self._SteamSendoutSchedule.CogenerationPlant = None + self._SteamSendoutSchedule._CogenerationPlant = self + + SteamSendoutSchedule = property(getSteamSendoutSchedule, setSteamSendoutSchedule) + + def getThermalGeneratingUnits(self): + """A thermal generating unit may be a member of a cogeneration plant + """ + return self._ThermalGeneratingUnits + + def setThermalGeneratingUnits(self, value): + for x in self._ThermalGeneratingUnits: + x.CogenerationPlant = None + for y in value: + y._CogenerationPlant = self + self._ThermalGeneratingUnits = value + + ThermalGeneratingUnits = property(getThermalGeneratingUnits, setThermalGeneratingUnits) + + def addThermalGeneratingUnits(self, *ThermalGeneratingUnits): + for obj in ThermalGeneratingUnits: + obj.CogenerationPlant = self + + def removeThermalGeneratingUnits(self, *ThermalGeneratingUnits): + for obj in ThermalGeneratingUnits: + obj.CogenerationPlant = None + diff --git a/CIM16/IEC61970/Generation/Production/CombinedCyclePlant.py b/CIM16/IEC61970/Generation/Production/CombinedCyclePlant.py new file mode 100755 index 00000000..3f6365be --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/CombinedCyclePlant.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class CombinedCyclePlant(PowerSystemResource): + """A set of combustion turbines and steam turbines where the exhaust heat from the combustion turbines is recovered to make steam for the steam turbines, resulting in greater overall plant efficiencyA set of combustion turbines and steam turbines where the exhaust heat from the combustion turbines is recovered to make steam for the steam turbines, resulting in greater overall plant efficiency + """ + + def __init__(self, combCyclePlantRating=0.0, ThermalGeneratingUnits=None, *args, **kw_args): + """Initialises a new 'CombinedCyclePlant' instance. + + @param combCyclePlantRating: The combined cycle plant's active power output rating + @param ThermalGeneratingUnits: A thermal generating unit may be a member of a combined cycle plant + """ + #: The combined cycle plant's active power output rating + self.combCyclePlantRating = combCyclePlantRating + + self._ThermalGeneratingUnits = [] + self.ThermalGeneratingUnits = [] if ThermalGeneratingUnits is None else ThermalGeneratingUnits + + super(CombinedCyclePlant, self).__init__(*args, **kw_args) + + _attrs = ["combCyclePlantRating"] + _attr_types = {"combCyclePlantRating": float} + _defaults = {"combCyclePlantRating": 0.0} + _enums = {} + _refs = ["ThermalGeneratingUnits"] + _many_refs = ["ThermalGeneratingUnits"] + + def getThermalGeneratingUnits(self): + """A thermal generating unit may be a member of a combined cycle plant + """ + return self._ThermalGeneratingUnits + + def setThermalGeneratingUnits(self, value): + for x in self._ThermalGeneratingUnits: + x.CombinedCyclePlant = None + for y in value: + y._CombinedCyclePlant = self + self._ThermalGeneratingUnits = value + + ThermalGeneratingUnits = property(getThermalGeneratingUnits, setThermalGeneratingUnits) + + def addThermalGeneratingUnits(self, *ThermalGeneratingUnits): + for obj in ThermalGeneratingUnits: + obj.CombinedCyclePlant = self + + def removeThermalGeneratingUnits(self, *ThermalGeneratingUnits): + for obj in ThermalGeneratingUnits: + obj.CombinedCyclePlant = None + diff --git a/CIM16/IEC61970/Generation/Production/EmissionAccount.py b/CIM16/IEC61970/Generation/Production/EmissionAccount.py new file mode 100755 index 00000000..c9abcb23 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/EmissionAccount.py @@ -0,0 +1,68 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class EmissionAccount(Curve): + """Accounts for tracking emissions usage and credits for thermal generating units. A unit may have zero or more emission accounts, and will typically have one for tracking usage and one for tracking credits.Accounts for tracking emissions usage and credits for thermal generating units. A unit may have zero or more emission accounts, and will typically have one for tracking usage and one for tracking credits. + """ + + def __init__(self, emissionType="carbonDisulfide", emissionValueSource="calculated", ThermalGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'EmissionAccount' instance. + + @param emissionType: The type of emission, for example sulfur dioxide (SO2). The y1AxisUnits of the curve contains the unit of measure (e.g. kg) and the emissionType is the type of emission (e.g. sulfer dioxide). Values are: "carbonDisulfide", "sulfurDioxide", "hydrogenSulfide", "chlorine", "carbonDioxide", "nitrogenOxide" + @param emissionValueSource: The source of the emission value. Values are: "calculated", "measured" + @param ThermalGeneratingUnit: A thermal generating unit may have one or more emission allowance accounts + """ + #: The type of emission, for example sulfur dioxide (SO2). The y1AxisUnits of the curve contains the unit of measure (e.g. kg) and the emissionType is the type of emission (e.g. sulfer dioxide). Values are: "carbonDisulfide", "sulfurDioxide", "hydrogenSulfide", "chlorine", "carbonDioxide", "nitrogenOxide" + self.emissionType = emissionType + + #: The source of the emission value. Values are: "calculated", "measured" + self.emissionValueSource = emissionValueSource + + self._ThermalGeneratingUnit = None + self.ThermalGeneratingUnit = ThermalGeneratingUnit + + super(EmissionAccount, self).__init__(*args, **kw_args) + + _attrs = ["emissionType", "emissionValueSource"] + _attr_types = {"emissionType": str, "emissionValueSource": str} + _defaults = {"emissionType": "carbonDisulfide", "emissionValueSource": "calculated"} + _enums = {"emissionType": "EmissionType", "emissionValueSource": "EmissionValueSource"} + _refs = ["ThermalGeneratingUnit"] + _many_refs = [] + + def getThermalGeneratingUnit(self): + """A thermal generating unit may have one or more emission allowance accounts + """ + return self._ThermalGeneratingUnit + + def setThermalGeneratingUnit(self, value): + if self._ThermalGeneratingUnit is not None: + filtered = [x for x in self.ThermalGeneratingUnit.EmmissionAccounts if x != self] + self._ThermalGeneratingUnit._EmmissionAccounts = filtered + + self._ThermalGeneratingUnit = value + if self._ThermalGeneratingUnit is not None: + if self not in self._ThermalGeneratingUnit._EmmissionAccounts: + self._ThermalGeneratingUnit._EmmissionAccounts.append(self) + + ThermalGeneratingUnit = property(getThermalGeneratingUnit, setThermalGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/EmissionCurve.py b/CIM16/IEC61970/Generation/Production/EmissionCurve.py new file mode 100755 index 00000000..986a36a5 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/EmissionCurve.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class EmissionCurve(Curve): + """Relationship between the unit's emission rate in units of mass per hour (Y-axis) and output active power (X-axis) for a given type of emission. This curve applies when only one type of fuel is being burned.Relationship between the unit's emission rate in units of mass per hour (Y-axis) and output active power (X-axis) for a given type of emission. This curve applies when only one type of fuel is being burned. + """ + + def __init__(self, emissionContent=0.0, isNetGrossP=False, emissionType="carbonDisulfide", ThermalGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'EmissionCurve' instance. + + @param emissionContent: The emission content per quantity of fuel burned + @param isNetGrossP: Flag is set to true when output is expressed in net active power + @param emissionType: The type of emission, which also gives the production rate measurement unit. The y1AxisUnits of the curve contains the unit of measure (e.g. kg) and the emissionType is the type of emission (e.g. sulfer dioxide). Values are: "carbonDisulfide", "sulfurDioxide", "hydrogenSulfide", "chlorine", "carbonDioxide", "nitrogenOxide" + @param ThermalGeneratingUnit: A thermal generating unit may have one or more emission curves + """ + #: The emission content per quantity of fuel burned + self.emissionContent = emissionContent + + #: Flag is set to true when output is expressed in net active power + self.isNetGrossP = isNetGrossP + + #: The type of emission, which also gives the production rate measurement unit. The y1AxisUnits of the curve contains the unit of measure (e.g. kg) and the emissionType is the type of emission (e.g. sulfer dioxide). Values are: "carbonDisulfide", "sulfurDioxide", "hydrogenSulfide", "chlorine", "carbonDioxide", "nitrogenOxide" + self.emissionType = emissionType + + self._ThermalGeneratingUnit = None + self.ThermalGeneratingUnit = ThermalGeneratingUnit + + super(EmissionCurve, self).__init__(*args, **kw_args) + + _attrs = ["emissionContent", "isNetGrossP", "emissionType"] + _attr_types = {"emissionContent": float, "isNetGrossP": bool, "emissionType": str} + _defaults = {"emissionContent": 0.0, "isNetGrossP": False, "emissionType": "carbonDisulfide"} + _enums = {"emissionType": "EmissionType"} + _refs = ["ThermalGeneratingUnit"] + _many_refs = [] + + def getThermalGeneratingUnit(self): + """A thermal generating unit may have one or more emission curves + """ + return self._ThermalGeneratingUnit + + def setThermalGeneratingUnit(self, value): + if self._ThermalGeneratingUnit is not None: + filtered = [x for x in self.ThermalGeneratingUnit.EmissionCurves if x != self] + self._ThermalGeneratingUnit._EmissionCurves = filtered + + self._ThermalGeneratingUnit = value + if self._ThermalGeneratingUnit is not None: + if self not in self._ThermalGeneratingUnit._EmissionCurves: + self._ThermalGeneratingUnit._EmissionCurves.append(self) + + ThermalGeneratingUnit = property(getThermalGeneratingUnit, setThermalGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/FossilFuel.py b/CIM16/IEC61970/Generation/Production/FossilFuel.py new file mode 100755 index 00000000..13164fa0 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/FossilFuel.py @@ -0,0 +1,126 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class FossilFuel(IdentifiedObject): + """The fossil fuel consumed by the non-nuclear thermal generating units, e.g., coal, oil, gasThe fossil fuel consumed by the non-nuclear thermal generating units, e.g., coal, oil, gas + """ + + def __init__(self, fuelSulfur=0.0, fuelCost=0.0, fossilFuelType="oil", lowBreakpointP=0.0, fuelDispatchCost=0.0, fuelHandlingCost=0.0, fuelHeatContent=0.0, fuelEffFactor=0.0, fuelMixture=0.0, highBreakpointP=0.0, ThermalGeneratingUnit=None, FuelAllocationSchedules=None, *args, **kw_args): + """Initialises a new 'FossilFuel' instance. + + @param fuelSulfur: The fuel's fraction of pollution credit per unit of heat content + @param fuelCost: The cost in terms of heat value for the given type of fuel + @param fossilFuelType: The type of fossil fuel, such as coal, oil, or gas. Values are: "oil", "coal", "lignite", "gas" + @param lowBreakpointP: The active power output level of the unit at which the given type of fuel is switched off. This fuel (e.g., oil) is sometimes used to stabilize the base fuel (e.g., coal) at low active power output levels. + @param fuelDispatchCost: The cost of fuel used for economic dispatching which includes: fuel cost, transportation cost, and incremental maintenance cost + @param fuelHandlingCost: Handling and processing cost associated with this fuel + @param fuelHeatContent: The amount of heat per weight (or volume) of the given type of fuel + @param fuelEffFactor: The efficiency factor for the fuel (per unit) in terms of the effective energy absorbed + @param fuelMixture: Relative amount of the given type of fuel, when multiple fuels are being consumed. + @param highBreakpointP: The active power output level of the unit at which the given type of fuel is switched on. This fuel (e.g., oil) is sometimes used to supplement the base fuel (e.g., coal) at high active power output levels. + @param ThermalGeneratingUnit: A thermal generating unit may have one or more fossil fuels + @param FuelAllocationSchedules: A fuel allocation schedule must have a fossil fuel + """ + #: The fuel's fraction of pollution credit per unit of heat content + self.fuelSulfur = fuelSulfur + + #: The cost in terms of heat value for the given type of fuel + self.fuelCost = fuelCost + + #: The type of fossil fuel, such as coal, oil, or gas. Values are: "oil", "coal", "lignite", "gas" + self.fossilFuelType = fossilFuelType + + #: The active power output level of the unit at which the given type of fuel is switched off. This fuel (e.g., oil) is sometimes used to stabilize the base fuel (e.g., coal) at low active power output levels. + self.lowBreakpointP = lowBreakpointP + + #: The cost of fuel used for economic dispatching which includes: fuel cost, transportation cost, and incremental maintenance cost + self.fuelDispatchCost = fuelDispatchCost + + #: Handling and processing cost associated with this fuel + self.fuelHandlingCost = fuelHandlingCost + + #: The amount of heat per weight (or volume) of the given type of fuel + self.fuelHeatContent = fuelHeatContent + + #: The efficiency factor for the fuel (per unit) in terms of the effective energy absorbed + self.fuelEffFactor = fuelEffFactor + + #: Relative amount of the given type of fuel, when multiple fuels are being consumed. + self.fuelMixture = fuelMixture + + #: The active power output level of the unit at which the given type of fuel is switched on. This fuel (e.g., oil) is sometimes used to supplement the base fuel (e.g., coal) at high active power output levels. + self.highBreakpointP = highBreakpointP + + self._ThermalGeneratingUnit = None + self.ThermalGeneratingUnit = ThermalGeneratingUnit + + self._FuelAllocationSchedules = [] + self.FuelAllocationSchedules = [] if FuelAllocationSchedules is None else FuelAllocationSchedules + + super(FossilFuel, self).__init__(*args, **kw_args) + + _attrs = ["fuelSulfur", "fuelCost", "fossilFuelType", "lowBreakpointP", "fuelDispatchCost", "fuelHandlingCost", "fuelHeatContent", "fuelEffFactor", "fuelMixture", "highBreakpointP"] + _attr_types = {"fuelSulfur": float, "fuelCost": float, "fossilFuelType": str, "lowBreakpointP": float, "fuelDispatchCost": float, "fuelHandlingCost": float, "fuelHeatContent": float, "fuelEffFactor": float, "fuelMixture": float, "highBreakpointP": float} + _defaults = {"fuelSulfur": 0.0, "fuelCost": 0.0, "fossilFuelType": "oil", "lowBreakpointP": 0.0, "fuelDispatchCost": 0.0, "fuelHandlingCost": 0.0, "fuelHeatContent": 0.0, "fuelEffFactor": 0.0, "fuelMixture": 0.0, "highBreakpointP": 0.0} + _enums = {"fossilFuelType": "FuelType"} + _refs = ["ThermalGeneratingUnit", "FuelAllocationSchedules"] + _many_refs = ["FuelAllocationSchedules"] + + def getThermalGeneratingUnit(self): + """A thermal generating unit may have one or more fossil fuels + """ + return self._ThermalGeneratingUnit + + def setThermalGeneratingUnit(self, value): + if self._ThermalGeneratingUnit is not None: + filtered = [x for x in self.ThermalGeneratingUnit.FossilFuels if x != self] + self._ThermalGeneratingUnit._FossilFuels = filtered + + self._ThermalGeneratingUnit = value + if self._ThermalGeneratingUnit is not None: + if self not in self._ThermalGeneratingUnit._FossilFuels: + self._ThermalGeneratingUnit._FossilFuels.append(self) + + ThermalGeneratingUnit = property(getThermalGeneratingUnit, setThermalGeneratingUnit) + + def getFuelAllocationSchedules(self): + """A fuel allocation schedule must have a fossil fuel + """ + return self._FuelAllocationSchedules + + def setFuelAllocationSchedules(self, value): + for x in self._FuelAllocationSchedules: + x.FossilFuel = None + for y in value: + y._FossilFuel = self + self._FuelAllocationSchedules = value + + FuelAllocationSchedules = property(getFuelAllocationSchedules, setFuelAllocationSchedules) + + def addFuelAllocationSchedules(self, *FuelAllocationSchedules): + for obj in FuelAllocationSchedules: + obj.FossilFuel = self + + def removeFuelAllocationSchedules(self, *FuelAllocationSchedules): + for obj in FuelAllocationSchedules: + obj.FossilFuel = None + diff --git a/CIM16/IEC61970/Generation/Production/FuelAllocationSchedule.py b/CIM16/IEC61970/Generation/Production/FuelAllocationSchedule.py new file mode 100755 index 00000000..f5fce151 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/FuelAllocationSchedule.py @@ -0,0 +1,101 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class FuelAllocationSchedule(Curve): + """The amount of fuel of a given type which is allocated for consumption over a specified period of timeThe amount of fuel of a given type which is allocated for consumption over a specified period of time + """ + + def __init__(self, minFuelAllocation=0.0, fuelAllocationEndDate='', maxFuelAllocation=0.0, fuelAllocationStartDate='', fuelType="oil", FossilFuel=None, ThermalGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'FuelAllocationSchedule' instance. + + @param minFuelAllocation: The minimum amount fuel that is allocated for consumption for the scheduled time period, e.g., based on a 'take-or-pay' contract + @param fuelAllocationEndDate: The end time and date of the fuel allocation schedule + @param maxFuelAllocation: The maximum amount fuel that is allocated for consumption for the scheduled time period + @param fuelAllocationStartDate: The start time and date of the fuel allocation schedule + @param fuelType: The type of fuel, which also indicates the corresponding measurement unit Values are: "oil", "coal", "lignite", "gas" + @param FossilFuel: A fuel allocation schedule must have a fossil fuel + @param ThermalGeneratingUnit: A thermal generating unit may have one or more fuel allocation schedules + """ + #: The minimum amount fuel that is allocated for consumption for the scheduled time period, e.g., based on a 'take-or-pay' contract + self.minFuelAllocation = minFuelAllocation + + #: The end time and date of the fuel allocation schedule + self.fuelAllocationEndDate = fuelAllocationEndDate + + #: The maximum amount fuel that is allocated for consumption for the scheduled time period + self.maxFuelAllocation = maxFuelAllocation + + #: The start time and date of the fuel allocation schedule + self.fuelAllocationStartDate = fuelAllocationStartDate + + #: The type of fuel, which also indicates the corresponding measurement unit Values are: "oil", "coal", "lignite", "gas" + self.fuelType = fuelType + + self._FossilFuel = None + self.FossilFuel = FossilFuel + + self._ThermalGeneratingUnit = None + self.ThermalGeneratingUnit = ThermalGeneratingUnit + + super(FuelAllocationSchedule, self).__init__(*args, **kw_args) + + _attrs = ["minFuelAllocation", "fuelAllocationEndDate", "maxFuelAllocation", "fuelAllocationStartDate", "fuelType"] + _attr_types = {"minFuelAllocation": float, "fuelAllocationEndDate": str, "maxFuelAllocation": float, "fuelAllocationStartDate": str, "fuelType": str} + _defaults = {"minFuelAllocation": 0.0, "fuelAllocationEndDate": '', "maxFuelAllocation": 0.0, "fuelAllocationStartDate": '', "fuelType": "oil"} + _enums = {"fuelType": "FuelType"} + _refs = ["FossilFuel", "ThermalGeneratingUnit"] + _many_refs = [] + + def getFossilFuel(self): + """A fuel allocation schedule must have a fossil fuel + """ + return self._FossilFuel + + def setFossilFuel(self, value): + if self._FossilFuel is not None: + filtered = [x for x in self.FossilFuel.FuelAllocationSchedules if x != self] + self._FossilFuel._FuelAllocationSchedules = filtered + + self._FossilFuel = value + if self._FossilFuel is not None: + if self not in self._FossilFuel._FuelAllocationSchedules: + self._FossilFuel._FuelAllocationSchedules.append(self) + + FossilFuel = property(getFossilFuel, setFossilFuel) + + def getThermalGeneratingUnit(self): + """A thermal generating unit may have one or more fuel allocation schedules + """ + return self._ThermalGeneratingUnit + + def setThermalGeneratingUnit(self, value): + if self._ThermalGeneratingUnit is not None: + filtered = [x for x in self.ThermalGeneratingUnit.FuelAllocationSchedules if x != self] + self._ThermalGeneratingUnit._FuelAllocationSchedules = filtered + + self._ThermalGeneratingUnit = value + if self._ThermalGeneratingUnit is not None: + if self not in self._ThermalGeneratingUnit._FuelAllocationSchedules: + self._ThermalGeneratingUnit._FuelAllocationSchedules.append(self) + + ThermalGeneratingUnit = property(getThermalGeneratingUnit, setThermalGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/GenUnitOpCostCurve.py b/CIM16/IEC61970/Generation/Production/GenUnitOpCostCurve.py new file mode 100755 index 00000000..b07d746e --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/GenUnitOpCostCurve.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class GenUnitOpCostCurve(Curve): + """Relationship between unit operating cost (Y-axis) and unit output active power (X-axis). The operating cost curve for thermal units is derived from heat input and fuel costs. The operating cost curve for hydro units is derived from water flow rates and equivalent water costs.Relationship between unit operating cost (Y-axis) and unit output active power (X-axis). The operating cost curve for thermal units is derived from heat input and fuel costs. The operating cost curve for hydro units is derived from water flow rates and equivalent water costs. + """ + + def __init__(self, isNetGrossP=False, GeneratingUnit=None, *args, **kw_args): + """Initialises a new 'GenUnitOpCostCurve' instance. + + @param isNetGrossP: Flag is set to true when output is expressed in net active power + @param GeneratingUnit: A generating unit may have one or more cost curves, depending upon fuel mixture and fuel cost. + """ + #: Flag is set to true when output is expressed in net active power + self.isNetGrossP = isNetGrossP + + self._GeneratingUnit = None + self.GeneratingUnit = GeneratingUnit + + super(GenUnitOpCostCurve, self).__init__(*args, **kw_args) + + _attrs = ["isNetGrossP"] + _attr_types = {"isNetGrossP": bool} + _defaults = {"isNetGrossP": False} + _enums = {} + _refs = ["GeneratingUnit"] + _many_refs = [] + + def getGeneratingUnit(self): + """A generating unit may have one or more cost curves, depending upon fuel mixture and fuel cost. + """ + return self._GeneratingUnit + + def setGeneratingUnit(self, value): + if self._GeneratingUnit is not None: + filtered = [x for x in self.GeneratingUnit.GenUnitOpCostCurves if x != self] + self._GeneratingUnit._GenUnitOpCostCurves = filtered + + self._GeneratingUnit = value + if self._GeneratingUnit is not None: + if self not in self._GeneratingUnit._GenUnitOpCostCurves: + self._GeneratingUnit._GenUnitOpCostCurves.append(self) + + GeneratingUnit = property(getGeneratingUnit, setGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/GenUnitOpSchedule.py b/CIM16/IEC61970/Generation/Production/GenUnitOpSchedule.py new file mode 100755 index 00000000..fc91e8c0 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/GenUnitOpSchedule.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.RegularIntervalSchedule import RegularIntervalSchedule + +class GenUnitOpSchedule(RegularIntervalSchedule): + """The generating unit's Operator-approved current operating schedule (or plan), typically produced with the aid of unit commitment type analyses. The X-axis represents absolute time. The Y1-axis represents the status (0=off-line and unavailable: 1=available: 2=must run: 3=must run at fixed power value: etc.). The Y2-axis represents the must run fixed power value where required.The generating unit's Operator-approved current operating schedule (or plan), typically produced with the aid of unit commitment type analyses. The X-axis represents absolute time. The Y1-axis represents the status (0=off-line and unavailable: 1=available: 2=must run: 3=must run at fixed power value: etc.). The Y2-axis represents the must run fixed power value where required. + """ + + def __init__(self, GeneratingUnit=None, *args, **kw_args): + """Initialises a new 'GenUnitOpSchedule' instance. + + @param GeneratingUnit: A generating unit may have an operating schedule, indicating the planned operation of the unit + """ + self._GeneratingUnit = None + self.GeneratingUnit = GeneratingUnit + + super(GenUnitOpSchedule, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["GeneratingUnit"] + _many_refs = [] + + def getGeneratingUnit(self): + """A generating unit may have an operating schedule, indicating the planned operation of the unit + """ + return self._GeneratingUnit + + def setGeneratingUnit(self, value): + if self._GeneratingUnit is not None: + self._GeneratingUnit._GenUnitOpSchedule = None + + self._GeneratingUnit = value + if self._GeneratingUnit is not None: + self._GeneratingUnit.GenUnitOpSchedule = None + self._GeneratingUnit._GenUnitOpSchedule = self + + GeneratingUnit = property(getGeneratingUnit, setGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/GeneratingUnit.py b/CIM16/IEC61970/Generation/Production/GeneratingUnit.py new file mode 100755 index 00000000..1a1e71ae --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/GeneratingUnit.py @@ -0,0 +1,335 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Equipment import Equipment + +class GeneratingUnit(Equipment): + """A single or set of synchronous machines for converting mechanical power into alternating-current power. For example, individual machines within a set may be defined for scheduling purposes while a single control signal is derived for the set. In this case there would be a GeneratingUnit for each member of the set and an additional GeneratingUnit corresponding to the set.A single or set of synchronous machines for converting mechanical power into alternating-current power. For example, individual machines within a set may be defined for scheduling purposes while a single control signal is derived for the set. In this case there would be a GeneratingUnit for each member of the set and an additional GeneratingUnit corresponding to the set. + """ + + def __init__(self, ratedGrossMinP=0.0, efficiency=0.0, stepChange=0.0, ratedNetMaxP=0.0, tieLinePF=0.0, dispReserveFlag=False, controlPulseHigh=0.0, startupTime=0.0, maxOperatingP=0.0, genControlSource="plantControl", normalPF=0.0, initialP=0.0, spinReserveRamp=0.0, allocSpinResP=0.0, minEconomicP=0.0, longPF=0.0, nominalP=0.0, controlResponseRate=0.0, ratedGrossMaxP=0.0, penaltyFactor=0.0, fastStartFlag=False, minimumOffTime=0.0, shortPF=0.0, governorMPL=0.0, energyMinP=0.0, fuelPriority=0, maxEconomicP=0.0, autoCntrlMarginP=0.0, highControlLimit=0.0, modelDetail="", controlPulseLow=0.0, raiseRampRate=0.0, controlDeadband=0.0, baseP=0.0, startupCost=0.0, variableCost=0.0, genOperatingMode="MRN", lowerRampRate=0.0, minOperatingP=0.0, lowControlLimit=0.0, maximumAllowableSpinningReserve=0.0, genControlMode="setpoint", governorSCD=0.0, ControlAreaGeneratingUnit=None, SynchronousMachines=None, GenUnitOpSchedule=None, GrossToNetActivePowerCurves=None, GenUnitOpCostCurves=None, *args, **kw_args): + """Initialises a new 'GeneratingUnit' instance. + + @param ratedGrossMinP: The gross rated minimum generation level which the unit can safely operate at while delivering power to the transmission grid + @param efficiency: The efficiency of the unit in converting mechanical energy, from the prime mover, into electrical energy. + @param stepChange: + @param ratedNetMaxP: The net rated maximum capacity determined by subtracting the auxiliary power used to operate the internal plant machinery from the rated gross maximum capacity + @param tieLinePF: Generating unit economic participation factor + @param dispReserveFlag: + @param controlPulseHigh: Pulse high limit which is the largest control pulse that the unit can respond to + @param startupTime: Time it takes to get the unit on-line, from the time that the prime mover mechanical power is applied + @param maxOperatingP: This is the maximum operating active power limit the dispatcher can enter for this unit + @param genControlSource: The source of controls for a generating unit. Values are: "plantControl", "offAGC", "unavailable", "onAGC" + @param normalPF: Generating unit economic participation factor + @param initialP: Default Initial active power which is used to store a powerflow result for the initial active power for this unit in this network configuration + @param spinReserveRamp: + @param allocSpinResP: The planned unused capacity (spinning reserve) which can be used to support emergency load + @param minEconomicP: Low economic active power limit that must be greater than or equal to the minimum operating active power limit + @param longPF: Generating unit economic participation factor + @param nominalP: The nominal power of the generating unit. Used to give precise meaning to percentage based attributes such as the govenor speed change droop (govenorSCD attribute). + @param controlResponseRate: Unit response rate which specifies the active power change for a control pulse of one second in the most responsive loading level of the unit. + @param ratedGrossMaxP: The unit's gross rated maximum capacity (Book Value). + @param penaltyFactor: Defined as: 1 / ( 1 - Incremental Transmission Loss); with the Incremental Transmission Loss expressed as a plus or minus value. The typical range of penalty factors is (0.9 to 1.1). + @param fastStartFlag: + @param minimumOffTime: Minimum time interval between unit shutdown and startup + @param shortPF: Generating unit economic participation factor + @param governorMPL: Governor Motor Position Limit + @param energyMinP: + @param fuelPriority: + @param maxEconomicP: Maximum high economic active power limit, that should not exceed the maximum operating active power limit + @param autoCntrlMarginP: The planned unused capacity which can be used to support automatic control overruns. + @param highControlLimit: High limit for secondary (AGC) control + @param modelDetail: Detail level of the generator model data + @param controlPulseLow: Pulse low limit which is the smallest control pulse that the unit can respond to + @param raiseRampRate: + @param controlDeadband: Unit control error deadband. When a unit's desired active power change is less than this deadband, then no control pulses will be sent to the unit. + @param baseP: For dispatchable units, this value represents the economic active power basepoint, for units that are not dispatchable, this value represents the fixed generation value. The value must be between the operating low and high limits. + @param startupCost: The initial startup cost incurred for each start of the GeneratingUnit. + @param variableCost: The variable cost component of production per unit of ActivePower. + @param genOperatingMode: Operating mode for secondary control. Values are: "MRN", "EDC", "LFC", "fixed", "REG", "AGC", "manual", "off" + @param lowerRampRate: + @param minOperatingP: This is the minimum operating active power limit the dispatcher can enter for this unit. + @param lowControlLimit: Low limit for secondary (AGC) control + @param maximumAllowableSpinningReserve: Maximum allowable spinning reserve. Spinning reserve will never be considered greater than this value regardless of the current operating point. + @param genControlMode: The unit control mode. Values are: "setpoint", "pulse" + @param governorSCD: Governor Speed Changer Droop. This is the change in generator power output divided by the change in frequency normalized by the nominal power of the generator and the nominal frequency and expressed in percent and negated. A positive value of speed change droop provides additional generator output upon a drop in frequency. + @param ControlAreaGeneratingUnit: ControlArea specifications for this generating unit. + @param SynchronousMachines: A synchronous machine may operate as a generator and as such becomes a member of a generating unit + @param GenUnitOpSchedule: A generating unit may have an operating schedule, indicating the planned operation of the unit + @param GrossToNetActivePowerCurves: A generating unit may have a gross active power to net active power curve, describing the losses and auxiliary power requirements of the unit + @param GenUnitOpCostCurves: A generating unit may have one or more cost curves, depending upon fuel mixture and fuel cost. + """ + #: The gross rated minimum generation level which the unit can safely operate at while delivering power to the transmission grid + self.ratedGrossMinP = ratedGrossMinP + + #: The efficiency of the unit in converting mechanical energy, from the prime mover, into electrical energy. + self.efficiency = efficiency + + + self.stepChange = stepChange + + #: The net rated maximum capacity determined by subtracting the auxiliary power used to operate the internal plant machinery from the rated gross maximum capacity + self.ratedNetMaxP = ratedNetMaxP + + #: Generating unit economic participation factor + self.tieLinePF = tieLinePF + + + self.dispReserveFlag = dispReserveFlag + + #: Pulse high limit which is the largest control pulse that the unit can respond to + self.controlPulseHigh = controlPulseHigh + + #: Time it takes to get the unit on-line, from the time that the prime mover mechanical power is applied + self.startupTime = startupTime + + #: This is the maximum operating active power limit the dispatcher can enter for this unit + self.maxOperatingP = maxOperatingP + + #: The source of controls for a generating unit. Values are: "plantControl", "offAGC", "unavailable", "onAGC" + self.genControlSource = genControlSource + + #: Generating unit economic participation factor + self.normalPF = normalPF + + #: Default Initial active power which is used to store a powerflow result for the initial active power for this unit in this network configuration + self.initialP = initialP + + + self.spinReserveRamp = spinReserveRamp + + #: The planned unused capacity (spinning reserve) which can be used to support emergency load + self.allocSpinResP = allocSpinResP + + #: Low economic active power limit that must be greater than or equal to the minimum operating active power limit + self.minEconomicP = minEconomicP + + #: Generating unit economic participation factor + self.longPF = longPF + + #: The nominal power of the generating unit. Used to give precise meaning to percentage based attributes such as the govenor speed change droop (govenorSCD attribute). + self.nominalP = nominalP + + #: Unit response rate which specifies the active power change for a control pulse of one second in the most responsive loading level of the unit. + self.controlResponseRate = controlResponseRate + + #: The unit's gross rated maximum capacity (Book Value). + self.ratedGrossMaxP = ratedGrossMaxP + + #: Defined as: 1 / ( 1 - Incremental Transmission Loss); with the Incremental Transmission Loss expressed as a plus or minus value. The typical range of penalty factors is (0.9 to 1.1). + self.penaltyFactor = penaltyFactor + + + self.fastStartFlag = fastStartFlag + + #: Minimum time interval between unit shutdown and startup + self.minimumOffTime = minimumOffTime + + #: Generating unit economic participation factor + self.shortPF = shortPF + + #: Governor Motor Position Limit + self.governorMPL = governorMPL + + + self.energyMinP = energyMinP + + + self.fuelPriority = fuelPriority + + #: Maximum high economic active power limit, that should not exceed the maximum operating active power limit + self.maxEconomicP = maxEconomicP + + #: The planned unused capacity which can be used to support automatic control overruns. + self.autoCntrlMarginP = autoCntrlMarginP + + #: High limit for secondary (AGC) control + self.highControlLimit = highControlLimit + + #: Detail level of the generator model data + self.modelDetail = modelDetail + + #: Pulse low limit which is the smallest control pulse that the unit can respond to + self.controlPulseLow = controlPulseLow + + + self.raiseRampRate = raiseRampRate + + #: Unit control error deadband. When a unit's desired active power change is less than this deadband, then no control pulses will be sent to the unit. + self.controlDeadband = controlDeadband + + #: For dispatchable units, this value represents the economic active power basepoint, for units that are not dispatchable, this value represents the fixed generation value. The value must be between the operating low and high limits. + self.baseP = baseP + + #: The initial startup cost incurred for each start of the GeneratingUnit. + self.startupCost = startupCost + + #: The variable cost component of production per unit of ActivePower. + self.variableCost = variableCost + + #: Operating mode for secondary control. Values are: "MRN", "EDC", "LFC", "fixed", "REG", "AGC", "manual", "off" + self.genOperatingMode = genOperatingMode + + + self.lowerRampRate = lowerRampRate + + #: This is the minimum operating active power limit the dispatcher can enter for this unit. + self.minOperatingP = minOperatingP + + #: Low limit for secondary (AGC) control + self.lowControlLimit = lowControlLimit + + #: Maximum allowable spinning reserve. Spinning reserve will never be considered greater than this value regardless of the current operating point. + self.maximumAllowableSpinningReserve = maximumAllowableSpinningReserve + + #: The unit control mode. Values are: "setpoint", "pulse" + self.genControlMode = genControlMode + + #: Governor Speed Changer Droop. This is the change in generator power output divided by the change in frequency normalized by the nominal power of the generator and the nominal frequency and expressed in percent and negated. A positive value of speed change droop provides additional generator output upon a drop in frequency. + self.governorSCD = governorSCD + + self._ControlAreaGeneratingUnit = [] + self.ControlAreaGeneratingUnit = [] if ControlAreaGeneratingUnit is None else ControlAreaGeneratingUnit + + self._SynchronousMachines = [] + self.SynchronousMachines = [] if SynchronousMachines is None else SynchronousMachines + + self._GenUnitOpSchedule = None + self.GenUnitOpSchedule = GenUnitOpSchedule + + self._GrossToNetActivePowerCurves = [] + self.GrossToNetActivePowerCurves = [] if GrossToNetActivePowerCurves is None else GrossToNetActivePowerCurves + + self._GenUnitOpCostCurves = [] + self.GenUnitOpCostCurves = [] if GenUnitOpCostCurves is None else GenUnitOpCostCurves + + super(GeneratingUnit, self).__init__(*args, **kw_args) + + _attrs = ["ratedGrossMinP", "efficiency", "stepChange", "ratedNetMaxP", "tieLinePF", "dispReserveFlag", "controlPulseHigh", "startupTime", "maxOperatingP", "genControlSource", "normalPF", "initialP", "spinReserveRamp", "allocSpinResP", "minEconomicP", "longPF", "nominalP", "controlResponseRate", "ratedGrossMaxP", "penaltyFactor", "fastStartFlag", "minimumOffTime", "shortPF", "governorMPL", "energyMinP", "fuelPriority", "maxEconomicP", "autoCntrlMarginP", "highControlLimit", "modelDetail", "controlPulseLow", "raiseRampRate", "controlDeadband", "baseP", "startupCost", "variableCost", "genOperatingMode", "lowerRampRate", "minOperatingP", "lowControlLimit", "maximumAllowableSpinningReserve", "genControlMode", "governorSCD"] + _attr_types = {"ratedGrossMinP": float, "efficiency": float, "stepChange": float, "ratedNetMaxP": float, "tieLinePF": float, "dispReserveFlag": bool, "controlPulseHigh": float, "startupTime": float, "maxOperatingP": float, "genControlSource": str, "normalPF": float, "initialP": float, "spinReserveRamp": float, "allocSpinResP": float, "minEconomicP": float, "longPF": float, "nominalP": float, "controlResponseRate": float, "ratedGrossMaxP": float, "penaltyFactor": float, "fastStartFlag": bool, "minimumOffTime": float, "shortPF": float, "governorMPL": float, "energyMinP": float, "fuelPriority": int, "maxEconomicP": float, "autoCntrlMarginP": float, "highControlLimit": float, "modelDetail": str, "controlPulseLow": float, "raiseRampRate": float, "controlDeadband": float, "baseP": float, "startupCost": float, "variableCost": float, "genOperatingMode": str, "lowerRampRate": float, "minOperatingP": float, "lowControlLimit": float, "maximumAllowableSpinningReserve": float, "genControlMode": str, "governorSCD": float} + _defaults = {"ratedGrossMinP": 0.0, "efficiency": 0.0, "stepChange": 0.0, "ratedNetMaxP": 0.0, "tieLinePF": 0.0, "dispReserveFlag": False, "controlPulseHigh": 0.0, "startupTime": 0.0, "maxOperatingP": 0.0, "genControlSource": "plantControl", "normalPF": 0.0, "initialP": 0.0, "spinReserveRamp": 0.0, "allocSpinResP": 0.0, "minEconomicP": 0.0, "longPF": 0.0, "nominalP": 0.0, "controlResponseRate": 0.0, "ratedGrossMaxP": 0.0, "penaltyFactor": 0.0, "fastStartFlag": False, "minimumOffTime": 0.0, "shortPF": 0.0, "governorMPL": 0.0, "energyMinP": 0.0, "fuelPriority": 0, "maxEconomicP": 0.0, "autoCntrlMarginP": 0.0, "highControlLimit": 0.0, "modelDetail": "", "controlPulseLow": 0.0, "raiseRampRate": 0.0, "controlDeadband": 0.0, "baseP": 0.0, "startupCost": 0.0, "variableCost": 0.0, "genOperatingMode": "MRN", "lowerRampRate": 0.0, "minOperatingP": 0.0, "lowControlLimit": 0.0, "maximumAllowableSpinningReserve": 0.0, "genControlMode": "setpoint", "governorSCD": 0.0} + _enums = {"genControlSource": "GeneratorControlSource", "genOperatingMode": "GeneratorOperatingMode", "genControlMode": "GeneratorControlMode"} + _refs = ["ControlAreaGeneratingUnit", "SynchronousMachines", "GenUnitOpSchedule", "GrossToNetActivePowerCurves", "GenUnitOpCostCurves"] + _many_refs = ["ControlAreaGeneratingUnit", "SynchronousMachines", "GrossToNetActivePowerCurves", "GenUnitOpCostCurves"] + + def getControlAreaGeneratingUnit(self): + """ControlArea specifications for this generating unit. + """ + return self._ControlAreaGeneratingUnit + + def setControlAreaGeneratingUnit(self, value): + for x in self._ControlAreaGeneratingUnit: + x.GeneratingUnit = None + for y in value: + y._GeneratingUnit = self + self._ControlAreaGeneratingUnit = value + + ControlAreaGeneratingUnit = property(getControlAreaGeneratingUnit, setControlAreaGeneratingUnit) + + def addControlAreaGeneratingUnit(self, *ControlAreaGeneratingUnit): + for obj in ControlAreaGeneratingUnit: + obj.GeneratingUnit = self + + def removeControlAreaGeneratingUnit(self, *ControlAreaGeneratingUnit): + for obj in ControlAreaGeneratingUnit: + obj.GeneratingUnit = None + + def getSynchronousMachines(self): + """A synchronous machine may operate as a generator and as such becomes a member of a generating unit + """ + return self._SynchronousMachines + + def setSynchronousMachines(self, value): + for x in self._SynchronousMachines: + x.GeneratingUnit = None + for y in value: + y._GeneratingUnit = self + self._SynchronousMachines = value + + SynchronousMachines = property(getSynchronousMachines, setSynchronousMachines) + + def addSynchronousMachines(self, *SynchronousMachines): + for obj in SynchronousMachines: + obj.GeneratingUnit = self + + def removeSynchronousMachines(self, *SynchronousMachines): + for obj in SynchronousMachines: + obj.GeneratingUnit = None + + def getGenUnitOpSchedule(self): + """A generating unit may have an operating schedule, indicating the planned operation of the unit + """ + return self._GenUnitOpSchedule + + def setGenUnitOpSchedule(self, value): + if self._GenUnitOpSchedule is not None: + self._GenUnitOpSchedule._GeneratingUnit = None + + self._GenUnitOpSchedule = value + if self._GenUnitOpSchedule is not None: + self._GenUnitOpSchedule.GeneratingUnit = None + self._GenUnitOpSchedule._GeneratingUnit = self + + GenUnitOpSchedule = property(getGenUnitOpSchedule, setGenUnitOpSchedule) + + def getGrossToNetActivePowerCurves(self): + """A generating unit may have a gross active power to net active power curve, describing the losses and auxiliary power requirements of the unit + """ + return self._GrossToNetActivePowerCurves + + def setGrossToNetActivePowerCurves(self, value): + for x in self._GrossToNetActivePowerCurves: + x.GeneratingUnit = None + for y in value: + y._GeneratingUnit = self + self._GrossToNetActivePowerCurves = value + + GrossToNetActivePowerCurves = property(getGrossToNetActivePowerCurves, setGrossToNetActivePowerCurves) + + def addGrossToNetActivePowerCurves(self, *GrossToNetActivePowerCurves): + for obj in GrossToNetActivePowerCurves: + obj.GeneratingUnit = self + + def removeGrossToNetActivePowerCurves(self, *GrossToNetActivePowerCurves): + for obj in GrossToNetActivePowerCurves: + obj.GeneratingUnit = None + + def getGenUnitOpCostCurves(self): + """A generating unit may have one or more cost curves, depending upon fuel mixture and fuel cost. + """ + return self._GenUnitOpCostCurves + + def setGenUnitOpCostCurves(self, value): + for x in self._GenUnitOpCostCurves: + x.GeneratingUnit = None + for y in value: + y._GeneratingUnit = self + self._GenUnitOpCostCurves = value + + GenUnitOpCostCurves = property(getGenUnitOpCostCurves, setGenUnitOpCostCurves) + + def addGenUnitOpCostCurves(self, *GenUnitOpCostCurves): + for obj in GenUnitOpCostCurves: + obj.GeneratingUnit = self + + def removeGenUnitOpCostCurves(self, *GenUnitOpCostCurves): + for obj in GenUnitOpCostCurves: + obj.GeneratingUnit = None + diff --git a/CIM16/IEC61970/Generation/Production/GrossToNetActivePowerCurve.py b/CIM16/IEC61970/Generation/Production/GrossToNetActivePowerCurve.py new file mode 100755 index 00000000..f364bc4d --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/GrossToNetActivePowerCurve.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class GrossToNetActivePowerCurve(Curve): + """Relationship between the generating unit's gross active power output on the X-axis (measured at the terminals of the machine(s)) and the generating unit's net active power output on the Y-axis (based on utility-defined measurements at the power station). Station service loads, when modeled, should be treated as non-conforming bus loads. There may be more than one curve, depending on the auxiliary equipment that is in service.Relationship between the generating unit's gross active power output on the X-axis (measured at the terminals of the machine(s)) and the generating unit's net active power output on the Y-axis (based on utility-defined measurements at the power station). Station service loads, when modeled, should be treated as non-conforming bus loads. There may be more than one curve, depending on the auxiliary equipment that is in service. + """ + + def __init__(self, GeneratingUnit=None, *args, **kw_args): + """Initialises a new 'GrossToNetActivePowerCurve' instance. + + @param GeneratingUnit: A generating unit may have a gross active power to net active power curve, describing the losses and auxiliary power requirements of the unit + """ + self._GeneratingUnit = None + self.GeneratingUnit = GeneratingUnit + + super(GrossToNetActivePowerCurve, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["GeneratingUnit"] + _many_refs = [] + + def getGeneratingUnit(self): + """A generating unit may have a gross active power to net active power curve, describing the losses and auxiliary power requirements of the unit + """ + return self._GeneratingUnit + + def setGeneratingUnit(self, value): + if self._GeneratingUnit is not None: + filtered = [x for x in self.GeneratingUnit.GrossToNetActivePowerCurves if x != self] + self._GeneratingUnit._GrossToNetActivePowerCurves = filtered + + self._GeneratingUnit = value + if self._GeneratingUnit is not None: + if self not in self._GeneratingUnit._GrossToNetActivePowerCurves: + self._GeneratingUnit._GrossToNetActivePowerCurves.append(self) + + GeneratingUnit = property(getGeneratingUnit, setGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/HeatInputCurve.py b/CIM16/IEC61970/Generation/Production/HeatInputCurve.py new file mode 100755 index 00000000..fd54b1eb --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/HeatInputCurve.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class HeatInputCurve(Curve): + """Relationship between unit heat input in energy per time for main fuel (Y1-axis) and supplemental fuel (Y2-axis) versus unit output in active power (X-axis). The quantity of main fuel used to sustain generation at this output level is prorated for throttling between definition points. The quantity of supplemental fuel used at this output level is fixed and not prorated.Relationship between unit heat input in energy per time for main fuel (Y1-axis) and supplemental fuel (Y2-axis) versus unit output in active power (X-axis). The quantity of main fuel used to sustain generation at this output level is prorated for throttling between definition points. The quantity of supplemental fuel used at this output level is fixed and not prorated. + """ + + def __init__(self, isNetGrossP=False, heatInputEff=0.0, heatInputOffset=0.0, auxPowerOffset=0.0, auxPowerMult=0.0, ThermalGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'HeatInputCurve' instance. + + @param isNetGrossP: Flag is set to true when output is expressed in net active power + @param heatInputEff: Heat input - efficiency multiplier adjustment factor. + @param heatInputOffset: Heat input - offset adjustment factor. + @param auxPowerOffset: Power output - auxiliary power offset adjustment factor + @param auxPowerMult: Power output - auxiliary power multiplier adjustment factor. + @param ThermalGeneratingUnit: A thermal generating unit may have a heat input curve + """ + #: Flag is set to true when output is expressed in net active power + self.isNetGrossP = isNetGrossP + + #: Heat input - efficiency multiplier adjustment factor. + self.heatInputEff = heatInputEff + + #: Heat input - offset adjustment factor. + self.heatInputOffset = heatInputOffset + + #: Power output - auxiliary power offset adjustment factor + self.auxPowerOffset = auxPowerOffset + + #: Power output - auxiliary power multiplier adjustment factor. + self.auxPowerMult = auxPowerMult + + self._ThermalGeneratingUnit = None + self.ThermalGeneratingUnit = ThermalGeneratingUnit + + super(HeatInputCurve, self).__init__(*args, **kw_args) + + _attrs = ["isNetGrossP", "heatInputEff", "heatInputOffset", "auxPowerOffset", "auxPowerMult"] + _attr_types = {"isNetGrossP": bool, "heatInputEff": float, "heatInputOffset": float, "auxPowerOffset": float, "auxPowerMult": float} + _defaults = {"isNetGrossP": False, "heatInputEff": 0.0, "heatInputOffset": 0.0, "auxPowerOffset": 0.0, "auxPowerMult": 0.0} + _enums = {} + _refs = ["ThermalGeneratingUnit"] + _many_refs = [] + + def getThermalGeneratingUnit(self): + """A thermal generating unit may have a heat input curve + """ + return self._ThermalGeneratingUnit + + def setThermalGeneratingUnit(self, value): + if self._ThermalGeneratingUnit is not None: + self._ThermalGeneratingUnit._HeatInputCurve = None + + self._ThermalGeneratingUnit = value + if self._ThermalGeneratingUnit is not None: + self._ThermalGeneratingUnit.HeatInputCurve = None + self._ThermalGeneratingUnit._HeatInputCurve = self + + ThermalGeneratingUnit = property(getThermalGeneratingUnit, setThermalGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/HeatRateCurve.py b/CIM16/IEC61970/Generation/Production/HeatRateCurve.py new file mode 100755 index 00000000..bfc4f079 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/HeatRateCurve.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class HeatRateCurve(Curve): + """Relationship between unit heat rate per active power (Y-axis) and unit output (X-axis). The heat input is from all fuels.Relationship between unit heat rate per active power (Y-axis) and unit output (X-axis). The heat input is from all fuels. + """ + + def __init__(self, isNetGrossP=False, ThermalGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'HeatRateCurve' instance. + + @param isNetGrossP: Flag is set to true when output is expressed in net active power + @param ThermalGeneratingUnit: A thermal generating unit may have a heat rate curve + """ + #: Flag is set to true when output is expressed in net active power + self.isNetGrossP = isNetGrossP + + self._ThermalGeneratingUnit = None + self.ThermalGeneratingUnit = ThermalGeneratingUnit + + super(HeatRateCurve, self).__init__(*args, **kw_args) + + _attrs = ["isNetGrossP"] + _attr_types = {"isNetGrossP": bool} + _defaults = {"isNetGrossP": False} + _enums = {} + _refs = ["ThermalGeneratingUnit"] + _many_refs = [] + + def getThermalGeneratingUnit(self): + """A thermal generating unit may have a heat rate curve + """ + return self._ThermalGeneratingUnit + + def setThermalGeneratingUnit(self, value): + if self._ThermalGeneratingUnit is not None: + self._ThermalGeneratingUnit._HeatRateCurve = None + + self._ThermalGeneratingUnit = value + if self._ThermalGeneratingUnit is not None: + self._ThermalGeneratingUnit.HeatRateCurve = None + self._ThermalGeneratingUnit._HeatRateCurve = self + + ThermalGeneratingUnit = property(getThermalGeneratingUnit, setThermalGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/HydroGeneratingEfficiencyCurve.py b/CIM16/IEC61970/Generation/Production/HydroGeneratingEfficiencyCurve.py new file mode 100755 index 00000000..88823a62 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/HydroGeneratingEfficiencyCurve.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class HydroGeneratingEfficiencyCurve(Curve): + """Relationship between unit efficiency in percent and unit output active power for a given net head in meters. The relationship between efficiency, discharge, head, and power output is expressed as follows: E =KP/HQ Where: (E=percentage) (P=active power) (H=height) (Q=volume/time unit) (K=constant) For example, a curve instance for a given net head could relate efficiency (Y-axis) versus active power output (X-axis) or versus discharge on the X-axis.Relationship between unit efficiency in percent and unit output active power for a given net head in meters. The relationship between efficiency, discharge, head, and power output is expressed as follows: E =KP/HQ Where: (E=percentage) (P=active power) (H=height) (Q=volume/time unit) (K=constant) For example, a curve instance for a given net head could relate efficiency (Y-axis) versus active power output (X-axis) or versus discharge on the X-axis. + """ + + def __init__(self, HydroGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'HydroGeneratingEfficiencyCurve' instance. + + @param HydroGeneratingUnit: A hydro generating unit has an efficiency curve + """ + self._HydroGeneratingUnit = None + self.HydroGeneratingUnit = HydroGeneratingUnit + + super(HydroGeneratingEfficiencyCurve, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["HydroGeneratingUnit"] + _many_refs = [] + + def getHydroGeneratingUnit(self): + """A hydro generating unit has an efficiency curve + """ + return self._HydroGeneratingUnit + + def setHydroGeneratingUnit(self, value): + if self._HydroGeneratingUnit is not None: + filtered = [x for x in self.HydroGeneratingUnit.HydroGeneratingEfficiencyCurves if x != self] + self._HydroGeneratingUnit._HydroGeneratingEfficiencyCurves = filtered + + self._HydroGeneratingUnit = value + if self._HydroGeneratingUnit is not None: + if self not in self._HydroGeneratingUnit._HydroGeneratingEfficiencyCurves: + self._HydroGeneratingUnit._HydroGeneratingEfficiencyCurves.append(self) + + HydroGeneratingUnit = property(getHydroGeneratingUnit, setHydroGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/HydroGeneratingUnit.py b/CIM16/IEC61970/Generation/Production/HydroGeneratingUnit.py new file mode 100755 index 00000000..46e417f5 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/HydroGeneratingUnit.py @@ -0,0 +1,140 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Generation.Production.GeneratingUnit import GeneratingUnit + +class HydroGeneratingUnit(GeneratingUnit): + """A generating unit whose prime mover is a hydraulic turbine (e.g., Francis, Pelton, Kaplan)A generating unit whose prime mover is a hydraulic turbine (e.g., Francis, Pelton, Kaplan) + """ + + def __init__(self, energyConversionCapability="generator", hydroUnitWaterCost=0.0, PenstockLossCurve=None, HydroPowerPlant=None, TailbayLossCurve=None, HydroGeneratingEfficiencyCurves=None, *args, **kw_args): + """Initialises a new 'HydroGeneratingUnit' instance. + + @param energyConversionCapability: Energy conversion capability for generating. Values are: "generator", "pumpAndGenerator" + @param hydroUnitWaterCost: The equivalent cost of water that drives the hydro turbine. + @param PenstockLossCurve: A hydro generating unit has a penstock loss curve + @param HydroPowerPlant: The hydro generating unit belongs to a hydro power plant + @param TailbayLossCurve: A hydro generating unit has a tailbay loss curve + @param HydroGeneratingEfficiencyCurves: A hydro generating unit has an efficiency curve + """ + #: Energy conversion capability for generating. Values are: "generator", "pumpAndGenerator" + self.energyConversionCapability = energyConversionCapability + + #: The equivalent cost of water that drives the hydro turbine. + self.hydroUnitWaterCost = hydroUnitWaterCost + + self._PenstockLossCurve = None + self.PenstockLossCurve = PenstockLossCurve + + self._HydroPowerPlant = None + self.HydroPowerPlant = HydroPowerPlant + + self._TailbayLossCurve = [] + self.TailbayLossCurve = [] if TailbayLossCurve is None else TailbayLossCurve + + self._HydroGeneratingEfficiencyCurves = [] + self.HydroGeneratingEfficiencyCurves = [] if HydroGeneratingEfficiencyCurves is None else HydroGeneratingEfficiencyCurves + + super(HydroGeneratingUnit, self).__init__(*args, **kw_args) + + _attrs = ["energyConversionCapability", "hydroUnitWaterCost"] + _attr_types = {"energyConversionCapability": str, "hydroUnitWaterCost": float} + _defaults = {"energyConversionCapability": "generator", "hydroUnitWaterCost": 0.0} + _enums = {"energyConversionCapability": "HydroEnergyConversionKind"} + _refs = ["PenstockLossCurve", "HydroPowerPlant", "TailbayLossCurve", "HydroGeneratingEfficiencyCurves"] + _many_refs = ["TailbayLossCurve", "HydroGeneratingEfficiencyCurves"] + + def getPenstockLossCurve(self): + """A hydro generating unit has a penstock loss curve + """ + return self._PenstockLossCurve + + def setPenstockLossCurve(self, value): + if self._PenstockLossCurve is not None: + self._PenstockLossCurve._HydroGeneratingUnit = None + + self._PenstockLossCurve = value + if self._PenstockLossCurve is not None: + self._PenstockLossCurve.HydroGeneratingUnit = None + self._PenstockLossCurve._HydroGeneratingUnit = self + + PenstockLossCurve = property(getPenstockLossCurve, setPenstockLossCurve) + + def getHydroPowerPlant(self): + """The hydro generating unit belongs to a hydro power plant + """ + return self._HydroPowerPlant + + def setHydroPowerPlant(self, value): + if self._HydroPowerPlant is not None: + filtered = [x for x in self.HydroPowerPlant.HydroGeneratingUnits if x != self] + self._HydroPowerPlant._HydroGeneratingUnits = filtered + + self._HydroPowerPlant = value + if self._HydroPowerPlant is not None: + if self not in self._HydroPowerPlant._HydroGeneratingUnits: + self._HydroPowerPlant._HydroGeneratingUnits.append(self) + + HydroPowerPlant = property(getHydroPowerPlant, setHydroPowerPlant) + + def getTailbayLossCurve(self): + """A hydro generating unit has a tailbay loss curve + """ + return self._TailbayLossCurve + + def setTailbayLossCurve(self, value): + for x in self._TailbayLossCurve: + x.HydroGeneratingUnit = None + for y in value: + y._HydroGeneratingUnit = self + self._TailbayLossCurve = value + + TailbayLossCurve = property(getTailbayLossCurve, setTailbayLossCurve) + + def addTailbayLossCurve(self, *TailbayLossCurve): + for obj in TailbayLossCurve: + obj.HydroGeneratingUnit = self + + def removeTailbayLossCurve(self, *TailbayLossCurve): + for obj in TailbayLossCurve: + obj.HydroGeneratingUnit = None + + def getHydroGeneratingEfficiencyCurves(self): + """A hydro generating unit has an efficiency curve + """ + return self._HydroGeneratingEfficiencyCurves + + def setHydroGeneratingEfficiencyCurves(self, value): + for x in self._HydroGeneratingEfficiencyCurves: + x.HydroGeneratingUnit = None + for y in value: + y._HydroGeneratingUnit = self + self._HydroGeneratingEfficiencyCurves = value + + HydroGeneratingEfficiencyCurves = property(getHydroGeneratingEfficiencyCurves, setHydroGeneratingEfficiencyCurves) + + def addHydroGeneratingEfficiencyCurves(self, *HydroGeneratingEfficiencyCurves): + for obj in HydroGeneratingEfficiencyCurves: + obj.HydroGeneratingUnit = self + + def removeHydroGeneratingEfficiencyCurves(self, *HydroGeneratingEfficiencyCurves): + for obj in HydroGeneratingEfficiencyCurves: + obj.HydroGeneratingUnit = None + diff --git a/CIM16/IEC61970/Generation/Production/HydroPowerPlant.py b/CIM16/IEC61970/Generation/Production/HydroPowerPlant.py new file mode 100755 index 00000000..6b931b1a --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/HydroPowerPlant.py @@ -0,0 +1,169 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class HydroPowerPlant(PowerSystemResource): + """A hydro power station which can generate or pump. When generating, the generator turbines receive there water from an upper reservoir. When pumping, the pumps receive their water from a lower reservoir.A hydro power station which can generate or pump. When generating, the generator turbines receive there water from an upper reservoir. When pumping, the pumps receive their water from a lower reservoir. + """ + + def __init__(self, penstockType="", pumpRatedP=0.0, hydroPlantType="pumpedStorage", surgeTankCrestLevel=0.0, dischargeTravelDelay=0.0, plantDischargeCapacity=0.0, plantRatedHead=0.0, genRatedP=0.0, surgeTankCode="", HydroGeneratingUnits=None, GenSourcePumpDischargeReservoir=None, Reservoir=None, HydroPumps=None, *args, **kw_args): + """Initialises a new 'HydroPowerPlant' instance. + + @param penstockType: Type and configuration of hydro plant penstock(s) + @param pumpRatedP: The hydro plant's pumping rating active power for rated head conditions + @param hydroPlantType: The type of hydro power plant. Values are: "pumpedStorage", "runOfRiver", "minorStorage", "majorStorage" + @param surgeTankCrestLevel: The level at which the surge tank spills + @param dischargeTravelDelay: Water travel delay from tailbay to next downstream hydro power station + @param plantDischargeCapacity: Total plant discharge capacity + @param plantRatedHead: The plant's rated gross head + @param genRatedP: The hydro plant's generating rating active power for rated head conditions + @param surgeTankCode: A code describing the type (or absence) of surge tank that is associated with the hydro power plant + @param HydroGeneratingUnits: The hydro generating unit belongs to a hydro power plant + @param GenSourcePumpDischargeReservoir: Generators are supplied water from or pumps discharge water to an upstream reservoir + @param Reservoir: Generators discharge water to or pumps are supplied water from a downstream reservoir + @param HydroPumps: The hydro pump may be a member of a pumped storage plant or a pump for distributing water + """ + #: Type and configuration of hydro plant penstock(s) + self.penstockType = penstockType + + #: The hydro plant's pumping rating active power for rated head conditions + self.pumpRatedP = pumpRatedP + + #: The type of hydro power plant. Values are: "pumpedStorage", "runOfRiver", "minorStorage", "majorStorage" + self.hydroPlantType = hydroPlantType + + #: The level at which the surge tank spills + self.surgeTankCrestLevel = surgeTankCrestLevel + + #: Water travel delay from tailbay to next downstream hydro power station + self.dischargeTravelDelay = dischargeTravelDelay + + #: Total plant discharge capacity + self.plantDischargeCapacity = plantDischargeCapacity + + #: The plant's rated gross head + self.plantRatedHead = plantRatedHead + + #: The hydro plant's generating rating active power for rated head conditions + self.genRatedP = genRatedP + + #: A code describing the type (or absence) of surge tank that is associated with the hydro power plant + self.surgeTankCode = surgeTankCode + + self._HydroGeneratingUnits = [] + self.HydroGeneratingUnits = [] if HydroGeneratingUnits is None else HydroGeneratingUnits + + self._GenSourcePumpDischargeReservoir = None + self.GenSourcePumpDischargeReservoir = GenSourcePumpDischargeReservoir + + self._Reservoir = None + self.Reservoir = Reservoir + + self._HydroPumps = [] + self.HydroPumps = [] if HydroPumps is None else HydroPumps + + super(HydroPowerPlant, self).__init__(*args, **kw_args) + + _attrs = ["penstockType", "pumpRatedP", "hydroPlantType", "surgeTankCrestLevel", "dischargeTravelDelay", "plantDischargeCapacity", "plantRatedHead", "genRatedP", "surgeTankCode"] + _attr_types = {"penstockType": str, "pumpRatedP": float, "hydroPlantType": str, "surgeTankCrestLevel": float, "dischargeTravelDelay": float, "plantDischargeCapacity": float, "plantRatedHead": float, "genRatedP": float, "surgeTankCode": str} + _defaults = {"penstockType": "", "pumpRatedP": 0.0, "hydroPlantType": "pumpedStorage", "surgeTankCrestLevel": 0.0, "dischargeTravelDelay": 0.0, "plantDischargeCapacity": 0.0, "plantRatedHead": 0.0, "genRatedP": 0.0, "surgeTankCode": ""} + _enums = {"penstockType": "PenstockType", "hydroPlantType": "HydroPlantType", "surgeTankCode": "SurgeTankCode"} + _refs = ["HydroGeneratingUnits", "GenSourcePumpDischargeReservoir", "Reservoir", "HydroPumps"] + _many_refs = ["HydroGeneratingUnits", "HydroPumps"] + + def getHydroGeneratingUnits(self): + """The hydro generating unit belongs to a hydro power plant + """ + return self._HydroGeneratingUnits + + def setHydroGeneratingUnits(self, value): + for x in self._HydroGeneratingUnits: + x.HydroPowerPlant = None + for y in value: + y._HydroPowerPlant = self + self._HydroGeneratingUnits = value + + HydroGeneratingUnits = property(getHydroGeneratingUnits, setHydroGeneratingUnits) + + def addHydroGeneratingUnits(self, *HydroGeneratingUnits): + for obj in HydroGeneratingUnits: + obj.HydroPowerPlant = self + + def removeHydroGeneratingUnits(self, *HydroGeneratingUnits): + for obj in HydroGeneratingUnits: + obj.HydroPowerPlant = None + + def getGenSourcePumpDischargeReservoir(self): + """Generators are supplied water from or pumps discharge water to an upstream reservoir + """ + return self._GenSourcePumpDischargeReservoir + + def setGenSourcePumpDischargeReservoir(self, value): + if self._GenSourcePumpDischargeReservoir is not None: + filtered = [x for x in self.GenSourcePumpDischargeReservoir.UpstreamFromHydroPowerPlants if x != self] + self._GenSourcePumpDischargeReservoir._UpstreamFromHydroPowerPlants = filtered + + self._GenSourcePumpDischargeReservoir = value + if self._GenSourcePumpDischargeReservoir is not None: + if self not in self._GenSourcePumpDischargeReservoir._UpstreamFromHydroPowerPlants: + self._GenSourcePumpDischargeReservoir._UpstreamFromHydroPowerPlants.append(self) + + GenSourcePumpDischargeReservoir = property(getGenSourcePumpDischargeReservoir, setGenSourcePumpDischargeReservoir) + + def getReservoir(self): + """Generators discharge water to or pumps are supplied water from a downstream reservoir + """ + return self._Reservoir + + def setReservoir(self, value): + if self._Reservoir is not None: + filtered = [x for x in self.Reservoir.HydroPowerPlants if x != self] + self._Reservoir._HydroPowerPlants = filtered + + self._Reservoir = value + if self._Reservoir is not None: + if self not in self._Reservoir._HydroPowerPlants: + self._Reservoir._HydroPowerPlants.append(self) + + Reservoir = property(getReservoir, setReservoir) + + def getHydroPumps(self): + """The hydro pump may be a member of a pumped storage plant or a pump for distributing water + """ + return self._HydroPumps + + def setHydroPumps(self, value): + for x in self._HydroPumps: + x.HydroPowerPlant = None + for y in value: + y._HydroPowerPlant = self + self._HydroPumps = value + + HydroPumps = property(getHydroPumps, setHydroPumps) + + def addHydroPumps(self, *HydroPumps): + for obj in HydroPumps: + obj.HydroPowerPlant = self + + def removeHydroPumps(self, *HydroPumps): + for obj in HydroPumps: + obj.HydroPowerPlant = None + diff --git a/CIM16/IEC61970/Generation/Production/HydroPump.py b/CIM16/IEC61970/Generation/Production/HydroPump.py new file mode 100755 index 00000000..f52dc55b --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/HydroPump.py @@ -0,0 +1,116 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class HydroPump(PowerSystemResource): + """A synchronous motor-driven pump, typically associated with a pumped storage plantA synchronous motor-driven pump, typically associated with a pumped storage plant + """ + + def __init__(self, pumpDischAtMaxHead=0.0, pumpDischAtMinHead=0.0, pumpPowerAtMinHead=0.0, pumpPowerAtMaxHead=0.0, HydroPowerPlant=None, HydroPumpOpSchedule=None, SynchronousMachine=None, *args, **kw_args): + """Initialises a new 'HydroPump' instance. + + @param pumpDischAtMaxHead: The pumping discharge under maximum head conditions, usually at full gate + @param pumpDischAtMinHead: The pumping discharge under minimum head conditions, usually at full gate + @param pumpPowerAtMinHead: The pumping power under minimum head conditions, usually at full gate. + @param pumpPowerAtMaxHead: The pumping power under maximum head conditions, usually at full gate + @param HydroPowerPlant: The hydro pump may be a member of a pumped storage plant or a pump for distributing water + @param HydroPumpOpSchedule: The hydro pump has a pumping schedule over time, indicating when pumping is to occur. + @param SynchronousMachine: The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating. + """ + #: The pumping discharge under maximum head conditions, usually at full gate + self.pumpDischAtMaxHead = pumpDischAtMaxHead + + #: The pumping discharge under minimum head conditions, usually at full gate + self.pumpDischAtMinHead = pumpDischAtMinHead + + #: The pumping power under minimum head conditions, usually at full gate. + self.pumpPowerAtMinHead = pumpPowerAtMinHead + + #: The pumping power under maximum head conditions, usually at full gate + self.pumpPowerAtMaxHead = pumpPowerAtMaxHead + + self._HydroPowerPlant = None + self.HydroPowerPlant = HydroPowerPlant + + self._HydroPumpOpSchedule = None + self.HydroPumpOpSchedule = HydroPumpOpSchedule + + self._SynchronousMachine = None + self.SynchronousMachine = SynchronousMachine + + super(HydroPump, self).__init__(*args, **kw_args) + + _attrs = ["pumpDischAtMaxHead", "pumpDischAtMinHead", "pumpPowerAtMinHead", "pumpPowerAtMaxHead"] + _attr_types = {"pumpDischAtMaxHead": float, "pumpDischAtMinHead": float, "pumpPowerAtMinHead": float, "pumpPowerAtMaxHead": float} + _defaults = {"pumpDischAtMaxHead": 0.0, "pumpDischAtMinHead": 0.0, "pumpPowerAtMinHead": 0.0, "pumpPowerAtMaxHead": 0.0} + _enums = {} + _refs = ["HydroPowerPlant", "HydroPumpOpSchedule", "SynchronousMachine"] + _many_refs = [] + + def getHydroPowerPlant(self): + """The hydro pump may be a member of a pumped storage plant or a pump for distributing water + """ + return self._HydroPowerPlant + + def setHydroPowerPlant(self, value): + if self._HydroPowerPlant is not None: + filtered = [x for x in self.HydroPowerPlant.HydroPumps if x != self] + self._HydroPowerPlant._HydroPumps = filtered + + self._HydroPowerPlant = value + if self._HydroPowerPlant is not None: + if self not in self._HydroPowerPlant._HydroPumps: + self._HydroPowerPlant._HydroPumps.append(self) + + HydroPowerPlant = property(getHydroPowerPlant, setHydroPowerPlant) + + def getHydroPumpOpSchedule(self): + """The hydro pump has a pumping schedule over time, indicating when pumping is to occur. + """ + return self._HydroPumpOpSchedule + + def setHydroPumpOpSchedule(self, value): + if self._HydroPumpOpSchedule is not None: + self._HydroPumpOpSchedule._HydroPump = None + + self._HydroPumpOpSchedule = value + if self._HydroPumpOpSchedule is not None: + self._HydroPumpOpSchedule.HydroPump = None + self._HydroPumpOpSchedule._HydroPump = self + + HydroPumpOpSchedule = property(getHydroPumpOpSchedule, setHydroPumpOpSchedule) + + def getSynchronousMachine(self): + """The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating. + """ + return self._SynchronousMachine + + def setSynchronousMachine(self, value): + if self._SynchronousMachine is not None: + self._SynchronousMachine._HydroPump = None + + self._SynchronousMachine = value + if self._SynchronousMachine is not None: + self._SynchronousMachine.HydroPump = None + self._SynchronousMachine._HydroPump = self + + SynchronousMachine = property(getSynchronousMachine, setSynchronousMachine) + diff --git a/CIM16/IEC61970/Generation/Production/HydroPumpOpSchedule.py b/CIM16/IEC61970/Generation/Production/HydroPumpOpSchedule.py new file mode 100755 index 00000000..314faa2a --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/HydroPumpOpSchedule.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.RegularIntervalSchedule import RegularIntervalSchedule + +class HydroPumpOpSchedule(RegularIntervalSchedule): + """The hydro pump's Operator-approved current operating schedule (or plan), typically produced with the aid of unit commitment type analyses.The unit's operating schedule status is typically given as: (0=unavailable) (1=avilable to startup or shutdown) (2=must pump)The hydro pump's Operator-approved current operating schedule (or plan), typically produced with the aid of unit commitment type analyses.The unit's operating schedule status is typically given as: (0=unavailable) (1=avilable to startup or shutdown) (2=must pump) + """ + + def __init__(self, HydroPump=None, *args, **kw_args): + """Initialises a new 'HydroPumpOpSchedule' instance. + + @param HydroPump: The hydro pump has a pumping schedule over time, indicating when pumping is to occur. + """ + self._HydroPump = None + self.HydroPump = HydroPump + + super(HydroPumpOpSchedule, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["HydroPump"] + _many_refs = [] + + def getHydroPump(self): + """The hydro pump has a pumping schedule over time, indicating when pumping is to occur. + """ + return self._HydroPump + + def setHydroPump(self, value): + if self._HydroPump is not None: + self._HydroPump._HydroPumpOpSchedule = None + + self._HydroPump = value + if self._HydroPump is not None: + self._HydroPump.HydroPumpOpSchedule = None + self._HydroPump._HydroPumpOpSchedule = self + + HydroPump = property(getHydroPump, setHydroPump) + diff --git a/CIM16/IEC61970/Generation/Production/IncrementalHeatRateCurve.py b/CIM16/IEC61970/Generation/Production/IncrementalHeatRateCurve.py new file mode 100755 index 00000000..3105e824 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/IncrementalHeatRateCurve.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class IncrementalHeatRateCurve(Curve): + """Relationship between unit incremental heat rate in (delta energy/time) per (delta active power) and unit output in active power. The IHR curve represents the slope of the HeatInputCurve. Note that the 'incremental heat rate' and the 'heat rate' have the same engineering units.Relationship between unit incremental heat rate in (delta energy/time) per (delta active power) and unit output in active power. The IHR curve represents the slope of the HeatInputCurve. Note that the 'incremental heat rate' and the 'heat rate' have the same engineering units. + """ + + def __init__(self, isNetGrossP=False, ThermalGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'IncrementalHeatRateCurve' instance. + + @param isNetGrossP: Flag is set to true when output is expressed in net active power + @param ThermalGeneratingUnit: A thermal generating unit may have an incremental heat rate curve + """ + #: Flag is set to true when output is expressed in net active power + self.isNetGrossP = isNetGrossP + + self._ThermalGeneratingUnit = None + self.ThermalGeneratingUnit = ThermalGeneratingUnit + + super(IncrementalHeatRateCurve, self).__init__(*args, **kw_args) + + _attrs = ["isNetGrossP"] + _attr_types = {"isNetGrossP": bool} + _defaults = {"isNetGrossP": False} + _enums = {} + _refs = ["ThermalGeneratingUnit"] + _many_refs = [] + + def getThermalGeneratingUnit(self): + """A thermal generating unit may have an incremental heat rate curve + """ + return self._ThermalGeneratingUnit + + def setThermalGeneratingUnit(self, value): + if self._ThermalGeneratingUnit is not None: + self._ThermalGeneratingUnit._IncrementalHeatRateCurve = None + + self._ThermalGeneratingUnit = value + if self._ThermalGeneratingUnit is not None: + self._ThermalGeneratingUnit.IncrementalHeatRateCurve = None + self._ThermalGeneratingUnit._IncrementalHeatRateCurve = self + + ThermalGeneratingUnit = property(getThermalGeneratingUnit, setThermalGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/InflowForecast.py b/CIM16/IEC61970/Generation/Production/InflowForecast.py new file mode 100755 index 00000000..17ba068c --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/InflowForecast.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.RegularIntervalSchedule import RegularIntervalSchedule + +class InflowForecast(RegularIntervalSchedule): + """Natural water inflow to a reservoir, usually forecasted from predicted rain and snowmelt. Typically in one hour increments for up to 10 days. The forecast is given in average cubic meters per second over the time increment.Natural water inflow to a reservoir, usually forecasted from predicted rain and snowmelt. Typically in one hour increments for up to 10 days. The forecast is given in average cubic meters per second over the time increment. + """ + + def __init__(self, Reservoir=None, *args, **kw_args): + """Initialises a new 'InflowForecast' instance. + + @param Reservoir: A reservoir may have a 'natural' inflow forecast. + """ + self._Reservoir = None + self.Reservoir = Reservoir + + super(InflowForecast, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Reservoir"] + _many_refs = [] + + def getReservoir(self): + """A reservoir may have a 'natural' inflow forecast. + """ + return self._Reservoir + + def setReservoir(self, value): + if self._Reservoir is not None: + filtered = [x for x in self.Reservoir.InflowForecasts if x != self] + self._Reservoir._InflowForecasts = filtered + + self._Reservoir = value + if self._Reservoir is not None: + if self not in self._Reservoir._InflowForecasts: + self._Reservoir._InflowForecasts.append(self) + + Reservoir = property(getReservoir, setReservoir) + diff --git a/CIM16/IEC61970/Generation/Production/LevelVsVolumeCurve.py b/CIM16/IEC61970/Generation/Production/LevelVsVolumeCurve.py new file mode 100755 index 00000000..c6659b3a --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/LevelVsVolumeCurve.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class LevelVsVolumeCurve(Curve): + """Relationship between reservoir volume and reservoir level. The volume is at the y-axis and the reservoir level at the x-axis.Relationship between reservoir volume and reservoir level. The volume is at the y-axis and the reservoir level at the x-axis. + """ + + def __init__(self, Reservoir=None, *args, **kw_args): + """Initialises a new 'LevelVsVolumeCurve' instance. + + @param Reservoir: A reservoir may have a level versus volume relationship. + """ + self._Reservoir = None + self.Reservoir = Reservoir + + super(LevelVsVolumeCurve, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Reservoir"] + _many_refs = [] + + def getReservoir(self): + """A reservoir may have a level versus volume relationship. + """ + return self._Reservoir + + def setReservoir(self, value): + if self._Reservoir is not None: + filtered = [x for x in self.Reservoir.LevelVsVolumeCurves if x != self] + self._Reservoir._LevelVsVolumeCurves = filtered + + self._Reservoir = value + if self._Reservoir is not None: + if self not in self._Reservoir._LevelVsVolumeCurves: + self._Reservoir._LevelVsVolumeCurves.append(self) + + Reservoir = property(getReservoir, setReservoir) + diff --git a/CIM16/IEC61970/Generation/Production/NuclearGeneratingUnit.py b/CIM16/IEC61970/Generation/Production/NuclearGeneratingUnit.py new file mode 100755 index 00000000..02d04fbf --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/NuclearGeneratingUnit.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Generation.Production.GeneratingUnit import GeneratingUnit + +class NuclearGeneratingUnit(GeneratingUnit): + """A nuclear generating unit.A nuclear generating unit. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'NuclearGeneratingUnit' instance. + + """ + super(NuclearGeneratingUnit, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Generation/Production/PenstockLossCurve.py b/CIM16/IEC61970/Generation/Production/PenstockLossCurve.py new file mode 100755 index 00000000..a0c332d7 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/PenstockLossCurve.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class PenstockLossCurve(Curve): + """Relationship between penstock head loss (in meters) and total discharge through the penstock (in cubic meters per second). One or more turbines may be connected to the same penstock.Relationship between penstock head loss (in meters) and total discharge through the penstock (in cubic meters per second). One or more turbines may be connected to the same penstock. + """ + + def __init__(self, HydroGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'PenstockLossCurve' instance. + + @param HydroGeneratingUnit: A hydro generating unit has a penstock loss curve + """ + self._HydroGeneratingUnit = None + self.HydroGeneratingUnit = HydroGeneratingUnit + + super(PenstockLossCurve, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["HydroGeneratingUnit"] + _many_refs = [] + + def getHydroGeneratingUnit(self): + """A hydro generating unit has a penstock loss curve + """ + return self._HydroGeneratingUnit + + def setHydroGeneratingUnit(self, value): + if self._HydroGeneratingUnit is not None: + self._HydroGeneratingUnit._PenstockLossCurve = None + + self._HydroGeneratingUnit = value + if self._HydroGeneratingUnit is not None: + self._HydroGeneratingUnit.PenstockLossCurve = None + self._HydroGeneratingUnit._PenstockLossCurve = self + + HydroGeneratingUnit = property(getHydroGeneratingUnit, setHydroGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/Reservoir.py b/CIM16/IEC61970/Generation/Production/Reservoir.py new file mode 100755 index 00000000..227c37e1 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/Reservoir.py @@ -0,0 +1,254 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class Reservoir(PowerSystemResource): + """A water storage facility within a hydro system, including: ponds, lakes, lagoons, and rivers. The storage is usually behind some type of dam.A water storage facility within a hydro system, including: ponds, lakes, lagoons, and rivers. The storage is usually behind some type of dam. + """ + + def __init__(self, spillwayCapacity=0.0, energyStorageRating=0.0, grossCapacity=0.0, riverOutletWorks='', spillwayCrestLevel=0.0, normalMinOperateLevel=0.0, spillwayCrestLength=0.0, spillTravelDelay=0.0, activeStorageCapacity=0.0, spillWayGateType="", fullSupplyLevel=0.0, LevelVsVolumeCurves=None, TargetLevelSchedule=None, HydroPowerPlants=None, UpstreamFromHydroPowerPlants=None, InflowForecasts=None, SpillsFromReservoir=None, SpillsIntoReservoirs=None, *args, **kw_args): + """Initialises a new 'Reservoir' instance. + + @param spillwayCapacity: The flow capacity of the spillway in cubic meters per second + @param energyStorageRating: The reservoir's energy storage rating in energy for given head conditions + @param grossCapacity: Total capacity of reservoir + @param riverOutletWorks: River outlet works for riparian right releases or other purposes + @param spillwayCrestLevel: Spillway crest level above which water will spill + @param normalMinOperateLevel: Normal minimum operating level below which the penstocks will draw air + @param spillwayCrestLength: The length of the spillway crest + @param spillTravelDelay: The spillway water travel delay to the next downstream reservoir + @param activeStorageCapacity: Storage volume between the full supply level and the normal minimum operating level + @param spillWayGateType: Type of spillway gate, including parameters + @param fullSupplyLevel: Full supply level, above which water will spill. This can be the spillway crest level or the top of closed gates. + @param LevelVsVolumeCurves: A reservoir may have a level versus volume relationship. + @param TargetLevelSchedule: A reservoir may have a water level target schedule. + @param HydroPowerPlants: Generators discharge water to or pumps are supplied water from a downstream reservoir + @param UpstreamFromHydroPowerPlants: Generators are supplied water from or pumps discharge water to an upstream reservoir + @param InflowForecasts: A reservoir may have a 'natural' inflow forecast. + @param SpillsFromReservoir: A reservoir may spill into a downstream reservoir + @param SpillsIntoReservoirs: A reservoir may spill into a downstream reservoir + """ + #: The flow capacity of the spillway in cubic meters per second + self.spillwayCapacity = spillwayCapacity + + #: The reservoir's energy storage rating in energy for given head conditions + self.energyStorageRating = energyStorageRating + + #: Total capacity of reservoir + self.grossCapacity = grossCapacity + + #: River outlet works for riparian right releases or other purposes + self.riverOutletWorks = riverOutletWorks + + #: Spillway crest level above which water will spill + self.spillwayCrestLevel = spillwayCrestLevel + + #: Normal minimum operating level below which the penstocks will draw air + self.normalMinOperateLevel = normalMinOperateLevel + + #: The length of the spillway crest + self.spillwayCrestLength = spillwayCrestLength + + #: The spillway water travel delay to the next downstream reservoir + self.spillTravelDelay = spillTravelDelay + + #: Storage volume between the full supply level and the normal minimum operating level + self.activeStorageCapacity = activeStorageCapacity + + #: Type of spillway gate, including parameters + self.spillWayGateType = spillWayGateType + + #: Full supply level, above which water will spill. This can be the spillway crest level or the top of closed gates. + self.fullSupplyLevel = fullSupplyLevel + + self._LevelVsVolumeCurves = [] + self.LevelVsVolumeCurves = [] if LevelVsVolumeCurves is None else LevelVsVolumeCurves + + self._TargetLevelSchedule = None + self.TargetLevelSchedule = TargetLevelSchedule + + self._HydroPowerPlants = [] + self.HydroPowerPlants = [] if HydroPowerPlants is None else HydroPowerPlants + + self._UpstreamFromHydroPowerPlants = [] + self.UpstreamFromHydroPowerPlants = [] if UpstreamFromHydroPowerPlants is None else UpstreamFromHydroPowerPlants + + self._InflowForecasts = [] + self.InflowForecasts = [] if InflowForecasts is None else InflowForecasts + + self._SpillsFromReservoir = None + self.SpillsFromReservoir = SpillsFromReservoir + + self._SpillsIntoReservoirs = [] + self.SpillsIntoReservoirs = [] if SpillsIntoReservoirs is None else SpillsIntoReservoirs + + super(Reservoir, self).__init__(*args, **kw_args) + + _attrs = ["spillwayCapacity", "energyStorageRating", "grossCapacity", "riverOutletWorks", "spillwayCrestLevel", "normalMinOperateLevel", "spillwayCrestLength", "spillTravelDelay", "activeStorageCapacity", "spillWayGateType", "fullSupplyLevel"] + _attr_types = {"spillwayCapacity": float, "energyStorageRating": float, "grossCapacity": float, "riverOutletWorks": str, "spillwayCrestLevel": float, "normalMinOperateLevel": float, "spillwayCrestLength": float, "spillTravelDelay": float, "activeStorageCapacity": float, "spillWayGateType": str, "fullSupplyLevel": float} + _defaults = {"spillwayCapacity": 0.0, "energyStorageRating": 0.0, "grossCapacity": 0.0, "riverOutletWorks": '', "spillwayCrestLevel": 0.0, "normalMinOperateLevel": 0.0, "spillwayCrestLength": 0.0, "spillTravelDelay": 0.0, "activeStorageCapacity": 0.0, "spillWayGateType": "", "fullSupplyLevel": 0.0} + _enums = {"spillWayGateType": "SpillwayGateType"} + _refs = ["LevelVsVolumeCurves", "TargetLevelSchedule", "HydroPowerPlants", "UpstreamFromHydroPowerPlants", "InflowForecasts", "SpillsFromReservoir", "SpillsIntoReservoirs"] + _many_refs = ["LevelVsVolumeCurves", "HydroPowerPlants", "UpstreamFromHydroPowerPlants", "InflowForecasts", "SpillsIntoReservoirs"] + + def getLevelVsVolumeCurves(self): + """A reservoir may have a level versus volume relationship. + """ + return self._LevelVsVolumeCurves + + def setLevelVsVolumeCurves(self, value): + for x in self._LevelVsVolumeCurves: + x.Reservoir = None + for y in value: + y._Reservoir = self + self._LevelVsVolumeCurves = value + + LevelVsVolumeCurves = property(getLevelVsVolumeCurves, setLevelVsVolumeCurves) + + def addLevelVsVolumeCurves(self, *LevelVsVolumeCurves): + for obj in LevelVsVolumeCurves: + obj.Reservoir = self + + def removeLevelVsVolumeCurves(self, *LevelVsVolumeCurves): + for obj in LevelVsVolumeCurves: + obj.Reservoir = None + + def getTargetLevelSchedule(self): + """A reservoir may have a water level target schedule. + """ + return self._TargetLevelSchedule + + def setTargetLevelSchedule(self, value): + if self._TargetLevelSchedule is not None: + self._TargetLevelSchedule._Reservoir = None + + self._TargetLevelSchedule = value + if self._TargetLevelSchedule is not None: + self._TargetLevelSchedule.Reservoir = None + self._TargetLevelSchedule._Reservoir = self + + TargetLevelSchedule = property(getTargetLevelSchedule, setTargetLevelSchedule) + + def getHydroPowerPlants(self): + """Generators discharge water to or pumps are supplied water from a downstream reservoir + """ + return self._HydroPowerPlants + + def setHydroPowerPlants(self, value): + for x in self._HydroPowerPlants: + x.Reservoir = None + for y in value: + y._Reservoir = self + self._HydroPowerPlants = value + + HydroPowerPlants = property(getHydroPowerPlants, setHydroPowerPlants) + + def addHydroPowerPlants(self, *HydroPowerPlants): + for obj in HydroPowerPlants: + obj.Reservoir = self + + def removeHydroPowerPlants(self, *HydroPowerPlants): + for obj in HydroPowerPlants: + obj.Reservoir = None + + def getUpstreamFromHydroPowerPlants(self): + """Generators are supplied water from or pumps discharge water to an upstream reservoir + """ + return self._UpstreamFromHydroPowerPlants + + def setUpstreamFromHydroPowerPlants(self, value): + for x in self._UpstreamFromHydroPowerPlants: + x.GenSourcePumpDischargeReservoir = None + for y in value: + y._GenSourcePumpDischargeReservoir = self + self._UpstreamFromHydroPowerPlants = value + + UpstreamFromHydroPowerPlants = property(getUpstreamFromHydroPowerPlants, setUpstreamFromHydroPowerPlants) + + def addUpstreamFromHydroPowerPlants(self, *UpstreamFromHydroPowerPlants): + for obj in UpstreamFromHydroPowerPlants: + obj.GenSourcePumpDischargeReservoir = self + + def removeUpstreamFromHydroPowerPlants(self, *UpstreamFromHydroPowerPlants): + for obj in UpstreamFromHydroPowerPlants: + obj.GenSourcePumpDischargeReservoir = None + + def getInflowForecasts(self): + """A reservoir may have a 'natural' inflow forecast. + """ + return self._InflowForecasts + + def setInflowForecasts(self, value): + for x in self._InflowForecasts: + x.Reservoir = None + for y in value: + y._Reservoir = self + self._InflowForecasts = value + + InflowForecasts = property(getInflowForecasts, setInflowForecasts) + + def addInflowForecasts(self, *InflowForecasts): + for obj in InflowForecasts: + obj.Reservoir = self + + def removeInflowForecasts(self, *InflowForecasts): + for obj in InflowForecasts: + obj.Reservoir = None + + def getSpillsFromReservoir(self): + """A reservoir may spill into a downstream reservoir + """ + return self._SpillsFromReservoir + + def setSpillsFromReservoir(self, value): + if self._SpillsFromReservoir is not None: + filtered = [x for x in self.SpillsFromReservoir.SpillsIntoReservoirs if x != self] + self._SpillsFromReservoir._SpillsIntoReservoirs = filtered + + self._SpillsFromReservoir = value + if self._SpillsFromReservoir is not None: + if self not in self._SpillsFromReservoir._SpillsIntoReservoirs: + self._SpillsFromReservoir._SpillsIntoReservoirs.append(self) + + SpillsFromReservoir = property(getSpillsFromReservoir, setSpillsFromReservoir) + + def getSpillsIntoReservoirs(self): + """A reservoir may spill into a downstream reservoir + """ + return self._SpillsIntoReservoirs + + def setSpillsIntoReservoirs(self, value): + for x in self._SpillsIntoReservoirs: + x.SpillsFromReservoir = None + for y in value: + y._SpillsFromReservoir = self + self._SpillsIntoReservoirs = value + + SpillsIntoReservoirs = property(getSpillsIntoReservoirs, setSpillsIntoReservoirs) + + def addSpillsIntoReservoirs(self, *SpillsIntoReservoirs): + for obj in SpillsIntoReservoirs: + obj.SpillsFromReservoir = self + + def removeSpillsIntoReservoirs(self, *SpillsIntoReservoirs): + for obj in SpillsIntoReservoirs: + obj.SpillsFromReservoir = None + diff --git a/CIM16/IEC61970/Generation/Production/ShutdownCurve.py b/CIM16/IEC61970/Generation/Production/ShutdownCurve.py new file mode 100755 index 00000000..c5a46814 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/ShutdownCurve.py @@ -0,0 +1,67 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class ShutdownCurve(Curve): + """Relationship between the rate in gross active power/minute (Y-axis) at which a unit should be shutdown and its present gross MW output (X-axis)Relationship between the rate in gross active power/minute (Y-axis) at which a unit should be shutdown and its present gross MW output (X-axis) + """ + + def __init__(self, shutdownDate='', shutdownCost=0.0, ThermalGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'ShutdownCurve' instance. + + @param shutdownDate: The date and time of the most recent generating unit shutdown + @param shutdownCost: Fixed shutdown cost + @param ThermalGeneratingUnit: A thermal generating unit may have a shutdown curve + """ + #: The date and time of the most recent generating unit shutdown + self.shutdownDate = shutdownDate + + #: Fixed shutdown cost + self.shutdownCost = shutdownCost + + self._ThermalGeneratingUnit = None + self.ThermalGeneratingUnit = ThermalGeneratingUnit + + super(ShutdownCurve, self).__init__(*args, **kw_args) + + _attrs = ["shutdownDate", "shutdownCost"] + _attr_types = {"shutdownDate": str, "shutdownCost": float} + _defaults = {"shutdownDate": '', "shutdownCost": 0.0} + _enums = {} + _refs = ["ThermalGeneratingUnit"] + _many_refs = [] + + def getThermalGeneratingUnit(self): + """A thermal generating unit may have a shutdown curve + """ + return self._ThermalGeneratingUnit + + def setThermalGeneratingUnit(self, value): + if self._ThermalGeneratingUnit is not None: + self._ThermalGeneratingUnit._ShutdownCurve = None + + self._ThermalGeneratingUnit = value + if self._ThermalGeneratingUnit is not None: + self._ThermalGeneratingUnit.ShutdownCurve = None + self._ThermalGeneratingUnit._ShutdownCurve = self + + ThermalGeneratingUnit = property(getThermalGeneratingUnit, setThermalGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/StartIgnFuelCurve.py b/CIM16/IEC61970/Generation/Production/StartIgnFuelCurve.py new file mode 100755 index 00000000..e9fd5e94 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/StartIgnFuelCurve.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class StartIgnFuelCurve(Curve): + """The quantity of ignition fuel (Y-axis) used to restart and repay the auxiliary power consumed versus the number of hours (X-axis) the unit was off lineThe quantity of ignition fuel (Y-axis) used to restart and repay the auxiliary power consumed versus the number of hours (X-axis) the unit was off line + """ + + def __init__(self, ignitionFuelType="oil", StartupModel=None, *args, **kw_args): + """Initialises a new 'StartIgnFuelCurve' instance. + + @param ignitionFuelType: Type of ignition fuel Values are: "oil", "coal", "lignite", "gas" + @param StartupModel: The unit's startup model may have a startup ignition fuel curve + """ + #: Type of ignition fuel Values are: "oil", "coal", "lignite", "gas" + self.ignitionFuelType = ignitionFuelType + + self._StartupModel = None + self.StartupModel = StartupModel + + super(StartIgnFuelCurve, self).__init__(*args, **kw_args) + + _attrs = ["ignitionFuelType"] + _attr_types = {"ignitionFuelType": str} + _defaults = {"ignitionFuelType": "oil"} + _enums = {"ignitionFuelType": "FuelType"} + _refs = ["StartupModel"] + _many_refs = [] + + def getStartupModel(self): + """The unit's startup model may have a startup ignition fuel curve + """ + return self._StartupModel + + def setStartupModel(self, value): + if self._StartupModel is not None: + self._StartupModel._StartIgnFuelCurve = None + + self._StartupModel = value + if self._StartupModel is not None: + self._StartupModel.StartIgnFuelCurve = None + self._StartupModel._StartIgnFuelCurve = self + + StartupModel = property(getStartupModel, setStartupModel) + diff --git a/CIM16/IEC61970/Generation/Production/StartMainFuelCurve.py b/CIM16/IEC61970/Generation/Production/StartMainFuelCurve.py new file mode 100755 index 00000000..694ab54f --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/StartMainFuelCurve.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class StartMainFuelCurve(Curve): + """The quantity of main fuel (Y-axis) used to restart and repay the auxiliary power consumed versus the number of hours (X-axis) the unit was off lineThe quantity of main fuel (Y-axis) used to restart and repay the auxiliary power consumed versus the number of hours (X-axis) the unit was off line + """ + + def __init__(self, mainFuelType="oil", StartupModel=None, *args, **kw_args): + """Initialises a new 'StartMainFuelCurve' instance. + + @param mainFuelType: Type of main fuel Values are: "oil", "coal", "lignite", "gas" + @param StartupModel: The unit's startup model may have a startup main fuel curve + """ + #: Type of main fuel Values are: "oil", "coal", "lignite", "gas" + self.mainFuelType = mainFuelType + + self._StartupModel = None + self.StartupModel = StartupModel + + super(StartMainFuelCurve, self).__init__(*args, **kw_args) + + _attrs = ["mainFuelType"] + _attr_types = {"mainFuelType": str} + _defaults = {"mainFuelType": "oil"} + _enums = {"mainFuelType": "FuelType"} + _refs = ["StartupModel"] + _many_refs = [] + + def getStartupModel(self): + """The unit's startup model may have a startup main fuel curve + """ + return self._StartupModel + + def setStartupModel(self, value): + if self._StartupModel is not None: + self._StartupModel._StartMainFuelCurve = None + + self._StartupModel = value + if self._StartupModel is not None: + self._StartupModel.StartMainFuelCurve = None + self._StartupModel._StartMainFuelCurve = self + + StartupModel = property(getStartupModel, setStartupModel) + diff --git a/CIM16/IEC61970/Generation/Production/StartRampCurve.py b/CIM16/IEC61970/Generation/Production/StartRampCurve.py new file mode 100755 index 00000000..7e84b926 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/StartRampCurve.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class StartRampCurve(Curve): + """Rate in gross active power/minute (Y-axis) at which a unit can be loaded versus the number of hours (X-axis) the unit was off lineRate in gross active power/minute (Y-axis) at which a unit can be loaded versus the number of hours (X-axis) the unit was off line + """ + + def __init__(self, hotStandbyRamp=0.0, StartupModel=None, *args, **kw_args): + """Initialises a new 'StartRampCurve' instance. + + @param hotStandbyRamp: The startup ramp rate in gross for a unit that is on hot standby + @param StartupModel: The unit's startup model may have a startup ramp curve + """ + #: The startup ramp rate in gross for a unit that is on hot standby + self.hotStandbyRamp = hotStandbyRamp + + self._StartupModel = None + self.StartupModel = StartupModel + + super(StartRampCurve, self).__init__(*args, **kw_args) + + _attrs = ["hotStandbyRamp"] + _attr_types = {"hotStandbyRamp": float} + _defaults = {"hotStandbyRamp": 0.0} + _enums = {} + _refs = ["StartupModel"] + _many_refs = [] + + def getStartupModel(self): + """The unit's startup model may have a startup ramp curve + """ + return self._StartupModel + + def setStartupModel(self, value): + if self._StartupModel is not None: + self._StartupModel._StartRampCurve = None + + self._StartupModel = value + if self._StartupModel is not None: + self._StartupModel.StartRampCurve = None + self._StartupModel._StartRampCurve = self + + StartupModel = property(getStartupModel, setStartupModel) + diff --git a/CIM16/IEC61970/Generation/Production/StartupModel.py b/CIM16/IEC61970/Generation/Production/StartupModel.py new file mode 100755 index 00000000..220a13c9 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/StartupModel.py @@ -0,0 +1,159 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class StartupModel(IdentifiedObject): + """Unit start up characteristics depending on how long the unit has been off lineUnit start up characteristics depending on how long the unit has been off line + """ + + def __init__(self, startupCost=0.0, stbyAuxP=0.0, minimumRunTime=0.0, riskFactorCost=0.0, minimumDownTime=0.0, fixedMaintCost=0.0, startupDate='', hotStandbyHeat=0.0, startupPriority=0, incrementalMaintCost=0.0, StartRampCurve=None, StartMainFuelCurve=None, StartIgnFuelCurve=None, ThermalGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'StartupModel' instance. + + @param startupCost: Total miscellaneous start up costs + @param stbyAuxP: The unit's auxiliary active power consumption to maintain standby mode + @param minimumRunTime: The minimum number of hours the unit must be operating before being allowed to shut down + @param riskFactorCost: The opportunity cost associated with the return in monetary unit. This represents the restart's 'share' of the unit depreciation and risk of an event which would damage the unit. + @param minimumDownTime: The minimum number of hours the unit must be down before restart + @param fixedMaintCost: Fixed Maintenance Cost + @param startupDate: The date and time of the most recent generating unit startup + @param hotStandbyHeat: The amount of heat input per time uint required for hot standby operation + @param startupPriority: Startup priority within control area where lower numbers indicate higher priorities. More than one unit in an area may be assigned the same priority. + @param incrementalMaintCost: Incremental Maintenance Cost + @param StartRampCurve: The unit's startup model may have a startup ramp curve + @param StartMainFuelCurve: The unit's startup model may have a startup main fuel curve + @param StartIgnFuelCurve: The unit's startup model may have a startup ignition fuel curve + @param ThermalGeneratingUnit: A thermal generating unit may have a startup model + """ + #: Total miscellaneous start up costs + self.startupCost = startupCost + + #: The unit's auxiliary active power consumption to maintain standby mode + self.stbyAuxP = stbyAuxP + + #: The minimum number of hours the unit must be operating before being allowed to shut down + self.minimumRunTime = minimumRunTime + + #: The opportunity cost associated with the return in monetary unit. This represents the restart's 'share' of the unit depreciation and risk of an event which would damage the unit. + self.riskFactorCost = riskFactorCost + + #: The minimum number of hours the unit must be down before restart + self.minimumDownTime = minimumDownTime + + #: Fixed Maintenance Cost + self.fixedMaintCost = fixedMaintCost + + #: The date and time of the most recent generating unit startup + self.startupDate = startupDate + + #: The amount of heat input per time uint required for hot standby operation + self.hotStandbyHeat = hotStandbyHeat + + #: Startup priority within control area where lower numbers indicate higher priorities. More than one unit in an area may be assigned the same priority. + self.startupPriority = startupPriority + + #: Incremental Maintenance Cost + self.incrementalMaintCost = incrementalMaintCost + + self._StartRampCurve = None + self.StartRampCurve = StartRampCurve + + self._StartMainFuelCurve = None + self.StartMainFuelCurve = StartMainFuelCurve + + self._StartIgnFuelCurve = None + self.StartIgnFuelCurve = StartIgnFuelCurve + + self._ThermalGeneratingUnit = None + self.ThermalGeneratingUnit = ThermalGeneratingUnit + + super(StartupModel, self).__init__(*args, **kw_args) + + _attrs = ["startupCost", "stbyAuxP", "minimumRunTime", "riskFactorCost", "minimumDownTime", "fixedMaintCost", "startupDate", "hotStandbyHeat", "startupPriority", "incrementalMaintCost"] + _attr_types = {"startupCost": float, "stbyAuxP": float, "minimumRunTime": float, "riskFactorCost": float, "minimumDownTime": float, "fixedMaintCost": float, "startupDate": str, "hotStandbyHeat": float, "startupPriority": int, "incrementalMaintCost": float} + _defaults = {"startupCost": 0.0, "stbyAuxP": 0.0, "minimumRunTime": 0.0, "riskFactorCost": 0.0, "minimumDownTime": 0.0, "fixedMaintCost": 0.0, "startupDate": '', "hotStandbyHeat": 0.0, "startupPriority": 0, "incrementalMaintCost": 0.0} + _enums = {} + _refs = ["StartRampCurve", "StartMainFuelCurve", "StartIgnFuelCurve", "ThermalGeneratingUnit"] + _many_refs = [] + + def getStartRampCurve(self): + """The unit's startup model may have a startup ramp curve + """ + return self._StartRampCurve + + def setStartRampCurve(self, value): + if self._StartRampCurve is not None: + self._StartRampCurve._StartupModel = None + + self._StartRampCurve = value + if self._StartRampCurve is not None: + self._StartRampCurve.StartupModel = None + self._StartRampCurve._StartupModel = self + + StartRampCurve = property(getStartRampCurve, setStartRampCurve) + + def getStartMainFuelCurve(self): + """The unit's startup model may have a startup main fuel curve + """ + return self._StartMainFuelCurve + + def setStartMainFuelCurve(self, value): + if self._StartMainFuelCurve is not None: + self._StartMainFuelCurve._StartupModel = None + + self._StartMainFuelCurve = value + if self._StartMainFuelCurve is not None: + self._StartMainFuelCurve.StartupModel = None + self._StartMainFuelCurve._StartupModel = self + + StartMainFuelCurve = property(getStartMainFuelCurve, setStartMainFuelCurve) + + def getStartIgnFuelCurve(self): + """The unit's startup model may have a startup ignition fuel curve + """ + return self._StartIgnFuelCurve + + def setStartIgnFuelCurve(self, value): + if self._StartIgnFuelCurve is not None: + self._StartIgnFuelCurve._StartupModel = None + + self._StartIgnFuelCurve = value + if self._StartIgnFuelCurve is not None: + self._StartIgnFuelCurve.StartupModel = None + self._StartIgnFuelCurve._StartupModel = self + + StartIgnFuelCurve = property(getStartIgnFuelCurve, setStartIgnFuelCurve) + + def getThermalGeneratingUnit(self): + """A thermal generating unit may have a startup model + """ + return self._ThermalGeneratingUnit + + def setThermalGeneratingUnit(self, value): + if self._ThermalGeneratingUnit is not None: + self._ThermalGeneratingUnit._StartupModel = None + + self._ThermalGeneratingUnit = value + if self._ThermalGeneratingUnit is not None: + self._ThermalGeneratingUnit.StartupModel = None + self._ThermalGeneratingUnit._StartupModel = self + + ThermalGeneratingUnit = property(getThermalGeneratingUnit, setThermalGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/SteamSendoutSchedule.py b/CIM16/IEC61970/Generation/Production/SteamSendoutSchedule.py new file mode 100755 index 00000000..6e8f1e2b --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/SteamSendoutSchedule.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.RegularIntervalSchedule import RegularIntervalSchedule + +class SteamSendoutSchedule(RegularIntervalSchedule): + """The cogeneration plant's steam sendout schedule in volume per time unit.The cogeneration plant's steam sendout schedule in volume per time unit. + """ + + def __init__(self, CogenerationPlant=None, *args, **kw_args): + """Initialises a new 'SteamSendoutSchedule' instance. + + @param CogenerationPlant: A cogeneration plant has a steam sendout schedule + """ + self._CogenerationPlant = None + self.CogenerationPlant = CogenerationPlant + + super(SteamSendoutSchedule, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["CogenerationPlant"] + _many_refs = [] + + def getCogenerationPlant(self): + """A cogeneration plant has a steam sendout schedule + """ + return self._CogenerationPlant + + def setCogenerationPlant(self, value): + if self._CogenerationPlant is not None: + self._CogenerationPlant._SteamSendoutSchedule = None + + self._CogenerationPlant = value + if self._CogenerationPlant is not None: + self._CogenerationPlant.SteamSendoutSchedule = None + self._CogenerationPlant._SteamSendoutSchedule = self + + CogenerationPlant = property(getCogenerationPlant, setCogenerationPlant) + diff --git a/CIM16/IEC61970/Generation/Production/TailbayLossCurve.py b/CIM16/IEC61970/Generation/Production/TailbayLossCurve.py new file mode 100755 index 00000000..40140fb6 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/TailbayLossCurve.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class TailbayLossCurve(Curve): + """Relationship between tailbay head loss hight (y-axis) and the total discharge into the power station's tailbay volume per time unit (x-axis) . There could be more than one curve depending on the level of the tailbay reservoir or river levelRelationship between tailbay head loss hight (y-axis) and the total discharge into the power station's tailbay volume per time unit (x-axis) . There could be more than one curve depending on the level of the tailbay reservoir or river level + """ + + def __init__(self, HydroGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'TailbayLossCurve' instance. + + @param HydroGeneratingUnit: A hydro generating unit has a tailbay loss curve + """ + self._HydroGeneratingUnit = None + self.HydroGeneratingUnit = HydroGeneratingUnit + + super(TailbayLossCurve, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["HydroGeneratingUnit"] + _many_refs = [] + + def getHydroGeneratingUnit(self): + """A hydro generating unit has a tailbay loss curve + """ + return self._HydroGeneratingUnit + + def setHydroGeneratingUnit(self, value): + if self._HydroGeneratingUnit is not None: + filtered = [x for x in self.HydroGeneratingUnit.TailbayLossCurve if x != self] + self._HydroGeneratingUnit._TailbayLossCurve = filtered + + self._HydroGeneratingUnit = value + if self._HydroGeneratingUnit is not None: + if self not in self._HydroGeneratingUnit._TailbayLossCurve: + self._HydroGeneratingUnit._TailbayLossCurve.append(self) + + HydroGeneratingUnit = property(getHydroGeneratingUnit, setHydroGeneratingUnit) + diff --git a/CIM16/IEC61970/Generation/Production/TargetLevelSchedule.py b/CIM16/IEC61970/Generation/Production/TargetLevelSchedule.py new file mode 100755 index 00000000..0d92a923 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/TargetLevelSchedule.py @@ -0,0 +1,67 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class TargetLevelSchedule(Curve): + """Reservoir water level targets from advanced studies or 'rule curves'. Typically in one hour increments for up to 10 daysReservoir water level targets from advanced studies or 'rule curves'. Typically in one hour increments for up to 10 days + """ + + def __init__(self, lowLevelLimit=0.0, highLevelLimit=0.0, Reservoir=None, *args, **kw_args): + """Initialises a new 'TargetLevelSchedule' instance. + + @param lowLevelLimit: Low target level limit, below which the reservoir operation will be penalized + @param highLevelLimit: High target level limit, above which the reservoir operation will be penalized + @param Reservoir: A reservoir may have a water level target schedule. + """ + #: Low target level limit, below which the reservoir operation will be penalized + self.lowLevelLimit = lowLevelLimit + + #: High target level limit, above which the reservoir operation will be penalized + self.highLevelLimit = highLevelLimit + + self._Reservoir = None + self.Reservoir = Reservoir + + super(TargetLevelSchedule, self).__init__(*args, **kw_args) + + _attrs = ["lowLevelLimit", "highLevelLimit"] + _attr_types = {"lowLevelLimit": float, "highLevelLimit": float} + _defaults = {"lowLevelLimit": 0.0, "highLevelLimit": 0.0} + _enums = {} + _refs = ["Reservoir"] + _many_refs = [] + + def getReservoir(self): + """A reservoir may have a water level target schedule. + """ + return self._Reservoir + + def setReservoir(self, value): + if self._Reservoir is not None: + self._Reservoir._TargetLevelSchedule = None + + self._Reservoir = value + if self._Reservoir is not None: + self._Reservoir.TargetLevelSchedule = None + self._Reservoir._TargetLevelSchedule = self + + Reservoir = property(getReservoir, setReservoir) + diff --git a/CIM16/IEC61970/Generation/Production/ThermalGeneratingUnit.py b/CIM16/IEC61970/Generation/Production/ThermalGeneratingUnit.py new file mode 100755 index 00000000..12696e61 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/ThermalGeneratingUnit.py @@ -0,0 +1,309 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Generation.Production.GeneratingUnit import GeneratingUnit + +class ThermalGeneratingUnit(GeneratingUnit): + """A generating unit whose prime mover could be a steam turbine, combustion turbine, or diesel engine.A generating unit whose prime mover could be a steam turbine, combustion turbine, or diesel engine. + """ + + def __init__(self, oMCost=0.0, CAESPlant=None, CogenerationPlant=None, ShutdownCurve=None, FossilFuels=None, HeatRateCurve=None, FuelAllocationSchedules=None, EmissionCurves=None, HeatInputCurve=None, CombinedCyclePlant=None, IncrementalHeatRateCurve=None, StartupModel=None, EmmissionAccounts=None, *args, **kw_args): + """Initialises a new 'ThermalGeneratingUnit' instance. + + @param oMCost: Operating and maintenance cost for the thermal unit + @param CAESPlant: A thermal generating unit may be a member of a compressed air energy storage plant + @param CogenerationPlant: A thermal generating unit may be a member of a cogeneration plant + @param ShutdownCurve: A thermal generating unit may have a shutdown curve + @param FossilFuels: A thermal generating unit may have one or more fossil fuels + @param HeatRateCurve: A thermal generating unit may have a heat rate curve + @param FuelAllocationSchedules: A thermal generating unit may have one or more fuel allocation schedules + @param EmissionCurves: A thermal generating unit may have one or more emission curves + @param HeatInputCurve: A thermal generating unit may have a heat input curve + @param CombinedCyclePlant: A thermal generating unit may be a member of a combined cycle plant + @param IncrementalHeatRateCurve: A thermal generating unit may have an incremental heat rate curve + @param StartupModel: A thermal generating unit may have a startup model + @param EmmissionAccounts: A thermal generating unit may have one or more emission allowance accounts + """ + #: Operating and maintenance cost for the thermal unit + self.oMCost = oMCost + + self._CAESPlant = None + self.CAESPlant = CAESPlant + + self._CogenerationPlant = None + self.CogenerationPlant = CogenerationPlant + + self._ShutdownCurve = None + self.ShutdownCurve = ShutdownCurve + + self._FossilFuels = [] + self.FossilFuels = [] if FossilFuels is None else FossilFuels + + self._HeatRateCurve = None + self.HeatRateCurve = HeatRateCurve + + self._FuelAllocationSchedules = [] + self.FuelAllocationSchedules = [] if FuelAllocationSchedules is None else FuelAllocationSchedules + + self._EmissionCurves = [] + self.EmissionCurves = [] if EmissionCurves is None else EmissionCurves + + self._HeatInputCurve = None + self.HeatInputCurve = HeatInputCurve + + self._CombinedCyclePlant = None + self.CombinedCyclePlant = CombinedCyclePlant + + self._IncrementalHeatRateCurve = None + self.IncrementalHeatRateCurve = IncrementalHeatRateCurve + + self._StartupModel = None + self.StartupModel = StartupModel + + self._EmmissionAccounts = [] + self.EmmissionAccounts = [] if EmmissionAccounts is None else EmmissionAccounts + + super(ThermalGeneratingUnit, self).__init__(*args, **kw_args) + + _attrs = ["oMCost"] + _attr_types = {"oMCost": float} + _defaults = {"oMCost": 0.0} + _enums = {} + _refs = ["CAESPlant", "CogenerationPlant", "ShutdownCurve", "FossilFuels", "HeatRateCurve", "FuelAllocationSchedules", "EmissionCurves", "HeatInputCurve", "CombinedCyclePlant", "IncrementalHeatRateCurve", "StartupModel", "EmmissionAccounts"] + _many_refs = ["FossilFuels", "FuelAllocationSchedules", "EmissionCurves", "EmmissionAccounts"] + + def getCAESPlant(self): + """A thermal generating unit may be a member of a compressed air energy storage plant + """ + return self._CAESPlant + + def setCAESPlant(self, value): + if self._CAESPlant is not None: + self._CAESPlant._ThermalGeneratingUnit = None + + self._CAESPlant = value + if self._CAESPlant is not None: + self._CAESPlant.ThermalGeneratingUnit = None + self._CAESPlant._ThermalGeneratingUnit = self + + CAESPlant = property(getCAESPlant, setCAESPlant) + + def getCogenerationPlant(self): + """A thermal generating unit may be a member of a cogeneration plant + """ + return self._CogenerationPlant + + def setCogenerationPlant(self, value): + if self._CogenerationPlant is not None: + filtered = [x for x in self.CogenerationPlant.ThermalGeneratingUnits if x != self] + self._CogenerationPlant._ThermalGeneratingUnits = filtered + + self._CogenerationPlant = value + if self._CogenerationPlant is not None: + if self not in self._CogenerationPlant._ThermalGeneratingUnits: + self._CogenerationPlant._ThermalGeneratingUnits.append(self) + + CogenerationPlant = property(getCogenerationPlant, setCogenerationPlant) + + def getShutdownCurve(self): + """A thermal generating unit may have a shutdown curve + """ + return self._ShutdownCurve + + def setShutdownCurve(self, value): + if self._ShutdownCurve is not None: + self._ShutdownCurve._ThermalGeneratingUnit = None + + self._ShutdownCurve = value + if self._ShutdownCurve is not None: + self._ShutdownCurve.ThermalGeneratingUnit = None + self._ShutdownCurve._ThermalGeneratingUnit = self + + ShutdownCurve = property(getShutdownCurve, setShutdownCurve) + + def getFossilFuels(self): + """A thermal generating unit may have one or more fossil fuels + """ + return self._FossilFuels + + def setFossilFuels(self, value): + for x in self._FossilFuels: + x.ThermalGeneratingUnit = None + for y in value: + y._ThermalGeneratingUnit = self + self._FossilFuels = value + + FossilFuels = property(getFossilFuels, setFossilFuels) + + def addFossilFuels(self, *FossilFuels): + for obj in FossilFuels: + obj.ThermalGeneratingUnit = self + + def removeFossilFuels(self, *FossilFuels): + for obj in FossilFuels: + obj.ThermalGeneratingUnit = None + + def getHeatRateCurve(self): + """A thermal generating unit may have a heat rate curve + """ + return self._HeatRateCurve + + def setHeatRateCurve(self, value): + if self._HeatRateCurve is not None: + self._HeatRateCurve._ThermalGeneratingUnit = None + + self._HeatRateCurve = value + if self._HeatRateCurve is not None: + self._HeatRateCurve.ThermalGeneratingUnit = None + self._HeatRateCurve._ThermalGeneratingUnit = self + + HeatRateCurve = property(getHeatRateCurve, setHeatRateCurve) + + def getFuelAllocationSchedules(self): + """A thermal generating unit may have one or more fuel allocation schedules + """ + return self._FuelAllocationSchedules + + def setFuelAllocationSchedules(self, value): + for x in self._FuelAllocationSchedules: + x.ThermalGeneratingUnit = None + for y in value: + y._ThermalGeneratingUnit = self + self._FuelAllocationSchedules = value + + FuelAllocationSchedules = property(getFuelAllocationSchedules, setFuelAllocationSchedules) + + def addFuelAllocationSchedules(self, *FuelAllocationSchedules): + for obj in FuelAllocationSchedules: + obj.ThermalGeneratingUnit = self + + def removeFuelAllocationSchedules(self, *FuelAllocationSchedules): + for obj in FuelAllocationSchedules: + obj.ThermalGeneratingUnit = None + + def getEmissionCurves(self): + """A thermal generating unit may have one or more emission curves + """ + return self._EmissionCurves + + def setEmissionCurves(self, value): + for x in self._EmissionCurves: + x.ThermalGeneratingUnit = None + for y in value: + y._ThermalGeneratingUnit = self + self._EmissionCurves = value + + EmissionCurves = property(getEmissionCurves, setEmissionCurves) + + def addEmissionCurves(self, *EmissionCurves): + for obj in EmissionCurves: + obj.ThermalGeneratingUnit = self + + def removeEmissionCurves(self, *EmissionCurves): + for obj in EmissionCurves: + obj.ThermalGeneratingUnit = None + + def getHeatInputCurve(self): + """A thermal generating unit may have a heat input curve + """ + return self._HeatInputCurve + + def setHeatInputCurve(self, value): + if self._HeatInputCurve is not None: + self._HeatInputCurve._ThermalGeneratingUnit = None + + self._HeatInputCurve = value + if self._HeatInputCurve is not None: + self._HeatInputCurve.ThermalGeneratingUnit = None + self._HeatInputCurve._ThermalGeneratingUnit = self + + HeatInputCurve = property(getHeatInputCurve, setHeatInputCurve) + + def getCombinedCyclePlant(self): + """A thermal generating unit may be a member of a combined cycle plant + """ + return self._CombinedCyclePlant + + def setCombinedCyclePlant(self, value): + if self._CombinedCyclePlant is not None: + filtered = [x for x in self.CombinedCyclePlant.ThermalGeneratingUnits if x != self] + self._CombinedCyclePlant._ThermalGeneratingUnits = filtered + + self._CombinedCyclePlant = value + if self._CombinedCyclePlant is not None: + if self not in self._CombinedCyclePlant._ThermalGeneratingUnits: + self._CombinedCyclePlant._ThermalGeneratingUnits.append(self) + + CombinedCyclePlant = property(getCombinedCyclePlant, setCombinedCyclePlant) + + def getIncrementalHeatRateCurve(self): + """A thermal generating unit may have an incremental heat rate curve + """ + return self._IncrementalHeatRateCurve + + def setIncrementalHeatRateCurve(self, value): + if self._IncrementalHeatRateCurve is not None: + self._IncrementalHeatRateCurve._ThermalGeneratingUnit = None + + self._IncrementalHeatRateCurve = value + if self._IncrementalHeatRateCurve is not None: + self._IncrementalHeatRateCurve.ThermalGeneratingUnit = None + self._IncrementalHeatRateCurve._ThermalGeneratingUnit = self + + IncrementalHeatRateCurve = property(getIncrementalHeatRateCurve, setIncrementalHeatRateCurve) + + def getStartupModel(self): + """A thermal generating unit may have a startup model + """ + return self._StartupModel + + def setStartupModel(self, value): + if self._StartupModel is not None: + self._StartupModel._ThermalGeneratingUnit = None + + self._StartupModel = value + if self._StartupModel is not None: + self._StartupModel.ThermalGeneratingUnit = None + self._StartupModel._ThermalGeneratingUnit = self + + StartupModel = property(getStartupModel, setStartupModel) + + def getEmmissionAccounts(self): + """A thermal generating unit may have one or more emission allowance accounts + """ + return self._EmmissionAccounts + + def setEmmissionAccounts(self, value): + for x in self._EmmissionAccounts: + x.ThermalGeneratingUnit = None + for y in value: + y._ThermalGeneratingUnit = self + self._EmmissionAccounts = value + + EmmissionAccounts = property(getEmmissionAccounts, setEmmissionAccounts) + + def addEmmissionAccounts(self, *EmmissionAccounts): + for obj in EmmissionAccounts: + obj.ThermalGeneratingUnit = self + + def removeEmmissionAccounts(self, *EmmissionAccounts): + for obj in EmmissionAccounts: + obj.ThermalGeneratingUnit = None + diff --git a/CIM16/IEC61970/Generation/Production/WindGeneratingUnit.py b/CIM16/IEC61970/Generation/Production/WindGeneratingUnit.py new file mode 100755 index 00000000..b0719878 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/WindGeneratingUnit.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Generation.Production.GeneratingUnit import GeneratingUnit + +class WindGeneratingUnit(GeneratingUnit): + """A wind driven generating unit.A wind driven generating unit. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'WindGeneratingUnit' instance. + + """ + super(WindGeneratingUnit, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Generation/Production/__init__.py b/CIM16/IEC61970/Generation/Production/__init__.py new file mode 100755 index 00000000..4968d8c0 --- /dev/null +++ b/CIM16/IEC61970/Generation/Production/__init__.py @@ -0,0 +1,131 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The production package is responsible for classes which describe various kinds of generators. These classes also provide production costing information which is used to economically allocate demand among committed units and calculate reserve quantities. +""" + +from CIM16.IEC61970.Generation.Production.Reservoir import Reservoir +from CIM16.IEC61970.Generation.Production.CogenerationPlant import CogenerationPlant +from CIM16.IEC61970.Generation.Production.GenUnitOpSchedule import GenUnitOpSchedule +from CIM16.IEC61970.Generation.Production.FuelAllocationSchedule import FuelAllocationSchedule +from CIM16.IEC61970.Generation.Production.GrossToNetActivePowerCurve import GrossToNetActivePowerCurve +from CIM16.IEC61970.Generation.Production.LevelVsVolumeCurve import LevelVsVolumeCurve +from CIM16.IEC61970.Generation.Production.StartRampCurve import StartRampCurve +from CIM16.IEC61970.Generation.Production.NuclearGeneratingUnit import NuclearGeneratingUnit +from CIM16.IEC61970.Generation.Production.EmissionCurve import EmissionCurve +from CIM16.IEC61970.Generation.Production.HydroPumpOpSchedule import HydroPumpOpSchedule +from CIM16.IEC61970.Generation.Production.SteamSendoutSchedule import SteamSendoutSchedule +from CIM16.IEC61970.Generation.Production.TargetLevelSchedule import TargetLevelSchedule +from CIM16.IEC61970.Generation.Production.CombinedCyclePlant import CombinedCyclePlant +from CIM16.IEC61970.Generation.Production.HeatRateCurve import HeatRateCurve +from CIM16.IEC61970.Generation.Production.ThermalGeneratingUnit import ThermalGeneratingUnit +from CIM16.IEC61970.Generation.Production.EmissionAccount import EmissionAccount +from CIM16.IEC61970.Generation.Production.PenstockLossCurve import PenstockLossCurve +from CIM16.IEC61970.Generation.Production.StartupModel import StartupModel +from CIM16.IEC61970.Generation.Production.HydroGeneratingUnit import HydroGeneratingUnit +from CIM16.IEC61970.Generation.Production.GenUnitOpCostCurve import GenUnitOpCostCurve +from CIM16.IEC61970.Generation.Production.IncrementalHeatRateCurve import IncrementalHeatRateCurve +from CIM16.IEC61970.Generation.Production.FossilFuel import FossilFuel +from CIM16.IEC61970.Generation.Production.GeneratingUnit import GeneratingUnit +from CIM16.IEC61970.Generation.Production.StartIgnFuelCurve import StartIgnFuelCurve +from CIM16.IEC61970.Generation.Production.StartMainFuelCurve import StartMainFuelCurve +from CIM16.IEC61970.Generation.Production.TailbayLossCurve import TailbayLossCurve +from CIM16.IEC61970.Generation.Production.HydroPump import HydroPump +from CIM16.IEC61970.Generation.Production.InflowForecast import InflowForecast +from CIM16.IEC61970.Generation.Production.HydroGeneratingEfficiencyCurve import HydroGeneratingEfficiencyCurve +from CIM16.IEC61970.Generation.Production.ShutdownCurve import ShutdownCurve +from CIM16.IEC61970.Generation.Production.HydroPowerPlant import HydroPowerPlant +from CIM16.IEC61970.Generation.Production.CAESPlant import CAESPlant +from CIM16.IEC61970.Generation.Production.AirCompressor import AirCompressor +from CIM16.IEC61970.Generation.Production.HeatInputCurve import HeatInputCurve +from CIM16.IEC61970.Generation.Production.WindGeneratingUnit import WindGeneratingUnit + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Production" +nsPrefix = "cimProduction" + + +class FuelType(str): + """Values are: oil, coal, lignite, gas + """ + pass + +class GeneratorOperatingMode(str): + """Values are: MRN, EDC, LFC, fixed, REG, AGC, manual, off + """ + pass + +class GeneratorControlMode(str): + """Values are: setpoint, pulse + """ + pass + +class HydroPlantType(str): + """Values are: pumpedStorage, runOfRiver, minorStorage, majorStorage + """ + pass + +class HydroEnergyConversionKind(str): + """Values are: generator, pumpAndGenerator + """ + pass + +class PenstockType(str): + pass + +class EmissionValueSource(str): + """Values are: calculated, measured + """ + pass + +class GeneratorControlSource(str): + """Values are: plantControl, offAGC, unavailable, onAGC + """ + pass + +class SpillwayGateType(str): + pass + +class SurgeTankCode(str): + pass + +class EmissionType(str): + """Values are: carbonDisulfide, sulfurDioxide, hydrogenSulfide, chlorine, carbonDioxide, nitrogenOxide + """ + pass + +class Classification(str): + """1..n, with 1 the most detailed, highest priority, etc. + """ + pass + +class HeatRate(float): + """Heat generated, in energy pertime unit of elapsed time + """ + pass + +class CostPerHeatUnit(float): + """Cost, in units of currency, per quantity of heat generated + """ + pass + +class Emission(float): + """Quantity of emission per fuel heat content + """ + pass diff --git a/CIM16/IEC61970/Generation/__init__.py b/CIM16/IEC61970/Generation/__init__.py new file mode 100755 index 00000000..6690f909 --- /dev/null +++ b/CIM16/IEC61970/Generation/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The production package is responsible for classes which describe various kinds of generators. These classes also provide production costing information which is used to economically allocate demand among committed units and calculate reserve quantities. +""" + + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Generation" +nsPrefix = "cimGeneration" + diff --git a/CIM16/IEC61970/Graphics/DiagramObject.py b/CIM16/IEC61970/Graphics/DiagramObject.py new file mode 100755 index 00000000..6e62f535 --- /dev/null +++ b/CIM16/IEC61970/Graphics/DiagramObject.py @@ -0,0 +1,180 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class DiagramObject(IdentifiedObject): + """This class defines an object that defines one or more points in a given space. This object can be associated with anything that subclasses Identified Object in IEC 61970-301This class defines an object that defines one or more points in a given space. This object can be associated with anything that subclasses Identified Object in IEC 61970-301 + """ + + def __init__(self, offsetY=0.0, offsetX=0.0, isPolygon=False, rotation=0.0, drawingOrder=0, VisibilityLayers=None, IdentifiedObject=None, DiagramObjectStyle=None, DiagramObjectPoints=None, Diagram=None, *args, **kw_args): + """Initialises a new 'DiagramObject' instance. + + @param offsetY: The offset in the Y direction. This is used for defining the offset from centre for rendering an icon (the default is that a single point specifies the centre of the icon). The offset is in per-unit with 0 indicating there is no offset from the vertical centre of the icon. The offset direction is dependent on the orientation of the diagram, with -0.5 and 0.5 indicating an offset of +/- 50% on the vertical axis. + @param offsetX: The offset in the X direction. This is used for defining the offset from centre for rendering an icon (the default is that a single point specifies the centre of the icon). The offset is in per-unit with 0 indicating there is no offset from the horizontal centre of the icon. -0.5 indicates it is offset by 50% to the left and 0.5 indicates an offset of 50% to the right. + @param isPolygon: Defines whether or not the diagram objects points define the boundaries of a polygon or the routing of a polyline. If this value is true then a receiving application should consider the first and last points to be connected. + @param rotation: Sets the angle of rotation (in Degrees) of the diagram object in a clockwise direction from the normal + @param drawingOrder: The drawing order of this element. The higher the number, the later the element is drawn in sequence. This is used to ensure that elements that overlap are rendered in the correct order. + @param VisibilityLayers: A diagram object can be part of multiple visibility layers + @param IdentifiedObject: The domain object that this diagram object is associated with + @param DiagramObjectStyle: A diagram object has a style associated that provides a reference for the style used in the originating system + @param DiagramObjectPoints: A diagram object can have 0 or more points to reflect its layout position, routing (for polylines) or boundary (for polygons) + @param Diagram: A diagram object is part of a Diagram + """ + #: The offset in the Y direction. This is used for defining the offset from centre for rendering an icon (the default is that a single point specifies the centre of the icon). The offset is in per-unit with 0 indicating there is no offset from the vertical centre of the icon. The offset direction is dependent on the orientation of the diagram, with -0.5 and 0.5 indicating an offset of +/- 50% on the vertical axis. + self.offsetY = offsetY + + #: The offset in the X direction. This is used for defining the offset from centre for rendering an icon (the default is that a single point specifies the centre of the icon). The offset is in per-unit with 0 indicating there is no offset from the horizontal centre of the icon. -0.5 indicates it is offset by 50% to the left and 0.5 indicates an offset of 50% to the right. + self.offsetX = offsetX + + #: Defines whether or not the diagram objects points define the boundaries of a polygon or the routing of a polyline. If this value is true then a receiving application should consider the first and last points to be connected. + self.isPolygon = isPolygon + + #: Sets the angle of rotation (in Degrees) of the diagram object in a clockwise direction from the normal + self.rotation = rotation + + #: The drawing order of this element. The higher the number, the later the element is drawn in sequence. This is used to ensure that elements that overlap are rendered in the correct order. + self.drawingOrder = drawingOrder + + self._VisibilityLayers = [] + self.VisibilityLayers = [] if VisibilityLayers is None else VisibilityLayers + + self._IdentifiedObject = None + self.IdentifiedObject = IdentifiedObject + + self._DiagramObjectStyle = None + self.DiagramObjectStyle = DiagramObjectStyle + + self._DiagramObjectPoints = [] + self.DiagramObjectPoints = [] if DiagramObjectPoints is None else DiagramObjectPoints + + self._Diagram = None + self.Diagram = Diagram + + super(DiagramObject, self).__init__(*args, **kw_args) + + _attrs = ["offsetY", "offsetX", "isPolygon", "rotation", "drawingOrder"] + _attr_types = {"offsetY": float, "offsetX": float, "isPolygon": bool, "rotation": float, "drawingOrder": int} + _defaults = {"offsetY": 0.0, "offsetX": 0.0, "isPolygon": False, "rotation": 0.0, "drawingOrder": 0} + _enums = {} + _refs = ["VisibilityLayers", "IdentifiedObject", "DiagramObjectStyle", "DiagramObjectPoints", "Diagram"] + _many_refs = ["VisibilityLayers", "DiagramObjectPoints"] + + def getVisibilityLayers(self): + """A diagram object can be part of multiple visibility layers + """ + return self._VisibilityLayers + + def setVisibilityLayers(self, value): + for p in self._VisibilityLayers: + filtered = [q for q in p.DiagramObjects if q != self] + self._VisibilityLayers._DiagramObjects = filtered + for r in value: + if self not in r._DiagramObjects: + r._DiagramObjects.append(self) + self._VisibilityLayers = value + + VisibilityLayers = property(getVisibilityLayers, setVisibilityLayers) + + def addVisibilityLayers(self, *VisibilityLayers): + for obj in VisibilityLayers: + if self not in obj._DiagramObjects: + obj._DiagramObjects.append(self) + self._VisibilityLayers.append(obj) + + def removeVisibilityLayers(self, *VisibilityLayers): + for obj in VisibilityLayers: + if self in obj._DiagramObjects: + obj._DiagramObjects.remove(self) + self._VisibilityLayers.remove(obj) + + def getIdentifiedObject(self): + """The domain object that this diagram object is associated with + """ + return self._IdentifiedObject + + def setIdentifiedObject(self, value): + if self._IdentifiedObject is not None: + filtered = [x for x in self.IdentifiedObject.DiagramObjects if x != self] + self._IdentifiedObject._DiagramObjects = filtered + + self._IdentifiedObject = value + if self._IdentifiedObject is not None: + if self not in self._IdentifiedObject._DiagramObjects: + self._IdentifiedObject._DiagramObjects.append(self) + + IdentifiedObject = property(getIdentifiedObject, setIdentifiedObject) + + def getDiagramObjectStyle(self): + """A diagram object has a style associated that provides a reference for the style used in the originating system + """ + return self._DiagramObjectStyle + + def setDiagramObjectStyle(self, value): + if self._DiagramObjectStyle is not None: + filtered = [x for x in self.DiagramObjectStyle.DiagramObjects if x != self] + self._DiagramObjectStyle._DiagramObjects = filtered + + self._DiagramObjectStyle = value + if self._DiagramObjectStyle is not None: + if self not in self._DiagramObjectStyle._DiagramObjects: + self._DiagramObjectStyle._DiagramObjects.append(self) + + DiagramObjectStyle = property(getDiagramObjectStyle, setDiagramObjectStyle) + + def getDiagramObjectPoints(self): + """A diagram object can have 0 or more points to reflect its layout position, routing (for polylines) or boundary (for polygons) + """ + return self._DiagramObjectPoints + + def setDiagramObjectPoints(self, value): + for x in self._DiagramObjectPoints: + x.DiagramObject = None + for y in value: + y._DiagramObject = self + self._DiagramObjectPoints = value + + DiagramObjectPoints = property(getDiagramObjectPoints, setDiagramObjectPoints) + + def addDiagramObjectPoints(self, *DiagramObjectPoints): + for obj in DiagramObjectPoints: + obj.DiagramObject = self + + def removeDiagramObjectPoints(self, *DiagramObjectPoints): + for obj in DiagramObjectPoints: + obj.DiagramObject = None + + def getDiagram(self): + """A diagram object is part of a Diagram + """ + return self._Diagram + + def setDiagram(self, value): + if self._Diagram is not None: + filtered = [x for x in self.Diagram.DiagramObjects if x != self] + self._Diagram._DiagramObjects = filtered + + self._Diagram = value + if self._Diagram is not None: + if self not in self._Diagram._DiagramObjects: + self._Diagram._DiagramObjects.append(self) + + Diagram = property(getDiagram, setDiagram) + diff --git a/CIM16/IEC61970/Graphics/DiagramObjectGluePoint.py b/CIM16/IEC61970/Graphics/DiagramObjectGluePoint.py new file mode 100755 index 00000000..83fe5a53 --- /dev/null +++ b/CIM16/IEC61970/Graphics/DiagramObjectGluePoint.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class DiagramObjectGluePoint(Element): + """This is used for grouping DiagramObjectPoints from different DiagramObjects that are considered to be ‘glued’ together in a diagram even if they are not at the exact same coordinates.This is used for grouping DiagramObjectPoints from different DiagramObjects that are considered to be ‘glued’ together in a diagram even if they are not at the exact same coordinates. + """ + + def __init__(self, DiagramObjectPoints=None, *args, **kw_args): + """Initialises a new 'DiagramObjectGluePoint' instance. + + @param DiagramObjectPoints: A diagram object glue point is associated with 2 or more object points that are considered to be 'glued' together. + """ + self._DiagramObjectPoints = [] + self.DiagramObjectPoints = [] if DiagramObjectPoints is None else DiagramObjectPoints + + super(DiagramObjectGluePoint, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["DiagramObjectPoints"] + _many_refs = ["DiagramObjectPoints"] + + def getDiagramObjectPoints(self): + """A diagram object glue point is associated with 2 or more object points that are considered to be 'glued' together. + """ + return self._DiagramObjectPoints + + def setDiagramObjectPoints(self, value): + for x in self._DiagramObjectPoints: + x.DiagramObjectGluePoint = None + for y in value: + y._DiagramObjectGluePoint = self + self._DiagramObjectPoints = value + + DiagramObjectPoints = property(getDiagramObjectPoints, setDiagramObjectPoints) + + def addDiagramObjectPoints(self, *DiagramObjectPoints): + for obj in DiagramObjectPoints: + obj.DiagramObjectGluePoint = self + + def removeDiagramObjectPoints(self, *DiagramObjectPoints): + for obj in DiagramObjectPoints: + obj.DiagramObjectGluePoint = None + diff --git a/CIM16/IEC61970/Graphics/DiagramObjectPoint.py b/CIM16/IEC61970/Graphics/DiagramObjectPoint.py new file mode 100755 index 00000000..4ad0a26d --- /dev/null +++ b/CIM16/IEC61970/Graphics/DiagramObjectPoint.py @@ -0,0 +1,97 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class DiagramObjectPoint(Element): + """A point in a given space defined by 3 coordinates and associated to a DiagramObject. The coordinates may be positive or negative as the origin does not have to be in the corner of a diagram. The sequence attribute is used when a DiagramObject has more than one DiagramObjectPoint in which case this defines the drawing order. A DiagramObject may represent any CIM object. For single line diagrams such objects typically are • analog values • breaker/disconnector • power transformer • transmission lineA point in a given space defined by 3 coordinates and associated to a DiagramObject. The coordinates may be positive or negative as the origin does not have to be in the corner of a diagram. The sequence attribute is used when a DiagramObject has more than one DiagramObjectPoint in which case this defines the drawing order. A DiagramObject may represent any CIM object. For single line diagrams such objects typically are • analog values • breaker/disconnector • power transformer • transmission line + """ + + def __init__(self, sequenceNumber=0, xPosition=0.0, yPosition=0.0, zPosition=0.0, DiagramObjectGluePoint=None, DiagramObject=None, *args, **kw_args): + """Initialises a new 'DiagramObjectPoint' instance. + + @param sequenceNumber: The sequence position of the point, used for defining the order of points for DiagramObjects acting as a polyline or polygon with more than one point + @param xPosition: The X coordinate of this point + @param yPosition: The Y coordinate of this point + @param zPosition: The Z coordinate of this point + @param DiagramObjectGluePoint: The 'glue' point that this point is associated with + @param DiagramObject: The diagram object with which the points are associated + """ + #: The sequence position of the point, used for defining the order of points for DiagramObjects acting as a polyline or polygon with more than one point + self.sequenceNumber = sequenceNumber + + #: The X coordinate of this point + self.xPosition = xPosition + + #: The Y coordinate of this point + self.yPosition = yPosition + + #: The Z coordinate of this point + self.zPosition = zPosition + + self._DiagramObjectGluePoint = None + self.DiagramObjectGluePoint = DiagramObjectGluePoint + + self._DiagramObject = None + self.DiagramObject = DiagramObject + + super(DiagramObjectPoint, self).__init__(*args, **kw_args) + + _attrs = ["sequenceNumber", "xPosition", "yPosition", "zPosition"] + _attr_types = {"sequenceNumber": int, "xPosition": float, "yPosition": float, "zPosition": float} + _defaults = {"sequenceNumber": 0, "xPosition": 0.0, "yPosition": 0.0, "zPosition": 0.0} + _enums = {} + _refs = ["DiagramObjectGluePoint", "DiagramObject"] + _many_refs = [] + + def getDiagramObjectGluePoint(self): + """The 'glue' point that this point is associated with + """ + return self._DiagramObjectGluePoint + + def setDiagramObjectGluePoint(self, value): + if self._DiagramObjectGluePoint is not None: + filtered = [x for x in self.DiagramObjectGluePoint.DiagramObjectPoints if x != self] + self._DiagramObjectGluePoint._DiagramObjectPoints = filtered + + self._DiagramObjectGluePoint = value + if self._DiagramObjectGluePoint is not None: + if self not in self._DiagramObjectGluePoint._DiagramObjectPoints: + self._DiagramObjectGluePoint._DiagramObjectPoints.append(self) + + DiagramObjectGluePoint = property(getDiagramObjectGluePoint, setDiagramObjectGluePoint) + + def getDiagramObject(self): + """The diagram object with which the points are associated + """ + return self._DiagramObject + + def setDiagramObject(self, value): + if self._DiagramObject is not None: + filtered = [x for x in self.DiagramObject.DiagramObjectPoints if x != self] + self._DiagramObject._DiagramObjectPoints = filtered + + self._DiagramObject = value + if self._DiagramObject is not None: + if self not in self._DiagramObject._DiagramObjectPoints: + self._DiagramObject._DiagramObjectPoints.append(self) + + DiagramObject = property(getDiagramObject, setDiagramObject) + diff --git a/CIM16/IEC61970/Graphics/DiagramObjectStyle.py b/CIM16/IEC61970/Graphics/DiagramObjectStyle.py new file mode 100755 index 00000000..af28facb --- /dev/null +++ b/CIM16/IEC61970/Graphics/DiagramObjectStyle.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class DiagramObjectStyle(IdentifiedObject): + """A reference to a style used by the originating system for a DiagramObject. A DiagramObjectStyle describes information such as • line thickness • shape, e.g circle, rectangle ... • colorA reference to a style used by the originating system for a DiagramObject. A DiagramObjectStyle describes information such as • line thickness • shape, e.g circle, rectangle ... • color + """ + + def __init__(self, DiagramObjects=None, *args, **kw_args): + """Initialises a new 'DiagramObjectStyle' instance. + + @param DiagramObjects: A style can be assigned to multiple DiagramObjects + """ + self._DiagramObjects = [] + self.DiagramObjects = [] if DiagramObjects is None else DiagramObjects + + super(DiagramObjectStyle, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["DiagramObjects"] + _many_refs = ["DiagramObjects"] + + def getDiagramObjects(self): + """A style can be assigned to multiple DiagramObjects + """ + return self._DiagramObjects + + def setDiagramObjects(self, value): + for x in self._DiagramObjects: + x.DiagramObjectStyle = None + for y in value: + y._DiagramObjectStyle = self + self._DiagramObjects = value + + DiagramObjects = property(getDiagramObjects, setDiagramObjects) + + def addDiagramObjects(self, *DiagramObjects): + for obj in DiagramObjects: + obj.DiagramObjectStyle = self + + def removeDiagramObjects(self, *DiagramObjects): + for obj in DiagramObjects: + obj.DiagramObjectStyle = None + diff --git a/CIM16/IEC61970/Graphics/TextDiagramObject.py b/CIM16/IEC61970/Graphics/TextDiagramObject.py new file mode 100755 index 00000000..0e2d96a2 --- /dev/null +++ b/CIM16/IEC61970/Graphics/TextDiagramObject.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Graphics.DiagramObject import DiagramObject + +class TextDiagramObject(DiagramObject): + """A diagram object for placing free-text or text derived from an associated domain object.A diagram object for placing free-text or text derived from an associated domain object. + """ + + def __init__(self, text='', *args, **kw_args): + """Initialises a new 'TextDiagramObject' instance. + + @param text: The text that is displayed by this text diagram object + """ + #: The text that is displayed by this text diagram object + self.text = text + + super(TextDiagramObject, self).__init__(*args, **kw_args) + + _attrs = ["text"] + _attr_types = {"text": str} + _defaults = {"text": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Graphics/VisibilityLayer.py b/CIM16/IEC61970/Graphics/VisibilityLayer.py new file mode 100755 index 00000000..32ec36dc --- /dev/null +++ b/CIM16/IEC61970/Graphics/VisibilityLayer.py @@ -0,0 +1,75 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class VisibilityLayer(IdentifiedObject): + """Layers are typically used for grouping diagram objects according to themes and scales. Themes are used to display or hide certain information (e.g., lakes, borders), while scales are used for hiding or displaying information depending on the current zoom level (hide text when it is too small to be read, or when it exceeds the screen size). This is also called de-cluttering. CIM based graphics exchange will support an m:n relationship between diagram objects and layers. It will be the task of the importing system to convert an m:n case into an appropriate 1:n representation if the importing system does not support m:n.Layers are typically used for grouping diagram objects according to themes and scales. Themes are used to display or hide certain information (e.g., lakes, borders), while scales are used for hiding or displaying information depending on the current zoom level (hide text when it is too small to be read, or when it exceeds the screen size). This is also called de-cluttering. CIM based graphics exchange will support an m:n relationship between diagram objects and layers. It will be the task of the importing system to convert an m:n case into an appropriate 1:n representation if the importing system does not support m:n. + """ + + def __init__(self, drawingOrder=0, DiagramObjects=None, *args, **kw_args): + """Initialises a new 'VisibilityLayer' instance. + + @param drawingOrder: The drawing order for this layer. As with the drawingOrder for diagram objects, the higher the number, the later the layer and the objects within it are rendered. + @param DiagramObjects: A visibility layer can contain one or more diagram objects + """ + #: The drawing order for this layer. As with the drawingOrder for diagram objects, the higher the number, the later the layer and the objects within it are rendered. + self.drawingOrder = drawingOrder + + self._DiagramObjects = [] + self.DiagramObjects = [] if DiagramObjects is None else DiagramObjects + + super(VisibilityLayer, self).__init__(*args, **kw_args) + + _attrs = ["drawingOrder"] + _attr_types = {"drawingOrder": int} + _defaults = {"drawingOrder": 0} + _enums = {} + _refs = ["DiagramObjects"] + _many_refs = ["DiagramObjects"] + + def getDiagramObjects(self): + """A visibility layer can contain one or more diagram objects + """ + return self._DiagramObjects + + def setDiagramObjects(self, value): + for p in self._DiagramObjects: + filtered = [q for q in p.VisibilityLayers if q != self] + self._DiagramObjects._VisibilityLayers = filtered + for r in value: + if self not in r._VisibilityLayers: + r._VisibilityLayers.append(self) + self._DiagramObjects = value + + DiagramObjects = property(getDiagramObjects, setDiagramObjects) + + def addDiagramObjects(self, *DiagramObjects): + for obj in DiagramObjects: + if self not in obj._VisibilityLayers: + obj._VisibilityLayers.append(self) + self._DiagramObjects.append(obj) + + def removeDiagramObjects(self, *DiagramObjects): + for obj in DiagramObjects: + if self in obj._VisibilityLayers: + obj._VisibilityLayers.remove(self) + self._DiagramObjects.remove(obj) + diff --git a/CIM16/IEC61970/Graphics/__init__.py b/CIM16/IEC61970/Graphics/__init__.py new file mode 100755 index 00000000..7d66426b --- /dev/null +++ b/CIM16/IEC61970/Graphics/__init__.py @@ -0,0 +1,36 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +from CIM16.IEC61970.Graphics.TextDiagramObject import TextDiagramObject +from CIM16.IEC61970.Graphics.DiagramObjectGluePoint import DiagramObjectGluePoint +from CIM16.IEC61970.Graphics.DiagramObject import DiagramObject +from CIM16.IEC61970.Graphics.DiagramObjectStyle import DiagramObjectStyle +from CIM16.IEC61970.Graphics.DiagramObjectPoint import DiagramObjectPoint +from CIM16.IEC61970.Graphics.VisibilityLayer import VisibilityLayer + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Graphics" +nsPrefix = "cimGraphics" + + +class OrientationKind(str): + """Values are: negative, positive + """ + pass diff --git a/CIM16/IEC61970/IEC61970CIMVersion.py b/CIM16/IEC61970/IEC61970CIMVersion.py new file mode 100755 index 00000000..1d0e53ad --- /dev/null +++ b/CIM16/IEC61970/IEC61970CIMVersion.py @@ -0,0 +1,50 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified date: 05/06/2017 + +from CIM16.Element import Element + +class IEC61970CIMVersion(Element): + """This is the IEC 61970 CIM version number assigned to this UML model file.This is the IEC 61970 CIM version number assigned to this UML model file. + """ + + def __init__(self, date='', version='', *args, **kw_args): + """Initialises a new 'IEC61970CIMVersion' instance. + + @param date: Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. + @param version: Form is IEC61970CIMXXvYY where XX is the major CIM package version and the YY is the minor version. For ecample IEC61970CIM13v18. + """ + #: Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. + self.date = date + + #: Form is IEC61970CIMXXvYY where XX is the major CIM package version and the YY is the minor version. For ecample IEC61970CIM13v18. + self.version = version + + super(IEC61970CIMVersion, self).__init__(*args, **kw_args) + + _attrs = ["date", "version"] + _attr_types = {"date": str, "version": str} + _defaults = {"date": '', "version": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssetModels/AssetModelCatalogue.py b/CIM16/IEC61970/Informative/InfAssetModels/AssetModelCatalogue.py new file mode 100755 index 00000000..7eb753bd --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssetModels/AssetModelCatalogue.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class AssetModelCatalogue(IdentifiedObject): + """Catalogue of available types of products and materials that are used to build or install, maintain or operate an Asset. Each catalogue item is for a specific product (AssetModel) available from a specific supplier.Catalogue of available types of products and materials that are used to build or install, maintain or operate an Asset. Each catalogue item is for a specific product (AssetModel) available from a specific supplier. + """ + + def __init__(self, AssetModelCatalogueItems=None, status=None, *args, **kw_args): + """Initialises a new 'AssetModelCatalogue' instance. + + @param AssetModelCatalogueItems: + @param status: + """ + self._AssetModelCatalogueItems = [] + self.AssetModelCatalogueItems = [] if AssetModelCatalogueItems is None else AssetModelCatalogueItems + + self.status = status + + super(AssetModelCatalogue, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["AssetModelCatalogueItems", "status"] + _many_refs = ["AssetModelCatalogueItems"] + + def getAssetModelCatalogueItems(self): + + return self._AssetModelCatalogueItems + + def setAssetModelCatalogueItems(self, value): + for x in self._AssetModelCatalogueItems: + x.AssetModelCatalogue = None + for y in value: + y._AssetModelCatalogue = self + self._AssetModelCatalogueItems = value + + AssetModelCatalogueItems = property(getAssetModelCatalogueItems, setAssetModelCatalogueItems) + + def addAssetModelCatalogueItems(self, *AssetModelCatalogueItems): + for obj in AssetModelCatalogueItems: + obj.AssetModelCatalogue = self + + def removeAssetModelCatalogueItems(self, *AssetModelCatalogueItems): + for obj in AssetModelCatalogueItems: + obj.AssetModelCatalogue = None + + status = None + diff --git a/CIM16/IEC61970/Informative/InfAssetModels/AssetModelCatalogueItem.py b/CIM16/IEC61970/Informative/InfAssetModels/AssetModelCatalogueItem.py new file mode 100755 index 00000000..38a39182 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssetModels/AssetModelCatalogueItem.py @@ -0,0 +1,133 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class AssetModelCatalogueItem(Document): + """Provides pricing and other relevant information about a specific manufacturer's product (i.e., AssetModel), and its price from a given supplier. A single AssetModel may be availble from multiple suppliers. Note that manufacturer and supplier are both types of organisation, which the association is inherited from Document.Provides pricing and other relevant information about a specific manufacturer's product (i.e., AssetModel), and its price from a given supplier. A single AssetModel may be availble from multiple suppliers. Note that manufacturer and supplier are both types of organisation, which the association is inherited from Document. + """ + + def __init__(self, unitCost=0.0, ErpPOLineItems=None, AssetModelCatalogue=None, AssetModel=None, ErpQuoteLineItems=None, *args, **kw_args): + """Initialises a new 'AssetModelCatalogueItem' instance. + + @param unitCost: Unit cost for an asset model from a specific supplier, either for a unit cost or cost per unit length. Cost is for material or asset only and does not include labor to install/construct or configure it. + @param ErpPOLineItems: + @param AssetModelCatalogue: + @param AssetModel: + @param ErpQuoteLineItems: + """ + #: Unit cost for an asset model from a specific supplier, either for a unit cost or cost per unit length. Cost is for material or asset only and does not include labor to install/construct or configure it. + self.unitCost = unitCost + + self._ErpPOLineItems = [] + self.ErpPOLineItems = [] if ErpPOLineItems is None else ErpPOLineItems + + self._AssetModelCatalogue = None + self.AssetModelCatalogue = AssetModelCatalogue + + self._AssetModel = None + self.AssetModel = AssetModel + + self._ErpQuoteLineItems = [] + self.ErpQuoteLineItems = [] if ErpQuoteLineItems is None else ErpQuoteLineItems + + super(AssetModelCatalogueItem, self).__init__(*args, **kw_args) + + _attrs = ["unitCost"] + _attr_types = {"unitCost": float} + _defaults = {"unitCost": 0.0} + _enums = {} + _refs = ["ErpPOLineItems", "AssetModelCatalogue", "AssetModel", "ErpQuoteLineItems"] + _many_refs = ["ErpPOLineItems", "ErpQuoteLineItems"] + + def getErpPOLineItems(self): + + return self._ErpPOLineItems + + def setErpPOLineItems(self, value): + for x in self._ErpPOLineItems: + x.AssetModelCatalogueItem = None + for y in value: + y._AssetModelCatalogueItem = self + self._ErpPOLineItems = value + + ErpPOLineItems = property(getErpPOLineItems, setErpPOLineItems) + + def addErpPOLineItems(self, *ErpPOLineItems): + for obj in ErpPOLineItems: + obj.AssetModelCatalogueItem = self + + def removeErpPOLineItems(self, *ErpPOLineItems): + for obj in ErpPOLineItems: + obj.AssetModelCatalogueItem = None + + def getAssetModelCatalogue(self): + + return self._AssetModelCatalogue + + def setAssetModelCatalogue(self, value): + if self._AssetModelCatalogue is not None: + filtered = [x for x in self.AssetModelCatalogue.AssetModelCatalogueItems if x != self] + self._AssetModelCatalogue._AssetModelCatalogueItems = filtered + + self._AssetModelCatalogue = value + if self._AssetModelCatalogue is not None: + if self not in self._AssetModelCatalogue._AssetModelCatalogueItems: + self._AssetModelCatalogue._AssetModelCatalogueItems.append(self) + + AssetModelCatalogue = property(getAssetModelCatalogue, setAssetModelCatalogue) + + def getAssetModel(self): + + return self._AssetModel + + def setAssetModel(self, value): + if self._AssetModel is not None: + filtered = [x for x in self.AssetModel.AssetModelCatalogueItems if x != self] + self._AssetModel._AssetModelCatalogueItems = filtered + + self._AssetModel = value + if self._AssetModel is not None: + if self not in self._AssetModel._AssetModelCatalogueItems: + self._AssetModel._AssetModelCatalogueItems.append(self) + + AssetModel = property(getAssetModel, setAssetModel) + + def getErpQuoteLineItems(self): + + return self._ErpQuoteLineItems + + def setErpQuoteLineItems(self, value): + for x in self._ErpQuoteLineItems: + x.AssetModelCatalogueItem = None + for y in value: + y._AssetModelCatalogueItem = self + self._ErpQuoteLineItems = value + + ErpQuoteLineItems = property(getErpQuoteLineItems, setErpQuoteLineItems) + + def addErpQuoteLineItems(self, *ErpQuoteLineItems): + for obj in ErpQuoteLineItems: + obj.AssetModelCatalogueItem = self + + def removeErpQuoteLineItems(self, *ErpQuoteLineItems): + for obj in ErpQuoteLineItems: + obj.AssetModelCatalogueItem = None + diff --git a/CIM16/IEC61970/Informative/InfAssetModels/TransformerAssetModel.py b/CIM16/IEC61970/Informative/InfAssetModels/TransformerAssetModel.py new file mode 100755 index 00000000..024c5efc --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssetModels/TransformerAssetModel.py @@ -0,0 +1,140 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.ProductAssetModel import ProductAssetModel + +class TransformerAssetModel(ProductAssetModel): + """Documentation for a type of a transformer of a particular product model made by a manufacturer.Documentation for a type of a transformer of a particular product model made by a manufacturer. + """ + + def __init__(self, neutralBIL=0.0, constructionKind="dryType", coreCoilsWeight=0.0, windingInsulationKind="thermallyUpgradedPaper", hourOverLoadRating=0.0, altPrimaryNomVoltage=0.0, altSecondaryNomVoltage=0.0, reconfigWinding=False, function="autotransformer", oilPreservationKind="other", dayOverLoadRating=0.0, coreKind="shell", autoTransformer=False, solidInsulationWeight=0.0, TransformerAssets=None, TransformerInfo=None, *args, **kw_args): + """Initialises a new 'TransformerAssetModel' instance. + + @param neutralBIL: Basic Insulation Level of Neutral + @param constructionKind: Kind of construction for this transformer. Values are: "dryType", "vaultThreePhase", "network", "padmounted", "padmountLoopThrough", "vault", "onePhase", "padmountFeedThrough", "aerial", "threePhase", "unknown", "overhead", "padmountDeadFront", "underground", "padmountLiveFront", "subway" + @param coreCoilsWeight: Weight of core and coils in transformer. + @param windingInsulationKind: Type of insultation used for transformer windings. Values are: "thermallyUpgradedPaper", "other", "nomex", "paper" + @param hourOverLoadRating: 1-hour overload rating. + @param altPrimaryNomVoltage: Nominal voltage rating for alternate configuration for primary winding. + @param altSecondaryNomVoltage: Nominal voltage rating for alternate configuration for secondary winding. + @param reconfigWinding: True if windings can be re-configured to result in a different input or output voltage. + @param function: Function of this transformer. Values are: "autotransformer", "secondaryTransformer", "other", "powerTransformer", "voltageRegulator" + @param oilPreservationKind: Kind of oil preservation system. Values are: "other", "conservator", "freeBreathing", "nitrogenBlanket" + @param dayOverLoadRating: 24-hour overload rating. + @param coreKind: Core kind of this transformer product. Values are: "shell", "core" + @param autoTransformer: True if this is an autotransformer, false otherwise. + @param solidInsulationWeight: Weight of solid insultation in transformer. + @param TransformerAssets: + @param TransformerInfo: + """ + #: Basic Insulation Level of Neutral + self.neutralBIL = neutralBIL + + #: Kind of construction for this transformer. Values are: "dryType", "vaultThreePhase", "network", "padmounted", "padmountLoopThrough", "vault", "onePhase", "padmountFeedThrough", "aerial", "threePhase", "unknown", "overhead", "padmountDeadFront", "underground", "padmountLiveFront", "subway" + self.constructionKind = constructionKind + + #: Weight of core and coils in transformer. + self.coreCoilsWeight = coreCoilsWeight + + #: Type of insultation used for transformer windings. Values are: "thermallyUpgradedPaper", "other", "nomex", "paper" + self.windingInsulationKind = windingInsulationKind + + #: 1-hour overload rating. + self.hourOverLoadRating = hourOverLoadRating + + #: Nominal voltage rating for alternate configuration for primary winding. + self.altPrimaryNomVoltage = altPrimaryNomVoltage + + #: Nominal voltage rating for alternate configuration for secondary winding. + self.altSecondaryNomVoltage = altSecondaryNomVoltage + + #: True if windings can be re-configured to result in a different input or output voltage. + self.reconfigWinding = reconfigWinding + + #: Function of this transformer. Values are: "autotransformer", "secondaryTransformer", "other", "powerTransformer", "voltageRegulator" + self.function = function + + #: Kind of oil preservation system. Values are: "other", "conservator", "freeBreathing", "nitrogenBlanket" + self.oilPreservationKind = oilPreservationKind + + #: 24-hour overload rating. + self.dayOverLoadRating = dayOverLoadRating + + #: Core kind of this transformer product. Values are: "shell", "core" + self.coreKind = coreKind + + #: True if this is an autotransformer, false otherwise. + self.autoTransformer = autoTransformer + + #: Weight of solid insultation in transformer. + self.solidInsulationWeight = solidInsulationWeight + + self._TransformerAssets = [] + self.TransformerAssets = [] if TransformerAssets is None else TransformerAssets + + self._TransformerInfo = None + self.TransformerInfo = TransformerInfo + + super(TransformerAssetModel, self).__init__(*args, **kw_args) + + _attrs = ["neutralBIL", "constructionKind", "coreCoilsWeight", "windingInsulationKind", "hourOverLoadRating", "altPrimaryNomVoltage", "altSecondaryNomVoltage", "reconfigWinding", "function", "oilPreservationKind", "dayOverLoadRating", "coreKind", "autoTransformer", "solidInsulationWeight"] + _attr_types = {"neutralBIL": float, "constructionKind": str, "coreCoilsWeight": float, "windingInsulationKind": str, "hourOverLoadRating": float, "altPrimaryNomVoltage": float, "altSecondaryNomVoltage": float, "reconfigWinding": bool, "function": str, "oilPreservationKind": str, "dayOverLoadRating": float, "coreKind": str, "autoTransformer": bool, "solidInsulationWeight": float} + _defaults = {"neutralBIL": 0.0, "constructionKind": "dryType", "coreCoilsWeight": 0.0, "windingInsulationKind": "thermallyUpgradedPaper", "hourOverLoadRating": 0.0, "altPrimaryNomVoltage": 0.0, "altSecondaryNomVoltage": 0.0, "reconfigWinding": False, "function": "autotransformer", "oilPreservationKind": "other", "dayOverLoadRating": 0.0, "coreKind": "shell", "autoTransformer": False, "solidInsulationWeight": 0.0} + _enums = {"constructionKind": "TransformerConstructionKind", "windingInsulationKind": "WindingInsulationKind", "function": "TransformerFunctionKind", "oilPreservationKind": "OilPreservationKind", "coreKind": "TransformerCoreKind"} + _refs = ["TransformerAssets", "TransformerInfo"] + _many_refs = ["TransformerAssets"] + + def getTransformerAssets(self): + + return self._TransformerAssets + + def setTransformerAssets(self, value): + for x in self._TransformerAssets: + x.TransformerAssetModel = None + for y in value: + y._TransformerAssetModel = self + self._TransformerAssets = value + + TransformerAssets = property(getTransformerAssets, setTransformerAssets) + + def addTransformerAssets(self, *TransformerAssets): + for obj in TransformerAssets: + obj.TransformerAssetModel = self + + def removeTransformerAssets(self, *TransformerAssets): + for obj in TransformerAssets: + obj.TransformerAssetModel = None + + def getTransformerInfo(self): + + return self._TransformerInfo + + def setTransformerInfo(self, value): + if self._TransformerInfo is not None: + filtered = [x for x in self.TransformerInfo.TransformerAssetModels if x != self] + self._TransformerInfo._TransformerAssetModels = filtered + + self._TransformerInfo = value + if self._TransformerInfo is not None: + if self not in self._TransformerInfo._TransformerAssetModels: + self._TransformerInfo._TransformerAssetModels.append(self) + + TransformerInfo = property(getTransformerInfo, setTransformerInfo) + diff --git a/CIM16/IEC61970/Informative/InfAssetModels/__init__.py b/CIM16/IEC61970/Informative/InfAssetModels/__init__.py new file mode 100755 index 00000000..70a15eb9 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssetModels/__init__.py @@ -0,0 +1,53 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +from CIM16.IEC61970.Informative.InfAssetModels.AssetModelCatalogue import AssetModelCatalogue +from CIM16.IEC61970.Informative.InfAssetModels.TransformerAssetModel import TransformerAssetModel +from CIM16.IEC61970.Informative.InfAssetModels.AssetModelCatalogueItem import AssetModelCatalogueItem + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#InfAssetModels" +nsPrefix = "cimInfAssetModels" + + +class OilPreservationKind(str): + """Values are: other, conservator, freeBreathing, nitrogenBlanket + """ + pass + +class TransformerConstructionKind(str): + """Values are: dryType, vaultThreePhase, network, padmounted, padmountLoopThrough, vault, onePhase, padmountFeedThrough, aerial, threePhase, unknown, overhead, padmountDeadFront, underground, padmountLiveFront, subway + """ + pass + +class WindingInsulationKind(str): + """Values are: thermallyUpgradedPaper, other, nomex, paper + """ + pass + +class TransformerCoreKind(str): + """Values are: shell, core + """ + pass + +class TransformerFunctionKind(str): + """Values are: autotransformer, secondaryTransformer, other, powerTransformer, voltageRegulator + """ + pass diff --git a/CIM16/IEC61970/Informative/InfAssets/AssetAssetRole.py b/CIM16/IEC61970/Informative/InfAssets/AssetAssetRole.py new file mode 100755 index 00000000..70f5361a --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/AssetAssetRole.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.Role import Role + +class AssetAssetRole(Role): + """Roles played between Assets and other Assets.Roles played between Assets and other Assets. + """ + + def __init__(self, ToAsset=None, FromAsset=None, *args, **kw_args): + """Initialises a new 'AssetAssetRole' instance. + + @param ToAsset: + @param FromAsset: + """ + self._ToAsset = None + self.ToAsset = ToAsset + + self._FromAsset = None + self.FromAsset = FromAsset + + super(AssetAssetRole, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ToAsset", "FromAsset"] + _many_refs = [] + + def getToAsset(self): + + return self._ToAsset + + def setToAsset(self, value): + if self._ToAsset is not None: + filtered = [x for x in self.ToAsset.FromAssetRoles if x != self] + self._ToAsset._FromAssetRoles = filtered + + self._ToAsset = value + if self._ToAsset is not None: + if self not in self._ToAsset._FromAssetRoles: + self._ToAsset._FromAssetRoles.append(self) + + ToAsset = property(getToAsset, setToAsset) + + def getFromAsset(self): + + return self._FromAsset + + def setFromAsset(self, value): + if self._FromAsset is not None: + filtered = [x for x in self.FromAsset.ToAssetRoles if x != self] + self._FromAsset._ToAssetRoles = filtered + + self._FromAsset = value + if self._FromAsset is not None: + if self not in self._FromAsset._ToAssetRoles: + self._FromAsset._ToAssetRoles.append(self) + + FromAsset = property(getFromAsset, setFromAsset) + diff --git a/CIM16/IEC61970/Informative/InfAssets/AssetPropertyCurve.py b/CIM16/IEC61970/Informative/InfAssets/AssetPropertyCurve.py new file mode 100755 index 00000000..ec7b01e3 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/AssetPropertyCurve.py @@ -0,0 +1,90 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class AssetPropertyCurve(Curve): + """An Asset Property that is described through curves rather than as a data point. The relationship is to be defined between an independent variable (X-axis) and one or two dependent variables (Y1-axis and Y2-axis).An Asset Property that is described through curves rather than as a data point. The relationship is to be defined between an independent variable (X-axis) and one or two dependent variables (Y1-axis and Y2-axis). + """ + + def __init__(self, Specification=None, Assets=None, *args, **kw_args): + """Initialises a new 'AssetPropertyCurve' instance. + + @param Specification: + @param Assets: + """ + self._Specification = None + self.Specification = Specification + + self._Assets = [] + self.Assets = [] if Assets is None else Assets + + super(AssetPropertyCurve, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Specification", "Assets"] + _many_refs = ["Assets"] + + def getSpecification(self): + + return self._Specification + + def setSpecification(self, value): + if self._Specification is not None: + filtered = [x for x in self.Specification.AssetPropertyCurves if x != self] + self._Specification._AssetPropertyCurves = filtered + + self._Specification = value + if self._Specification is not None: + if self not in self._Specification._AssetPropertyCurves: + self._Specification._AssetPropertyCurves.append(self) + + Specification = property(getSpecification, setSpecification) + + def getAssets(self): + + return self._Assets + + def setAssets(self, value): + for p in self._Assets: + filtered = [q for q in p.AssetPropertyCurves if q != self] + self._Assets._AssetPropertyCurves = filtered + for r in value: + if self not in r._AssetPropertyCurves: + r._AssetPropertyCurves.append(self) + self._Assets = value + + Assets = property(getAssets, setAssets) + + def addAssets(self, *Assets): + for obj in Assets: + if self not in obj._AssetPropertyCurves: + obj._AssetPropertyCurves.append(self) + self._Assets.append(obj) + + def removeAssets(self, *Assets): + for obj in Assets: + if self in obj._AssetPropertyCurves: + obj._AssetPropertyCurves.remove(self) + self._Assets.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfAssets/BreakerInfo.py b/CIM16/IEC61970/Informative/InfAssets/BreakerInfo.py new file mode 100755 index 00000000..c1abd0c1 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/BreakerInfo.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfAssets.SwitchInfo import SwitchInfo + +class BreakerInfo(SwitchInfo): + """Properties of breaker assets.Properties of breaker assets. + """ + + def __init__(self, phaseTrip=0.0, *args, **kw_args): + """Initialises a new 'BreakerInfo' instance. + + @param phaseTrip: Phase trip rating. + """ + #: Phase trip rating. + self.phaseTrip = phaseTrip + + super(BreakerInfo, self).__init__(*args, **kw_args) + + _attrs = ["phaseTrip"] + _attr_types = {"phaseTrip": float} + _defaults = {"phaseTrip": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/Bushing.py b/CIM16/IEC61970/Informative/InfAssets/Bushing.py new file mode 100755 index 00000000..d80d7bbe --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/Bushing.py @@ -0,0 +1,103 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.Asset import Asset + +class Bushing(Asset): + """Bushing asset.Bushing asset. + """ + + def __init__(self, c2PowerFactor=0.0, c2Capacitance=0.0, c1PowerFactor=0.0, insulationKind="solidPorcelain", c1Capacitance=0.0, Terminal=None, BushingInsulationPFs=None, *args, **kw_args): + """Initialises a new 'Bushing' instance. + + @param c2PowerFactor: Factory measured insulation power factor, measured between the power factor tap and ground. + @param c2Capacitance: Factory measured capacitance measured between the power factor tap and ground. + @param c1PowerFactor: Factory measured insulation power factor, measured between the power factor tap and the bushing conductor. + @param insulationKind: Kind of insulation. Values are: "solidPorcelain", "compound", "other", "paperoil" + @param c1Capacitance: Factory measured capacitance, measured between the power factor tap and the bushing conductor. + @param Terminal: + @param BushingInsulationPFs: + """ + #: Factory measured insulation power factor, measured between the power factor tap and ground. + self.c2PowerFactor = c2PowerFactor + + #: Factory measured capacitance measured between the power factor tap and ground. + self.c2Capacitance = c2Capacitance + + #: Factory measured insulation power factor, measured between the power factor tap and the bushing conductor. + self.c1PowerFactor = c1PowerFactor + + #: Kind of insulation. Values are: "solidPorcelain", "compound", "other", "paperoil" + self.insulationKind = insulationKind + + #: Factory measured capacitance, measured between the power factor tap and the bushing conductor. + self.c1Capacitance = c1Capacitance + + self._Terminal = None + self.Terminal = Terminal + + self._BushingInsulationPFs = [] + self.BushingInsulationPFs = [] if BushingInsulationPFs is None else BushingInsulationPFs + + super(Bushing, self).__init__(*args, **kw_args) + + _attrs = ["c2PowerFactor", "c2Capacitance", "c1PowerFactor", "insulationKind", "c1Capacitance"] + _attr_types = {"c2PowerFactor": float, "c2Capacitance": float, "c1PowerFactor": float, "insulationKind": str, "c1Capacitance": float} + _defaults = {"c2PowerFactor": 0.0, "c2Capacitance": 0.0, "c1PowerFactor": 0.0, "insulationKind": "solidPorcelain", "c1Capacitance": 0.0} + _enums = {"insulationKind": "BushingInsulationKind"} + _refs = ["Terminal", "BushingInsulationPFs"] + _many_refs = ["BushingInsulationPFs"] + + def getTerminal(self): + + return self._Terminal + + def setTerminal(self, value): + if self._Terminal is not None: + self._Terminal._BushingInfo = None + + self._Terminal = value + if self._Terminal is not None: + self._Terminal.BushingInfo = None + self._Terminal._BushingInfo = self + + Terminal = property(getTerminal, setTerminal) + + def getBushingInsulationPFs(self): + + return self._BushingInsulationPFs + + def setBushingInsulationPFs(self, value): + for x in self._BushingInsulationPFs: + x.BushingInfo = None + for y in value: + y._BushingInfo = self + self._BushingInsulationPFs = value + + BushingInsulationPFs = property(getBushingInsulationPFs, setBushingInsulationPFs) + + def addBushingInsulationPFs(self, *BushingInsulationPFs): + for obj in BushingInsulationPFs: + obj.BushingInfo = self + + def removeBushingInsulationPFs(self, *BushingInsulationPFs): + for obj in BushingInsulationPFs: + obj.BushingInfo = None + diff --git a/CIM16/IEC61970/Informative/InfAssets/BushingInsulationPF.py b/CIM16/IEC61970/Informative/InfAssets/BushingInsulationPF.py new file mode 100755 index 00000000..bdc0eaaf --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/BushingInsulationPF.py @@ -0,0 +1,88 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class BushingInsulationPF(IdentifiedObject): + """Bushing insulation power factor condition as a result of a test. Typical status values are: Acceptable, Minor Deterioration or Moisture Absorption, Major Deterioration or Moisture Absorption, Failed.Bushing insulation power factor condition as a result of a test. Typical status values are: Acceptable, Minor Deterioration or Moisture Absorption, Major Deterioration or Moisture Absorption, Failed. + """ + + def __init__(self, testKind="c2", status=None, TransformerObservation=None, BushingInfo=None, *args, **kw_args): + """Initialises a new 'BushingInsulationPF' instance. + + @param testKind: Kind of test for this bushing. Values are: "c2", "c1" + @param status: + @param TransformerObservation: + @param BushingInfo: + """ + #: Kind of test for this bushing. Values are: "c2", "c1" + self.testKind = testKind + + self.status = status + + self._TransformerObservation = None + self.TransformerObservation = TransformerObservation + + self._BushingInfo = None + self.BushingInfo = BushingInfo + + super(BushingInsulationPF, self).__init__(*args, **kw_args) + + _attrs = ["testKind"] + _attr_types = {"testKind": str} + _defaults = {"testKind": "c2"} + _enums = {"testKind": "BushingInsulationPfTestKind"} + _refs = ["status", "TransformerObservation", "BushingInfo"] + _many_refs = [] + + status = None + + def getTransformerObservation(self): + + return self._TransformerObservation + + def setTransformerObservation(self, value): + if self._TransformerObservation is not None: + filtered = [x for x in self.TransformerObservation.BushingInsultationPFs if x != self] + self._TransformerObservation._BushingInsultationPFs = filtered + + self._TransformerObservation = value + if self._TransformerObservation is not None: + if self not in self._TransformerObservation._BushingInsultationPFs: + self._TransformerObservation._BushingInsultationPFs.append(self) + + TransformerObservation = property(getTransformerObservation, setTransformerObservation) + + def getBushingInfo(self): + + return self._BushingInfo + + def setBushingInfo(self, value): + if self._BushingInfo is not None: + filtered = [x for x in self.BushingInfo.BushingInsulationPFs if x != self] + self._BushingInfo._BushingInsulationPFs = filtered + + self._BushingInfo = value + if self._BushingInfo is not None: + if self not in self._BushingInfo._BushingInsulationPFs: + self._BushingInfo._BushingInsulationPFs.append(self) + + BushingInfo = property(getBushingInfo, setBushingInfo) + diff --git a/CIM16/IEC61970/Informative/InfAssets/Cabinet.py b/CIM16/IEC61970/Informative/InfAssets/Cabinet.py new file mode 100755 index 00000000..60945c9c --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/Cabinet.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetContainer import AssetContainer + +class Cabinet(AssetContainer): + """Enclosure that offers protection to the equipment it contains and/or safety to people/animals outside it.Enclosure that offers protection to the equipment it contains and/or safety to people/animals outside it. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Cabinet' instance. + + """ + super(Cabinet, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/ComEquipment.py b/CIM16/IEC61970/Informative/InfAssets/ComEquipment.py new file mode 100755 index 00000000..006a9141 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/ComEquipment.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.Asset import Asset + +class ComEquipment(Asset): + """Communicaiton equipment assets other than media (such as gateways, routers, controllers, etc.).Communicaiton equipment assets other than media (such as gateways, routers, controllers, etc.). + """ + + def __init__(self, EndDeviceFunctions=None, *args, **kw_args): + """Initialises a new 'ComEquipment' instance. + + @param EndDeviceFunctions: All device functions of this communication equipment. + """ + self._EndDeviceFunctions = [] + self.EndDeviceFunctions = [] if EndDeviceFunctions is None else EndDeviceFunctions + + super(ComEquipment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["EndDeviceFunctions"] + _many_refs = ["EndDeviceFunctions"] + + def getEndDeviceFunctions(self): + """All device functions of this communication equipment. + """ + return self._EndDeviceFunctions + + def setEndDeviceFunctions(self, value): + for x in self._EndDeviceFunctions: + x.ComEquipment = None + for y in value: + y._ComEquipment = self + self._EndDeviceFunctions = value + + EndDeviceFunctions = property(getEndDeviceFunctions, setEndDeviceFunctions) + + def addEndDeviceFunctions(self, *EndDeviceFunctions): + for obj in EndDeviceFunctions: + obj.ComEquipment = self + + def removeEndDeviceFunctions(self, *EndDeviceFunctions): + for obj in EndDeviceFunctions: + obj.ComEquipment = None + diff --git a/CIM16/IEC61970/Informative/InfAssets/CompositeSwitchInfo.py b/CIM16/IEC61970/Informative/InfAssets/CompositeSwitchInfo.py new file mode 100755 index 00000000..b66d6ffd --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/CompositeSwitchInfo.py @@ -0,0 +1,75 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class CompositeSwitchInfo(AssetInfo): + """Properties of a composite switch.Properties of a composite switch. + """ + + def __init__(self, kind="throwOver", phaseCode="s12N", remote=False, switchStateCount=0, ratedVoltage=0.0, ganged=False, phaseCount=0, initOpMode='', interruptingRating=0.0, *args, **kw_args): + """Initialises a new 'CompositeSwitchInfo' instance. + + @param kind: Kind of composite switch. Values are: "throwOver", "regulatorBypass", "escoThrowOver", "ral", "other", "gral", "ugMultiSwitch" + @param phaseCode: Phases carried, if applicable. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param remote: True if device is capable of being operated by remote control. + @param switchStateCount: Number of switch states represented by the composite switch. + @param ratedVoltage: Rated voltage. + @param ganged: True if multi-phase switch controls all phases concurrently. + @param phaseCount: Supported number of phases, typically 0, 1 or 3. + @param initOpMode: Initial operating mode, with the following values: Automatic, Manual. + @param interruptingRating: Breaking capacity, or short circuit rating, is the maximum rated current which the device can safely interrupt at the rated voltage. + """ + #: Kind of composite switch. Values are: "throwOver", "regulatorBypass", "escoThrowOver", "ral", "other", "gral", "ugMultiSwitch" + self.kind = kind + + #: Phases carried, if applicable. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.phaseCode = phaseCode + + #: True if device is capable of being operated by remote control. + self.remote = remote + + #: Number of switch states represented by the composite switch. + self.switchStateCount = switchStateCount + + #: Rated voltage. + self.ratedVoltage = ratedVoltage + + #: True if multi-phase switch controls all phases concurrently. + self.ganged = ganged + + #: Supported number of phases, typically 0, 1 or 3. + self.phaseCount = phaseCount + + #: Initial operating mode, with the following values: Automatic, Manual. + self.initOpMode = initOpMode + + #: Breaking capacity, or short circuit rating, is the maximum rated current which the device can safely interrupt at the rated voltage. + self.interruptingRating = interruptingRating + + super(CompositeSwitchInfo, self).__init__(*args, **kw_args) + + _attrs = ["kind", "phaseCode", "remote", "switchStateCount", "ratedVoltage", "ganged", "phaseCount", "initOpMode", "interruptingRating"] + _attr_types = {"kind": str, "phaseCode": str, "remote": bool, "switchStateCount": int, "ratedVoltage": float, "ganged": bool, "phaseCount": int, "initOpMode": str, "interruptingRating": float} + _defaults = {"kind": "throwOver", "phaseCode": "s12N", "remote": False, "switchStateCount": 0, "ratedVoltage": 0.0, "ganged": False, "phaseCount": 0, "initOpMode": '', "interruptingRating": 0.0} + _enums = {"kind": "CompositeSwitchKind", "phaseCode": "PhaseCode"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/ConductorAsset.py b/CIM16/IEC61970/Informative/InfAssets/ConductorAsset.py new file mode 100755 index 00000000..4962f9cb --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/ConductorAsset.py @@ -0,0 +1,91 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.Asset import Asset + +class ConductorAsset(Asset): + """Physical asset used to perform the conductor's role.Physical asset used to perform the conductor's role. + """ + + def __init__(self, isHorizontal=False, groundingMethod='', insulated=False, CircuitSection=None, ConductorSegment=None, *args, **kw_args): + """Initialises a new 'ConductorAsset' instance. + + @param isHorizontal: True when orientation is horizontal (e.g., transmission and distribution lines), false if vertical (e.g. a riser for underground to overhead service). + @param groundingMethod: Description of the method used for grounding the conductor. For a cable, the grounding/bonding shield may be multi-point, single-point, cross cable, or other. + @param insulated: True if conductor asset has an insulator around the core material. + @param CircuitSection: + @param ConductorSegment: + """ + #: True when orientation is horizontal (e.g., transmission and distribution lines), false if vertical (e.g. a riser for underground to overhead service). + self.isHorizontal = isHorizontal + + #: Description of the method used for grounding the conductor. For a cable, the grounding/bonding shield may be multi-point, single-point, cross cable, or other. + self.groundingMethod = groundingMethod + + #: True if conductor asset has an insulator around the core material. + self.insulated = insulated + + self._CircuitSection = None + self.CircuitSection = CircuitSection + + self._ConductorSegment = None + self.ConductorSegment = ConductorSegment + + super(ConductorAsset, self).__init__(*args, **kw_args) + + _attrs = ["isHorizontal", "groundingMethod", "insulated"] + _attr_types = {"isHorizontal": bool, "groundingMethod": str, "insulated": bool} + _defaults = {"isHorizontal": False, "groundingMethod": '', "insulated": False} + _enums = {} + _refs = ["CircuitSection", "ConductorSegment"] + _many_refs = [] + + def getCircuitSection(self): + + return self._CircuitSection + + def setCircuitSection(self, value): + if self._CircuitSection is not None: + filtered = [x for x in self.CircuitSection.ConductorAssets if x != self] + self._CircuitSection._ConductorAssets = filtered + + self._CircuitSection = value + if self._CircuitSection is not None: + if self not in self._CircuitSection._ConductorAssets: + self._CircuitSection._ConductorAssets.append(self) + + CircuitSection = property(getCircuitSection, setCircuitSection) + + def getConductorSegment(self): + + return self._ConductorSegment + + def setConductorSegment(self, value): + if self._ConductorSegment is not None: + filtered = [x for x in self.ConductorSegment.ConductorAssets if x != self] + self._ConductorSegment._ConductorAssets = filtered + + self._ConductorSegment = value + if self._ConductorSegment is not None: + if self not in self._ConductorSegment._ConductorAssets: + self._ConductorSegment._ConductorAssets.append(self) + + ConductorSegment = property(getConductorSegment, setConductorSegment) + diff --git a/CIM16/IEC61970/Informative/InfAssets/CurrentTransformerInfo.py b/CIM16/IEC61970/Informative/InfAssets/CurrentTransformerInfo.py new file mode 100755 index 00000000..40ffef8d --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/CurrentTransformerInfo.py @@ -0,0 +1,139 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class CurrentTransformerInfo(AssetInfo): + """Properties of current transformer asset.Properties of current transformer asset. + """ + + def __init__(self, tertiaryFlsRating=0.0, coreCount=0, secondaryFlsRating=0.0, usage='', accuracyClass='', ctClass='', kneePointVoltage=0.0, coreBurden=0.0, accuracyLimit=0.0, kneePointCurrent=0.0, primaryFlsRating=0.0, nominalRatio=None, secondaryRatio=None, CTs=None, tertiaryRatio=None, maxRatio=None, primaryRatio=None, *args, **kw_args): + """Initialises a new 'CurrentTransformerInfo' instance. + + @param tertiaryFlsRating: Full load secondary (FLS) rating for tertiary winding. + @param coreCount: Number of cores. + @param secondaryFlsRating: Full load secondary (FLS) rating for secondary winding. + @param usage: eg. metering, protection, etc + @param accuracyClass: CT accuracy classification + @param ctClass: + @param kneePointVoltage: Maximum voltage across the secondary terminals where the CT still displays linear characteristicts. + @param coreBurden: Power burden of the CT core + @param accuracyLimit: + @param kneePointCurrent: Maximum primary current where the CT still displays linear characteristicts. + @param primaryFlsRating: Full load secondary (FLS) rating for primary winding. + @param nominalRatio: Nominal ratio between the primary and secondary current; i.e. 100:5 + @param secondaryRatio: Ratio for the secondary winding tap changer. + @param CTs: All current transformers described by this data. + @param tertiaryRatio: Ratio for the tertiary winding tap changer. + @param maxRatio: Maximum ratio between the primary and secondary current. + @param primaryRatio: Ratio for the primary winding tap changer. + """ + #: Full load secondary (FLS) rating for tertiary winding. + self.tertiaryFlsRating = tertiaryFlsRating + + #: Number of cores. + self.coreCount = coreCount + + #: Full load secondary (FLS) rating for secondary winding. + self.secondaryFlsRating = secondaryFlsRating + + #: eg. metering, protection, etc + self.usage = usage + + #: CT accuracy classification + self.accuracyClass = accuracyClass + + + self.ctClass = ctClass + + #: Maximum voltage across the secondary terminals where the CT still displays linear characteristicts. + self.kneePointVoltage = kneePointVoltage + + #: Power burden of the CT core + self.coreBurden = coreBurden + + + self.accuracyLimit = accuracyLimit + + #: Maximum primary current where the CT still displays linear characteristicts. + self.kneePointCurrent = kneePointCurrent + + #: Full load secondary (FLS) rating for primary winding. + self.primaryFlsRating = primaryFlsRating + + self.nominalRatio = nominalRatio + + self.secondaryRatio = secondaryRatio + + self._CTs = [] + self.CTs = [] if CTs is None else CTs + + self.tertiaryRatio = tertiaryRatio + + self.maxRatio = maxRatio + + self.primaryRatio = primaryRatio + + super(CurrentTransformerInfo, self).__init__(*args, **kw_args) + + _attrs = ["tertiaryFlsRating", "coreCount", "secondaryFlsRating", "usage", "accuracyClass", "ctClass", "kneePointVoltage", "coreBurden", "accuracyLimit", "kneePointCurrent", "primaryFlsRating"] + _attr_types = {"tertiaryFlsRating": float, "coreCount": int, "secondaryFlsRating": float, "usage": str, "accuracyClass": str, "ctClass": str, "kneePointVoltage": float, "coreBurden": float, "accuracyLimit": float, "kneePointCurrent": float, "primaryFlsRating": float} + _defaults = {"tertiaryFlsRating": 0.0, "coreCount": 0, "secondaryFlsRating": 0.0, "usage": '', "accuracyClass": '', "ctClass": '', "kneePointVoltage": 0.0, "coreBurden": 0.0, "accuracyLimit": 0.0, "kneePointCurrent": 0.0, "primaryFlsRating": 0.0} + _enums = {} + _refs = ["nominalRatio", "secondaryRatio", "CTs", "tertiaryRatio", "maxRatio", "primaryRatio"] + _many_refs = ["CTs"] + + # Nominal ratio between the primary and secondary current; i.e. 100:5 + nominalRatio = None + + # Ratio for the secondary winding tap changer. + secondaryRatio = None + + def getCTs(self): + """All current transformers described by this data. + """ + return self._CTs + + def setCTs(self, value): + for x in self._CTs: + x.CTInfo = None + for y in value: + y._CTInfo = self + self._CTs = value + + CTs = property(getCTs, setCTs) + + def addCTs(self, *CTs): + for obj in CTs: + obj.CTInfo = self + + def removeCTs(self, *CTs): + for obj in CTs: + obj.CTInfo = None + + # Ratio for the tertiary winding tap changer. + tertiaryRatio = None + + # Maximum ratio between the primary and secondary current. + maxRatio = None + + # Ratio for the primary winding tap changer. + primaryRatio = None + diff --git a/CIM16/IEC61970/Informative/InfAssets/DimensionsInfo.py b/CIM16/IEC61970/Informative/InfAssets/DimensionsInfo.py new file mode 100755 index 00000000..18b2c170 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/DimensionsInfo.py @@ -0,0 +1,140 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class DimensionsInfo(IdentifiedObject): + """As applicable, the basic linear, area, or volume dimensions of an asset, asset type (AssetModel) or other type of object (such as land area). Units and multipliers are specified per dimension.As applicable, the basic linear, area, or volume dimensions of an asset, asset type (AssetModel) or other type of object (such as land area). Units and multipliers are specified per dimension. + """ + + def __init__(self, sizeWidth=0.0, sizeDiameter=0.0, sizeLength=0.0, orientation='', sizeDepth=0.0, Locations=None, AssetInfos=None, Specifications=None, *args, **kw_args): + """Initialises a new 'DimensionsInfo' instance. + + @param sizeWidth: Width measurement. + @param sizeDiameter: Diameter measurement. + @param sizeLength: Length measurement. + @param orientation: A description of the orientation of the object relative to the dimensions. As an example, a vault may have north-south orientation for the sizeLength measurement and sizeDepth may be the height of the vault. + @param sizeDepth: Depth measurement. + @param Locations: + @param AssetInfos: + @param Specifications: + """ + #: Width measurement. + self.sizeWidth = sizeWidth + + #: Diameter measurement. + self.sizeDiameter = sizeDiameter + + #: Length measurement. + self.sizeLength = sizeLength + + #: A description of the orientation of the object relative to the dimensions. As an example, a vault may have north-south orientation for the sizeLength measurement and sizeDepth may be the height of the vault. + self.orientation = orientation + + #: Depth measurement. + self.sizeDepth = sizeDepth + + self._Locations = [] + self.Locations = [] if Locations is None else Locations + + self._AssetInfos = [] + self.AssetInfos = [] if AssetInfos is None else AssetInfos + + self._Specifications = [] + self.Specifications = [] if Specifications is None else Specifications + + super(DimensionsInfo, self).__init__(*args, **kw_args) + + _attrs = ["sizeWidth", "sizeDiameter", "sizeLength", "orientation", "sizeDepth"] + _attr_types = {"sizeWidth": float, "sizeDiameter": float, "sizeLength": float, "orientation": str, "sizeDepth": float} + _defaults = {"sizeWidth": 0.0, "sizeDiameter": 0.0, "sizeLength": 0.0, "orientation": '', "sizeDepth": 0.0} + _enums = {} + _refs = ["Locations", "AssetInfos", "Specifications"] + _many_refs = ["Locations", "AssetInfos", "Specifications"] + + def getLocations(self): + + return self._Locations + + def setLocations(self, value): + for x in self._Locations: + x.DimensionsInfo = None + for y in value: + y._DimensionsInfo = self + self._Locations = value + + Locations = property(getLocations, setLocations) + + def addLocations(self, *Locations): + for obj in Locations: + obj.DimensionsInfo = self + + def removeLocations(self, *Locations): + for obj in Locations: + obj.DimensionsInfo = None + + def getAssetInfos(self): + + return self._AssetInfos + + def setAssetInfos(self, value): + for x in self._AssetInfos: + x.DimensionsInfo = None + for y in value: + y._DimensionsInfo = self + self._AssetInfos = value + + AssetInfos = property(getAssetInfos, setAssetInfos) + + def addAssetInfos(self, *AssetInfos): + for obj in AssetInfos: + obj.DimensionsInfo = self + + def removeAssetInfos(self, *AssetInfos): + for obj in AssetInfos: + obj.DimensionsInfo = None + + def getSpecifications(self): + + return self._Specifications + + def setSpecifications(self, value): + for p in self._Specifications: + filtered = [q for q in p.DimensionsInfos if q != self] + self._Specifications._DimensionsInfos = filtered + for r in value: + if self not in r._DimensionsInfos: + r._DimensionsInfos.append(self) + self._Specifications = value + + Specifications = property(getSpecifications, setSpecifications) + + def addSpecifications(self, *Specifications): + for obj in Specifications: + if self not in obj._DimensionsInfos: + obj._DimensionsInfos.append(self) + self._Specifications.append(obj) + + def removeSpecifications(self, *Specifications): + for obj in Specifications: + if self in obj._DimensionsInfos: + obj._DimensionsInfos.remove(self) + self._Specifications.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfAssets/DocAssetRole.py b/CIM16/IEC61970/Informative/InfAssets/DocAssetRole.py new file mode 100755 index 00000000..009ba823 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/DocAssetRole.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.Role import Role + +class DocAssetRole(Role): + """Roles played between Documents and Assets.Roles played between Documents and Assets. + """ + + def __init__(self, Document=None, Asset=None, *args, **kw_args): + """Initialises a new 'DocAssetRole' instance. + + @param Document: + @param Asset: + """ + self._Document = None + self.Document = Document + + self._Asset = None + self.Asset = Asset + + super(DocAssetRole, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Document", "Asset"] + _many_refs = [] + + def getDocument(self): + + return self._Document + + def setDocument(self, value): + if self._Document is not None: + filtered = [x for x in self.Document.AssetRoles if x != self] + self._Document._AssetRoles = filtered + + self._Document = value + if self._Document is not None: + if self not in self._Document._AssetRoles: + self._Document._AssetRoles.append(self) + + Document = property(getDocument, setDocument) + + def getAsset(self): + + return self._Asset + + def setAsset(self, value): + if self._Asset is not None: + filtered = [x for x in self.Asset.DocumentRoles if x != self] + self._Asset._DocumentRoles = filtered + + self._Asset = value + if self._Asset is not None: + if self not in self._Asset._DocumentRoles: + self._Asset._DocumentRoles.append(self) + + Asset = property(getAsset, setAsset) + diff --git a/CIM16/IEC61970/Informative/InfAssets/Duct.py b/CIM16/IEC61970/Informative/InfAssets/Duct.py new file mode 100755 index 00000000..152c95db --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/Duct.py @@ -0,0 +1,92 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetContainer import AssetContainer + +class Duct(AssetContainer): + """A Duct contains underground cables and is contained within a duct bank. The xCoord and yCoord attributes define its positioning within the DuctBank.A Duct contains underground cables and is contained within a duct bank. The xCoord and yCoord attributes define its positioning within the DuctBank. + """ + + def __init__(self, xCoord=0, yCoord=0, DuctBankInfo=None, CableInfos=None, *args, **kw_args): + """Initialises a new 'Duct' instance. + + @param xCoord: X position of the duct within the duct bank. + @param yCoord: Y position of the duct within the duct bank. + @param DuctBankInfo: + @param CableInfos: + """ + #: X position of the duct within the duct bank. + self.xCoord = xCoord + + #: Y position of the duct within the duct bank. + self.yCoord = yCoord + + self._DuctBankInfo = None + self.DuctBankInfo = DuctBankInfo + + self._CableInfos = [] + self.CableInfos = [] if CableInfos is None else CableInfos + + super(Duct, self).__init__(*args, **kw_args) + + _attrs = ["xCoord", "yCoord"] + _attr_types = {"xCoord": int, "yCoord": int} + _defaults = {"xCoord": 0, "yCoord": 0} + _enums = {} + _refs = ["DuctBankInfo", "CableInfos"] + _many_refs = ["CableInfos"] + + def getDuctBankInfo(self): + + return self._DuctBankInfo + + def setDuctBankInfo(self, value): + if self._DuctBankInfo is not None: + filtered = [x for x in self.DuctBankInfo.DuctInfos if x != self] + self._DuctBankInfo._DuctInfos = filtered + + self._DuctBankInfo = value + if self._DuctBankInfo is not None: + if self not in self._DuctBankInfo._DuctInfos: + self._DuctBankInfo._DuctInfos.append(self) + + DuctBankInfo = property(getDuctBankInfo, setDuctBankInfo) + + def getCableInfos(self): + + return self._CableInfos + + def setCableInfos(self, value): + for x in self._CableInfos: + x.DuctBankInfo = None + for y in value: + y._DuctBankInfo = self + self._CableInfos = value + + CableInfos = property(getCableInfos, setCableInfos) + + def addCableInfos(self, *CableInfos): + for obj in CableInfos: + obj.DuctBankInfo = self + + def removeCableInfos(self, *CableInfos): + for obj in CableInfos: + obj.DuctBankInfo = None + diff --git a/CIM16/IEC61970/Informative/InfAssets/DuctBank.py b/CIM16/IEC61970/Informative/InfAssets/DuctBank.py new file mode 100755 index 00000000..53921ff6 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/DuctBank.py @@ -0,0 +1,68 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetContainer import AssetContainer + +class DuctBank(AssetContainer): + """A duct bank may contain many ducts. Each duct contains individual lines that are expressed as conductor assets (thereby describing each line's physical asset characteristics), which are each associated with ACLineSegments and other classes describing their electrical characteristics.A duct bank may contain many ducts. Each duct contains individual lines that are expressed as conductor assets (thereby describing each line's physical asset characteristics), which are each associated with ACLineSegments and other classes describing their electrical characteristics. + """ + + def __init__(self, circuitCount=0, DuctInfos=None, *args, **kw_args): + """Initialises a new 'DuctBank' instance. + + @param circuitCount: Number of circuits in duct bank. Refer to associations between a duct (ConductorAsset) and an ACLineSegment to understand which circuits are in which ducts. + @param DuctInfos: + """ + #: Number of circuits in duct bank. Refer to associations between a duct (ConductorAsset) and an ACLineSegment to understand which circuits are in which ducts. + self.circuitCount = circuitCount + + self._DuctInfos = [] + self.DuctInfos = [] if DuctInfos is None else DuctInfos + + super(DuctBank, self).__init__(*args, **kw_args) + + _attrs = ["circuitCount"] + _attr_types = {"circuitCount": int} + _defaults = {"circuitCount": 0} + _enums = {} + _refs = ["DuctInfos"] + _many_refs = ["DuctInfos"] + + def getDuctInfos(self): + + return self._DuctInfos + + def setDuctInfos(self, value): + for x in self._DuctInfos: + x.DuctBankInfo = None + for y in value: + y._DuctBankInfo = self + self._DuctInfos = value + + DuctInfos = property(getDuctInfos, setDuctInfos) + + def addDuctInfos(self, *DuctInfos): + for obj in DuctInfos: + obj.DuctBankInfo = self + + def removeDuctInfos(self, *DuctInfos): + for obj in DuctInfos: + obj.DuctBankInfo = None + diff --git a/CIM16/IEC61970/Informative/InfAssets/ElectricalInfo.py b/CIM16/IEC61970/Informative/InfAssets/ElectricalInfo.py new file mode 100755 index 00000000..951e6341 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/ElectricalInfo.py @@ -0,0 +1,107 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class ElectricalInfo(AssetInfo): + """Electrical properties of an asset or of an asset model (product by a manufacturer). Can also be used to define electrical properties for each phase individually. Not every attribute will be required for each type of asset or asset model. For example, a transformer may only have requirements for 'ratedVoltage', 'ratedApparentPower' and 'phaseCount' attributes, while a conductor will have 'r', 'x', 'b' and 'g' requirements per unit length on top of a 'ratedCurrent' and 'ratedVoltage'.Electrical properties of an asset or of an asset model (product by a manufacturer). Can also be used to define electrical properties for each phase individually. Not every attribute will be required for each type of asset or asset model. For example, a transformer may only have requirements for 'ratedVoltage', 'ratedApparentPower' and 'phaseCount' attributes, while a conductor will have 'r', 'x', 'b' and 'g' requirements per unit length on top of a 'ratedCurrent' and 'ratedVoltage'. + """ + + def __init__(self, phaseCount=0, ratedApparentPower=0.0, phaseCode="s12N", frequency=0.0, r0=0.0, r=0.0, bil=0.0, x0=0.0, x=0.0, ratedCurrent=0.0, wireCount=0, b0=0.0, b=0.0, ratedVoltage=0.0, g=0.0, g0=0.0, isConnected=False, *args, **kw_args): + """Initialises a new 'ElectricalInfo' instance. + + @param phaseCount: Number of potential phases the asset supports, typically 0, 1 or 3. The actual phases connected are determined from 'ConductingEquipment.phases' attribute in the ConductingEquipment subclass associated with the asset or from 'ElectricalAsset.phaseCode' attribute. + @param ratedApparentPower: Rated apparent power. + @param phaseCode: If 'isConnected' is true, then this is the as-built phase(s) that the asset is associatied with. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param frequency: Frequency at which stated device ratings apply, typically 50 Hz or 60 Hz. + @param r0: Zero sequence series resistance. + @param r: Positive sequence series resistance. + @param bil: Basic Insulation Level (BIL) for switchgear, insulators, etc. A reference insulation level expressed as the impulse crest voltage of a nominal wave, typically 1,2 x 50 microsecond. This is a measure of the ability of the insulation to withstand very high voltage surges. + @param x0: Zero sequence series reactance. + @param x: Positive sequence series reactance. + @param ratedCurrent: Rated current. + @param wireCount: For an installed asset, this is the total number of electrical wires that are physically connected to it. For an AssetModel, this is the total number of wires that can potentially be connected to this asset type. This is particularly useful to understand overall electrical configurations for distribution secondary where the number of wires can not be derived from phase information alone. For example, 120v 2 Wires; 240v 2 Wires; 480v 1Ph 2 Wires; 120/240v 1Ph; 120/208v 3Ph Y; 120/208v 1Ph Y; 120/240v 3Ph D; 240/480v 1Ph 3 Wires; 480v 3Ph D; 240/480v 3Ph D; 277/480v 3Ph Y. + @param b0: Zero sequence susceptance. + @param b: Positive sequence susceptance. + @param ratedVoltage: Rated voltage. + @param g: Positive sequence conductance. + @param g0: Zero sequence conductance. + @param isConnected: True if the asset is physically connected to electrical network (as opposed to being in a warehouse, being refurbished, etc.). Note that this attribute is not intended to imply energization status and/or whether the asset is actually being used. + """ + #: Number of potential phases the asset supports, typically 0, 1 or 3. The actual phases connected are determined from 'ConductingEquipment.phases' attribute in the ConductingEquipment subclass associated with the asset or from 'ElectricalAsset.phaseCode' attribute. + self.phaseCount = phaseCount + + #: Rated apparent power. + self.ratedApparentPower = ratedApparentPower + + #: If 'isConnected' is true, then this is the as-built phase(s) that the asset is associatied with. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.phaseCode = phaseCode + + #: Frequency at which stated device ratings apply, typically 50 Hz or 60 Hz. + self.frequency = frequency + + #: Zero sequence series resistance. + self.r0 = r0 + + #: Positive sequence series resistance. + self.r = r + + #: Basic Insulation Level (BIL) for switchgear, insulators, etc. A reference insulation level expressed as the impulse crest voltage of a nominal wave, typically 1,2 x 50 microsecond. This is a measure of the ability of the insulation to withstand very high voltage surges. + self.bil = bil + + #: Zero sequence series reactance. + self.x0 = x0 + + #: Positive sequence series reactance. + self.x = x + + #: Rated current. + self.ratedCurrent = ratedCurrent + + #: For an installed asset, this is the total number of electrical wires that are physically connected to it. For an AssetModel, this is the total number of wires that can potentially be connected to this asset type. This is particularly useful to understand overall electrical configurations for distribution secondary where the number of wires can not be derived from phase information alone. For example, 120v 2 Wires; 240v 2 Wires; 480v 1Ph 2 Wires; 120/240v 1Ph; 120/208v 3Ph Y; 120/208v 1Ph Y; 120/240v 3Ph D; 240/480v 1Ph 3 Wires; 480v 3Ph D; 240/480v 3Ph D; 277/480v 3Ph Y. + self.wireCount = wireCount + + #: Zero sequence susceptance. + self.b0 = b0 + + #: Positive sequence susceptance. + self.b = b + + #: Rated voltage. + self.ratedVoltage = ratedVoltage + + #: Positive sequence conductance. + self.g = g + + #: Zero sequence conductance. + self.g0 = g0 + + #: True if the asset is physically connected to electrical network (as opposed to being in a warehouse, being refurbished, etc.). Note that this attribute is not intended to imply energization status and/or whether the asset is actually being used. + self.isConnected = isConnected + + super(ElectricalInfo, self).__init__(*args, **kw_args) + + _attrs = ["phaseCount", "ratedApparentPower", "phaseCode", "frequency", "r0", "r", "bil", "x0", "x", "ratedCurrent", "wireCount", "b0", "b", "ratedVoltage", "g", "g0", "isConnected"] + _attr_types = {"phaseCount": int, "ratedApparentPower": float, "phaseCode": str, "frequency": float, "r0": float, "r": float, "bil": float, "x0": float, "x": float, "ratedCurrent": float, "wireCount": int, "b0": float, "b": float, "ratedVoltage": float, "g": float, "g0": float, "isConnected": bool} + _defaults = {"phaseCount": 0, "ratedApparentPower": 0.0, "phaseCode": "s12N", "frequency": 0.0, "r0": 0.0, "r": 0.0, "bil": 0.0, "x0": 0.0, "x": 0.0, "ratedCurrent": 0.0, "wireCount": 0, "b0": 0.0, "b": 0.0, "ratedVoltage": 0.0, "g": 0.0, "g0": 0.0, "isConnected": False} + _enums = {"phaseCode": "PhaseCode"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/FACTSDevice.py b/CIM16/IEC61970/Informative/InfAssets/FACTSDevice.py new file mode 100755 index 00000000..e86e1a0b --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/FACTSDevice.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.Asset import Asset + +class FACTSDevice(Asset): + """FACTS device asset.FACTS device asset. + """ + + def __init__(self, kind="tcpar", *args, **kw_args): + """Initialises a new 'FACTSDevice' instance. + + @param kind: Kind of FACTS device. Values are: "tcpar", "tssc", "tsbr", "svc", "tcsc", "tcvl", "statcom", "upfc" + """ + #: Kind of FACTS device. Values are: "tcpar", "tssc", "tsbr", "svc", "tcsc", "tcvl", "statcom", "upfc" + self.kind = kind + + super(FACTSDevice, self).__init__(*args, **kw_args) + + _attrs = ["kind"] + _attr_types = {"kind": str} + _defaults = {"kind": "tcpar"} + _enums = {"kind": "FACTSDeviceKind"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/Facility.py b/CIM16/IEC61970/Informative/InfAssets/Facility.py new file mode 100755 index 00000000..2824ac1a --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/Facility.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetContainer import AssetContainer + +class Facility(AssetContainer): + """A facility may contain buildings, storage facilities, switching facilities, power generation, manufacturing facilities, maintenance facilities, etc.A facility may contain buildings, storage facilities, switching facilities, power generation, manufacturing facilities, maintenance facilities, etc. + """ + + def __init__(self, kind='', *args, **kw_args): + """Initialises a new 'Facility' instance. + + @param kind: Kind of this facility. + """ + #: Kind of this facility. + self.kind = kind + + super(Facility, self).__init__(*args, **kw_args) + + _attrs = ["kind"] + _attr_types = {"kind": str} + _defaults = {"kind": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/FailureEvent.py b/CIM16/IEC61970/Informative/InfAssets/FailureEvent.py new file mode 100755 index 00000000..f16007a8 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/FailureEvent.py @@ -0,0 +1,55 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.ActivityRecord import ActivityRecord + +class FailureEvent(ActivityRecord): + """An event where an asset has failed to perform its functions within specified parameters.An event where an asset has failed to perform its functions within specified parameters. + """ + + def __init__(self, failureIsolationMethod="fuse", corporateCode='', faultLocatingMethod='', location='', *args, **kw_args): + """Initialises a new 'FailureEvent' instance. + + @param failureIsolationMethod: How the asset failure was isolated from the system. Values are: "fuse", "manuallyIsolated", "breakerOperation", "other", "burnedInTheClear" + @param corporateCode: Code for asset failure. + @param faultLocatingMethod: The method used for locating the faulted part of the asset. For example, cable options include: Cap Discharge-Thumping, Bridge Method, Visual Inspection, Other. + @param location: Failure location on an object. + """ + #: How the asset failure was isolated from the system. Values are: "fuse", "manuallyIsolated", "breakerOperation", "other", "burnedInTheClear" + self.failureIsolationMethod = failureIsolationMethod + + #: Code for asset failure. + self.corporateCode = corporateCode + + #: The method used for locating the faulted part of the asset. For example, cable options include: Cap Discharge-Thumping, Bridge Method, Visual Inspection, Other. + self.faultLocatingMethod = faultLocatingMethod + + #: Failure location on an object. + self.location = location + + super(FailureEvent, self).__init__(*args, **kw_args) + + _attrs = ["failureIsolationMethod", "corporateCode", "faultLocatingMethod", "location"] + _attr_types = {"failureIsolationMethod": str, "corporateCode": str, "faultLocatingMethod": str, "location": str} + _defaults = {"failureIsolationMethod": "fuse", "corporateCode": '', "faultLocatingMethod": '', "location": ''} + _enums = {"failureIsolationMethod": "FailureIsolationMethodKind"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/FaultIndicatorInfo.py b/CIM16/IEC61970/Informative/InfAssets/FaultIndicatorInfo.py new file mode 100755 index 00000000..404e9dd8 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/FaultIndicatorInfo.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class FaultIndicatorInfo(AssetInfo): + """Parameters of fault indicator asset.Parameters of fault indicator asset. + """ + + def __init__(self, resetKind="automatic", FaultIndicators=None, *args, **kw_args): + """Initialises a new 'FaultIndicatorInfo' instance. + + @param resetKind: Kind of reset mechanisim of this fault indicator. Values are: "automatic", "other", "remote", "manual" + @param FaultIndicators: All fault indicators described by this data. + """ + #: Kind of reset mechanisim of this fault indicator. Values are: "automatic", "other", "remote", "manual" + self.resetKind = resetKind + + self._FaultIndicators = [] + self.FaultIndicators = [] if FaultIndicators is None else FaultIndicators + + super(FaultIndicatorInfo, self).__init__(*args, **kw_args) + + _attrs = ["resetKind"] + _attr_types = {"resetKind": str} + _defaults = {"resetKind": "automatic"} + _enums = {"resetKind": "FaultIndicatorResetKind"} + _refs = ["FaultIndicators"] + _many_refs = ["FaultIndicators"] + + def getFaultIndicators(self): + """All fault indicators described by this data. + """ + return self._FaultIndicators + + def setFaultIndicators(self, value): + for x in self._FaultIndicators: + x.FaultIndicatorInfo = None + for y in value: + y._FaultIndicatorInfo = self + self._FaultIndicators = value + + FaultIndicators = property(getFaultIndicators, setFaultIndicators) + + def addFaultIndicators(self, *FaultIndicators): + for obj in FaultIndicators: + obj.FaultIndicatorInfo = self + + def removeFaultIndicators(self, *FaultIndicators): + for obj in FaultIndicators: + obj.FaultIndicatorInfo = None + diff --git a/CIM16/IEC61970/Informative/InfAssets/FinancialInfo.py b/CIM16/IEC61970/Informative/InfAssets/FinancialInfo.py new file mode 100755 index 00000000..ee2b57be --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/FinancialInfo.py @@ -0,0 +1,102 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class FinancialInfo(IdentifiedObject): + """Various current financial properties associated with a particular asset. Historical properties may be determined by ActivityRecords associated with the asset.Various current financial properties associated with a particular asset. Historical properties may be determined by ActivityRecords associated with the asset. + """ + + def __init__(self, warrantyEndDateTime='', costDescription='', purchaseDateTime='', account='', financialValue=0.0, purchaseOrderNumber='', plantTransferDateTime='', quantity="", valueDateTime='', costType='', actualPurchaseCost=0.0, Asset=None, *args, **kw_args): + """Initialises a new 'FinancialInfo' instance. + + @param warrantyEndDateTime: Date and time warranty on asset expires. + @param costDescription: Description of the cost. + @param purchaseDateTime: Date and time asset was purchased. + @param account: The account to which this actual material item is charged. + @param financialValue: Value of asset as of 'valueDateTime'. + @param purchaseOrderNumber: Purchase order identifier. + @param plantTransferDateTime: Date and time asset's financial value was put in plant for regulatory accounting purposes (e.g., for rate base calculations). This is sometime referred to as the 'in-service date.' + @param quantity: The quantity of the asset if per unit length, for example conductor. + @param valueDateTime: Date and time at which the financial value was last established. + @param costType: Category of cost to which this Material Item belongs. + @param actualPurchaseCost: The actual purchase cost of this particular asset. + @param Asset: + """ + #: Date and time warranty on asset expires. + self.warrantyEndDateTime = warrantyEndDateTime + + #: Description of the cost. + self.costDescription = costDescription + + #: Date and time asset was purchased. + self.purchaseDateTime = purchaseDateTime + + #: The account to which this actual material item is charged. + self.account = account + + #: Value of asset as of 'valueDateTime'. + self.financialValue = financialValue + + #: Purchase order identifier. + self.purchaseOrderNumber = purchaseOrderNumber + + #: Date and time asset's financial value was put in plant for regulatory accounting purposes (e.g., for rate base calculations). This is sometime referred to as the 'in-service date.' + self.plantTransferDateTime = plantTransferDateTime + + #: The quantity of the asset if per unit length, for example conductor. + self.quantity = quantity + + #: Date and time at which the financial value was last established. + self.valueDateTime = valueDateTime + + #: Category of cost to which this Material Item belongs. + self.costType = costType + + #: The actual purchase cost of this particular asset. + self.actualPurchaseCost = actualPurchaseCost + + self._Asset = None + self.Asset = Asset + + super(FinancialInfo, self).__init__(*args, **kw_args) + + _attrs = ["warrantyEndDateTime", "costDescription", "purchaseDateTime", "account", "financialValue", "purchaseOrderNumber", "plantTransferDateTime", "quantity", "valueDateTime", "costType", "actualPurchaseCost"] + _attr_types = {"warrantyEndDateTime": str, "costDescription": str, "purchaseDateTime": str, "account": str, "financialValue": float, "purchaseOrderNumber": str, "plantTransferDateTime": str, "quantity": str, "valueDateTime": str, "costType": str, "actualPurchaseCost": float} + _defaults = {"warrantyEndDateTime": '', "costDescription": '', "purchaseDateTime": '', "account": '', "financialValue": 0.0, "purchaseOrderNumber": '', "plantTransferDateTime": '', "quantity": "", "valueDateTime": '', "costType": '', "actualPurchaseCost": 0.0} + _enums = {} + _refs = ["Asset"] + _many_refs = [] + + def getAsset(self): + + return self._Asset + + def setAsset(self, value): + if self._Asset is not None: + self._Asset._FinancialInfo = None + + self._Asset = value + if self._Asset is not None: + self._Asset.FinancialInfo = None + self._Asset._FinancialInfo = self + + Asset = property(getAsset, setAsset) + diff --git a/CIM16/IEC61970/Informative/InfAssets/GenericAssetModelOrMaterial.py b/CIM16/IEC61970/Informative/InfAssets/GenericAssetModelOrMaterial.py new file mode 100755 index 00000000..2209fa47 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/GenericAssetModelOrMaterial.py @@ -0,0 +1,210 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetModel import AssetModel + +class GenericAssetModelOrMaterial(AssetModel): + """Generic asset or material item that may be used for planning, work or design purposes.Generic asset or material item that may be used for planning, work or design purposes. + """ + + def __init__(self, estimatedUnitCost=0.0, stockItem=False, quantity='', ErpReqLineItems=None, ProductAssetModels=None, ErpInventoryIssues=None, CUWorkEquipmentAsset=None, TypeAssetCatalogue=None, CUAsset=None, ErpBomItemDatas=None, *args, **kw_args): + """Initialises a new 'GenericAssetModelOrMaterial' instance. + + @param estimatedUnitCost: Estimated unit cost (or cost per unit length) of this type of asset. It does not include labor to install/construct or configure it. + @param stockItem: True if item is a stock item (default). + @param quantity: The value, unit of measure, and multiplier for the quantity. + @param ErpReqLineItems: + @param ProductAssetModels: All product asset models satisfying this generic asset model. + @param ErpInventoryIssues: + @param CUWorkEquipmentAsset: + @param TypeAssetCatalogue: + @param CUAsset: + @param ErpBomItemDatas: + """ + #: Estimated unit cost (or cost per unit length) of this type of asset. It does not include labor to install/construct or configure it. + self.estimatedUnitCost = estimatedUnitCost + + #: True if item is a stock item (default). + self.stockItem = stockItem + + #: The value, unit of measure, and multiplier for the quantity. + self.quantity = quantity + + self._ErpReqLineItems = [] + self.ErpReqLineItems = [] if ErpReqLineItems is None else ErpReqLineItems + + self._ProductAssetModels = [] + self.ProductAssetModels = [] if ProductAssetModels is None else ProductAssetModels + + self._ErpInventoryIssues = [] + self.ErpInventoryIssues = [] if ErpInventoryIssues is None else ErpInventoryIssues + + self._CUWorkEquipmentAsset = None + self.CUWorkEquipmentAsset = CUWorkEquipmentAsset + + self._TypeAssetCatalogue = None + self.TypeAssetCatalogue = TypeAssetCatalogue + + self._CUAsset = None + self.CUAsset = CUAsset + + self._ErpBomItemDatas = [] + self.ErpBomItemDatas = [] if ErpBomItemDatas is None else ErpBomItemDatas + + super(GenericAssetModelOrMaterial, self).__init__(*args, **kw_args) + + _attrs = ["estimatedUnitCost", "stockItem", "quantity"] + _attr_types = {"estimatedUnitCost": float, "stockItem": bool, "quantity": str} + _defaults = {"estimatedUnitCost": 0.0, "stockItem": False, "quantity": ''} + _enums = {} + _refs = ["ErpReqLineItems", "ProductAssetModels", "ErpInventoryIssues", "CUWorkEquipmentAsset", "TypeAssetCatalogue", "CUAsset", "ErpBomItemDatas"] + _many_refs = ["ErpReqLineItems", "ProductAssetModels", "ErpInventoryIssues", "ErpBomItemDatas"] + + def getErpReqLineItems(self): + + return self._ErpReqLineItems + + def setErpReqLineItems(self, value): + for x in self._ErpReqLineItems: + x.TypeAsset = None + for y in value: + y._TypeAsset = self + self._ErpReqLineItems = value + + ErpReqLineItems = property(getErpReqLineItems, setErpReqLineItems) + + def addErpReqLineItems(self, *ErpReqLineItems): + for obj in ErpReqLineItems: + obj.TypeAsset = self + + def removeErpReqLineItems(self, *ErpReqLineItems): + for obj in ErpReqLineItems: + obj.TypeAsset = None + + def getProductAssetModels(self): + """All product asset models satisfying this generic asset model. + """ + return self._ProductAssetModels + + def setProductAssetModels(self, value): + for x in self._ProductAssetModels: + x.GenericAssetModelOrMaterial = None + for y in value: + y._GenericAssetModelOrMaterial = self + self._ProductAssetModels = value + + ProductAssetModels = property(getProductAssetModels, setProductAssetModels) + + def addProductAssetModels(self, *ProductAssetModels): + for obj in ProductAssetModels: + obj.GenericAssetModelOrMaterial = self + + def removeProductAssetModels(self, *ProductAssetModels): + for obj in ProductAssetModels: + obj.GenericAssetModelOrMaterial = None + + def getErpInventoryIssues(self): + + return self._ErpInventoryIssues + + def setErpInventoryIssues(self, value): + for x in self._ErpInventoryIssues: + x.TypeAsset = None + for y in value: + y._TypeAsset = self + self._ErpInventoryIssues = value + + ErpInventoryIssues = property(getErpInventoryIssues, setErpInventoryIssues) + + def addErpInventoryIssues(self, *ErpInventoryIssues): + for obj in ErpInventoryIssues: + obj.TypeAsset = self + + def removeErpInventoryIssues(self, *ErpInventoryIssues): + for obj in ErpInventoryIssues: + obj.TypeAsset = None + + def getCUWorkEquipmentAsset(self): + + return self._CUWorkEquipmentAsset + + def setCUWorkEquipmentAsset(self, value): + if self._CUWorkEquipmentAsset is not None: + self._CUWorkEquipmentAsset._TypeAsset = None + + self._CUWorkEquipmentAsset = value + if self._CUWorkEquipmentAsset is not None: + self._CUWorkEquipmentAsset.TypeAsset = None + self._CUWorkEquipmentAsset._TypeAsset = self + + CUWorkEquipmentAsset = property(getCUWorkEquipmentAsset, setCUWorkEquipmentAsset) + + def getTypeAssetCatalogue(self): + + return self._TypeAssetCatalogue + + def setTypeAssetCatalogue(self, value): + if self._TypeAssetCatalogue is not None: + filtered = [x for x in self.TypeAssetCatalogue.TypeAssets if x != self] + self._TypeAssetCatalogue._TypeAssets = filtered + + self._TypeAssetCatalogue = value + if self._TypeAssetCatalogue is not None: + if self not in self._TypeAssetCatalogue._TypeAssets: + self._TypeAssetCatalogue._TypeAssets.append(self) + + TypeAssetCatalogue = property(getTypeAssetCatalogue, setTypeAssetCatalogue) + + def getCUAsset(self): + + return self._CUAsset + + def setCUAsset(self, value): + if self._CUAsset is not None: + self._CUAsset._TypeAsset = None + + self._CUAsset = value + if self._CUAsset is not None: + self._CUAsset.TypeAsset = None + self._CUAsset._TypeAsset = self + + CUAsset = property(getCUAsset, setCUAsset) + + def getErpBomItemDatas(self): + + return self._ErpBomItemDatas + + def setErpBomItemDatas(self, value): + for x in self._ErpBomItemDatas: + x.TypeAsset = None + for y in value: + y._TypeAsset = self + self._ErpBomItemDatas = value + + ErpBomItemDatas = property(getErpBomItemDatas, setErpBomItemDatas) + + def addErpBomItemDatas(self, *ErpBomItemDatas): + for obj in ErpBomItemDatas: + obj.TypeAsset = self + + def removeErpBomItemDatas(self, *ErpBomItemDatas): + for obj in ErpBomItemDatas: + obj.TypeAsset = None + diff --git a/CIM16/IEC61970/Informative/InfAssets/Joint.py b/CIM16/IEC61970/Informative/InfAssets/Joint.py new file mode 100755 index 00000000..4e877569 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/Joint.py @@ -0,0 +1,51 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.Asset import Asset + +class Joint(Asset): + """Joint connects two or more cables. It includes the portion of cable under wipes, welds, or other seals.Joint connects two or more cables. It includes the portion of cable under wipes, welds, or other seals. + """ + + def __init__(self, insulation='', fillKind="epoxy", configurationKind="other", *args, **kw_args): + """Initialises a new 'Joint' instance. + + @param insulation: The type of insulation around the joint, classified according to the utility's asset management standards and practices. + @param fillKind: Material used to fill the joint. Values are: "epoxy", "noFillPrefab", "airNoFilling", "other", "asphaltic", "insoluseal", "oil", "noVoid", "petrolatum", "bluefill254" + @param configurationKind: Configuration of joint. Values are: "other", "wires2to1", "wires3to1", "wires1to1" + """ + #: The type of insulation around the joint, classified according to the utility's asset management standards and practices. + self.insulation = insulation + + #: Material used to fill the joint. Values are: "epoxy", "noFillPrefab", "airNoFilling", "other", "asphaltic", "insoluseal", "oil", "noVoid", "petrolatum", "bluefill254" + self.fillKind = fillKind + + #: Configuration of joint. Values are: "other", "wires2to1", "wires3to1", "wires1to1" + self.configurationKind = configurationKind + + super(Joint, self).__init__(*args, **kw_args) + + _attrs = ["insulation", "fillKind", "configurationKind"] + _attr_types = {"insulation": str, "fillKind": str, "configurationKind": str} + _defaults = {"insulation": '', "fillKind": "epoxy", "configurationKind": "other"} + _enums = {"fillKind": "JointFillKind", "configurationKind": "JointConfigurationKind"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/Medium.py b/CIM16/IEC61970/Informative/InfAssets/Medium.py new file mode 100755 index 00000000..454dd6ec --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/Medium.py @@ -0,0 +1,98 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Medium(IdentifiedObject): + """A substance that either (1) provides the means of transmission of a force or effect, such as hydraulic fluid, or (2) is used for a surrounding or enveloping substance, such as oil in a transformer or circuit breaker.A substance that either (1) provides the means of transmission of a force or effect, such as hydraulic fluid, or (2) is used for a surrounding or enveloping substance, such as oil in a transformer or circuit breaker. + """ + + def __init__(self, kind="gas", volumeSpec=0.0, Specification=None, Assets=None, *args, **kw_args): + """Initialises a new 'Medium' instance. + + @param kind: Kind of this medium. Values are: "gas", "liquid", "solid" + @param volumeSpec: The volume of the medium specified for this application. Note that the actual volume is a type of measurement associated witht the asset. + @param Specification: + @param Assets: + """ + #: Kind of this medium. Values are: "gas", "liquid", "solid" + self.kind = kind + + #: The volume of the medium specified for this application. Note that the actual volume is a type of measurement associated witht the asset. + self.volumeSpec = volumeSpec + + self._Specification = None + self.Specification = Specification + + self._Assets = [] + self.Assets = [] if Assets is None else Assets + + super(Medium, self).__init__(*args, **kw_args) + + _attrs = ["kind", "volumeSpec"] + _attr_types = {"kind": str, "volumeSpec": float} + _defaults = {"kind": "gas", "volumeSpec": 0.0} + _enums = {"kind": "MediumKind"} + _refs = ["Specification", "Assets"] + _many_refs = ["Assets"] + + def getSpecification(self): + + return self._Specification + + def setSpecification(self, value): + if self._Specification is not None: + filtered = [x for x in self.Specification.Mediums if x != self] + self._Specification._Mediums = filtered + + self._Specification = value + if self._Specification is not None: + if self not in self._Specification._Mediums: + self._Specification._Mediums.append(self) + + Specification = property(getSpecification, setSpecification) + + def getAssets(self): + + return self._Assets + + def setAssets(self, value): + for p in self._Assets: + filtered = [q for q in p.Mediums if q != self] + self._Assets._Mediums = filtered + for r in value: + if self not in r._Mediums: + r._Mediums.append(self) + self._Assets = value + + Assets = property(getAssets, setAssets) + + def addAssets(self, *Assets): + for obj in Assets: + if self not in obj._Mediums: + obj._Mediums.append(self) + self._Assets.append(obj) + + def removeAssets(self, *Assets): + for obj in Assets: + if self in obj._Mediums: + obj._Mediums.remove(self) + self._Assets.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfAssets/MountingConnection.py b/CIM16/IEC61970/Informative/InfAssets/MountingConnection.py new file mode 100755 index 00000000..5089b0ce --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/MountingConnection.py @@ -0,0 +1,101 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class MountingConnection(IdentifiedObject): + """A structure can have multiple connection points for electrical connections (e.g. line) each with multiple mounting points, one for each phase. e.g. a Tower may have three Connections, two with three mounting points, one for each phase and a third with a single mounting point for the neutral line. A pole, on the other hand, may have a single Connection with one, two or three mounting points depending on whether it is carrying 1,2 or 3 phases.A structure can have multiple connection points for electrical connections (e.g. line) each with multiple mounting points, one for each phase. e.g. a Tower may have three Connections, two with three mounting points, one for each phase and a third with a single mounting point for the neutral line. A pole, on the other hand, may have a single Connection with one, two or three mounting points depending on whether it is carrying 1,2 or 3 phases. + """ + + def __init__(self, StructureInfos=None, MountingPoints=None, *args, **kw_args): + """Initialises a new 'MountingConnection' instance. + + @param StructureInfos: + @param MountingPoints: + """ + self._StructureInfos = [] + self.StructureInfos = [] if StructureInfos is None else StructureInfos + + self._MountingPoints = [] + self.MountingPoints = [] if MountingPoints is None else MountingPoints + + super(MountingConnection, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["StructureInfos", "MountingPoints"] + _many_refs = ["StructureInfos", "MountingPoints"] + + def getStructureInfos(self): + + return self._StructureInfos + + def setStructureInfos(self, value): + for p in self._StructureInfos: + filtered = [q for q in p.MountingConnections if q != self] + self._StructureInfos._MountingConnections = filtered + for r in value: + if self not in r._MountingConnections: + r._MountingConnections.append(self) + self._StructureInfos = value + + StructureInfos = property(getStructureInfos, setStructureInfos) + + def addStructureInfos(self, *StructureInfos): + for obj in StructureInfos: + if self not in obj._MountingConnections: + obj._MountingConnections.append(self) + self._StructureInfos.append(obj) + + def removeStructureInfos(self, *StructureInfos): + for obj in StructureInfos: + if self in obj._MountingConnections: + obj._MountingConnections.remove(self) + self._StructureInfos.remove(obj) + + def getMountingPoints(self): + + return self._MountingPoints + + def setMountingPoints(self, value): + for p in self._MountingPoints: + filtered = [q for q in p.Connections if q != self] + self._MountingPoints._Connections = filtered + for r in value: + if self not in r._Connections: + r._Connections.append(self) + self._MountingPoints = value + + MountingPoints = property(getMountingPoints, setMountingPoints) + + def addMountingPoints(self, *MountingPoints): + for obj in MountingPoints: + if self not in obj._Connections: + obj._Connections.append(self) + self._MountingPoints.append(obj) + + def removeMountingPoints(self, *MountingPoints): + for obj in MountingPoints: + if self in obj._Connections: + obj._Connections.remove(self) + self._MountingPoints.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfAssets/MountingPoint.py b/CIM16/IEC61970/Informative/InfAssets/MountingPoint.py new file mode 100755 index 00000000..9f7b0f2f --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/MountingPoint.py @@ -0,0 +1,107 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class MountingPoint(IdentifiedObject): + """Point on a structure that a connection may have a conductor connected to. Defined with an x and y coordinate plus a phase. A connection may have multiple mounting points, one for each phase.Point on a structure that a connection may have a conductor connected to. Defined with an x and y coordinate plus a phase. A connection may have multiple mounting points, one for each phase. + """ + + def __init__(self, xCoord=0, phaseCode="s12N", yCoord=0, Connections=None, OverheadConductors=None, *args, **kw_args): + """Initialises a new 'MountingPoint' instance. + + @param xCoord: + @param phaseCode: Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param yCoord: + @param Connections: + @param OverheadConductors: + """ + + self.xCoord = xCoord + + #: Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.phaseCode = phaseCode + + + self.yCoord = yCoord + + self._Connections = [] + self.Connections = [] if Connections is None else Connections + + self._OverheadConductors = [] + self.OverheadConductors = [] if OverheadConductors is None else OverheadConductors + + super(MountingPoint, self).__init__(*args, **kw_args) + + _attrs = ["xCoord", "phaseCode", "yCoord"] + _attr_types = {"xCoord": int, "phaseCode": str, "yCoord": int} + _defaults = {"xCoord": 0, "phaseCode": "s12N", "yCoord": 0} + _enums = {"phaseCode": "PhaseCode"} + _refs = ["Connections", "OverheadConductors"] + _many_refs = ["Connections", "OverheadConductors"] + + def getConnections(self): + + return self._Connections + + def setConnections(self, value): + for p in self._Connections: + filtered = [q for q in p.MountingPoints if q != self] + self._Connections._MountingPoints = filtered + for r in value: + if self not in r._MountingPoints: + r._MountingPoints.append(self) + self._Connections = value + + Connections = property(getConnections, setConnections) + + def addConnections(self, *Connections): + for obj in Connections: + if self not in obj._MountingPoints: + obj._MountingPoints.append(self) + self._Connections.append(obj) + + def removeConnections(self, *Connections): + for obj in Connections: + if self in obj._MountingPoints: + obj._MountingPoints.remove(self) + self._Connections.remove(obj) + + def getOverheadConductors(self): + + return self._OverheadConductors + + def setOverheadConductors(self, value): + for x in self._OverheadConductors: + x.MountingPoint = None + for y in value: + y._MountingPoint = self + self._OverheadConductors = value + + OverheadConductors = property(getOverheadConductors, setOverheadConductors) + + def addOverheadConductors(self, *OverheadConductors): + for obj in OverheadConductors: + obj.MountingPoint = self + + def removeOverheadConductors(self, *OverheadConductors): + for obj in OverheadConductors: + obj.MountingPoint = None + diff --git a/CIM16/IEC61970/Informative/InfAssets/OrgAssetRole.py b/CIM16/IEC61970/Informative/InfAssets/OrgAssetRole.py new file mode 100755 index 00000000..92d8416d --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/OrgAssetRole.py @@ -0,0 +1,83 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.Role import Role + +class OrgAssetRole(Role): + """The roles played between an Organisations and an Asset.The roles played between an Organisations and an Asset. + """ + + def __init__(self, percentOwnership=0.0, ErpOrganisation=None, Asset=None, *args, **kw_args): + """Initialises a new 'OrgAssetRole' instance. + + @param percentOwnership: If the role type is 'owner,' this indicate the percentage of ownership. + @param ErpOrganisation: + @param Asset: + """ + #: If the role type is 'owner,' this indicate the percentage of ownership. + self.percentOwnership = percentOwnership + + self._ErpOrganisation = None + self.ErpOrganisation = ErpOrganisation + + self._Asset = None + self.Asset = Asset + + super(OrgAssetRole, self).__init__(*args, **kw_args) + + _attrs = ["percentOwnership"] + _attr_types = {"percentOwnership": float} + _defaults = {"percentOwnership": 0.0} + _enums = {} + _refs = ["ErpOrganisation", "Asset"] + _many_refs = [] + + def getErpOrganisation(self): + + return self._ErpOrganisation + + def setErpOrganisation(self, value): + if self._ErpOrganisation is not None: + filtered = [x for x in self.ErpOrganisation.AssetRoles if x != self] + self._ErpOrganisation._AssetRoles = filtered + + self._ErpOrganisation = value + if self._ErpOrganisation is not None: + if self not in self._ErpOrganisation._AssetRoles: + self._ErpOrganisation._AssetRoles.append(self) + + ErpOrganisation = property(getErpOrganisation, setErpOrganisation) + + def getAsset(self): + + return self._Asset + + def setAsset(self, value): + if self._Asset is not None: + filtered = [x for x in self.Asset.ErpOrganisationRoles if x != self] + self._Asset._ErpOrganisationRoles = filtered + + self._Asset = value + if self._Asset is not None: + if self not in self._Asset._ErpOrganisationRoles: + self._Asset._ErpOrganisationRoles.append(self) + + Asset = property(getAsset, setAsset) + diff --git a/CIM16/IEC61970/Informative/InfAssets/Pole.py b/CIM16/IEC61970/Informative/InfAssets/Pole.py new file mode 100755 index 00000000..88e32116 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/Pole.py @@ -0,0 +1,109 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfAssets.Structure import Structure + +class Pole(Structure): + """Pole asset.Pole asset. + """ + + def __init__(self, breastBlock=False, diameter=0.0, baseKind="dirt", jpaReference='', treatmentKind="unknown", preservativeKind="penta", length=0.0, construction='', speciesType='', classification='', treatedDateTime='', Streetlights=None, *args, **kw_args): + """Initialises a new 'Pole' instance. + + @param breastBlock: True if a block of material has been attached to base of pole in ground for stability. This technique is used primarily when anchors can not be used. + @param diameter: Diameter of the pole. + @param baseKind: Kind of base for this pole. Values are: "dirt", "asphalt", "unknown", "cement", "other" + @param jpaReference: Joint pole agreement reference number. + @param treatmentKind: Kind of treatment for this pole. Values are: "unknown", "natural", "grayStain", "greenStain", "penta", "butt", "other", "full" + @param preservativeKind: Kind of preservative for this pole. Values are: "penta", "unknown", "chemonite", "other", "naphthena", "creosote", "cellon" + @param length: Length of the pole (inclusive of any section of the pole that may be underground post-installation). + @param construction: The framing structure mounted on the pole. + @param speciesType: Pole species. Aluminum, Aluminum Davit, Concrete, Fiberglass, Galvanized Davit, Galvanized, Steel Davit Primed, Steel Davit, Steel Standard Primed, Steel, Truncated, Wood-Treated, Wood-Hard, Wood-Salt Treated, Wood-Soft, Wood, Other, Unknown. + @param classification: Pole class: 1, 2, 3, 4, 5, 6, 7, H1, H2, Other, Unknown. + @param treatedDateTime: Date and time pole was last treated with preservative. + @param Streetlights: Streetlight(s) may be attached to a pole. + """ + #: True if a block of material has been attached to base of pole in ground for stability. This technique is used primarily when anchors can not be used. + self.breastBlock = breastBlock + + #: Diameter of the pole. + self.diameter = diameter + + #: Kind of base for this pole. Values are: "dirt", "asphalt", "unknown", "cement", "other" + self.baseKind = baseKind + + #: Joint pole agreement reference number. + self.jpaReference = jpaReference + + #: Kind of treatment for this pole. Values are: "unknown", "natural", "grayStain", "greenStain", "penta", "butt", "other", "full" + self.treatmentKind = treatmentKind + + #: Kind of preservative for this pole. Values are: "penta", "unknown", "chemonite", "other", "naphthena", "creosote", "cellon" + self.preservativeKind = preservativeKind + + #: Length of the pole (inclusive of any section of the pole that may be underground post-installation). + self.length = length + + #: The framing structure mounted on the pole. + self.construction = construction + + #: Pole species. Aluminum, Aluminum Davit, Concrete, Fiberglass, Galvanized Davit, Galvanized, Steel Davit Primed, Steel Davit, Steel Standard Primed, Steel, Truncated, Wood-Treated, Wood-Hard, Wood-Salt Treated, Wood-Soft, Wood, Other, Unknown. + self.speciesType = speciesType + + #: Pole class: 1, 2, 3, 4, 5, 6, 7, H1, H2, Other, Unknown. + self.classification = classification + + #: Date and time pole was last treated with preservative. + self.treatedDateTime = treatedDateTime + + self._Streetlights = [] + self.Streetlights = [] if Streetlights is None else Streetlights + + super(Pole, self).__init__(*args, **kw_args) + + _attrs = ["breastBlock", "diameter", "baseKind", "jpaReference", "treatmentKind", "preservativeKind", "length", "construction", "speciesType", "classification", "treatedDateTime"] + _attr_types = {"breastBlock": bool, "diameter": float, "baseKind": str, "jpaReference": str, "treatmentKind": str, "preservativeKind": str, "length": float, "construction": str, "speciesType": str, "classification": str, "treatedDateTime": str} + _defaults = {"breastBlock": False, "diameter": 0.0, "baseKind": "dirt", "jpaReference": '', "treatmentKind": "unknown", "preservativeKind": "penta", "length": 0.0, "construction": '', "speciesType": '', "classification": '', "treatedDateTime": ''} + _enums = {"baseKind": "PoleBaseKind", "treatmentKind": "PoleTreatmentKind", "preservativeKind": "PolePreservativeKind"} + _refs = ["Streetlights"] + _many_refs = ["Streetlights"] + + def getStreetlights(self): + """Streetlight(s) may be attached to a pole. + """ + return self._Streetlights + + def setStreetlights(self, value): + for x in self._Streetlights: + x.Pole = None + for y in value: + y._Pole = self + self._Streetlights = value + + Streetlights = property(getStreetlights, setStreetlights) + + def addStreetlights(self, *Streetlights): + for obj in Streetlights: + obj.Pole = self + + def removeStreetlights(self, *Streetlights): + for obj in Streetlights: + obj.Pole = None + diff --git a/CIM16/IEC61970/Informative/InfAssets/PotentialTransformerInfo.py b/CIM16/IEC61970/Informative/InfAssets/PotentialTransformerInfo.py new file mode 100755 index 00000000..15854849 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/PotentialTransformerInfo.py @@ -0,0 +1,96 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class PotentialTransformerInfo(AssetInfo): + """Properties of potential transformer asset.Properties of potential transformer asset. + """ + + def __init__(self, ptClass='', accuracyClass='', nominalRatio=None, primaryRatio=None, tertiaryRatio=None, PTs=None, secondaryRatio=None, *args, **kw_args): + """Initialises a new 'PotentialTransformerInfo' instance. + + @param ptClass: + @param accuracyClass: + @param nominalRatio: + @param primaryRatio: Ratio for the primary winding tap changer. + @param tertiaryRatio: Ratio for the tertiary winding tap changer. + @param PTs: All potential (voltage) transformers described by this data. + @param secondaryRatio: Ratio for the secondary winding tap changer. + """ + + self.ptClass = ptClass + + + self.accuracyClass = accuracyClass + + self.nominalRatio = nominalRatio + + self.primaryRatio = primaryRatio + + self.tertiaryRatio = tertiaryRatio + + self._PTs = [] + self.PTs = [] if PTs is None else PTs + + self.secondaryRatio = secondaryRatio + + super(PotentialTransformerInfo, self).__init__(*args, **kw_args) + + _attrs = ["ptClass", "accuracyClass"] + _attr_types = {"ptClass": str, "accuracyClass": str} + _defaults = {"ptClass": '', "accuracyClass": ''} + _enums = {} + _refs = ["nominalRatio", "primaryRatio", "tertiaryRatio", "PTs", "secondaryRatio"] + _many_refs = ["PTs"] + + nominalRatio = None + + # Ratio for the primary winding tap changer. + primaryRatio = None + + # Ratio for the tertiary winding tap changer. + tertiaryRatio = None + + def getPTs(self): + """All potential (voltage) transformers described by this data. + """ + return self._PTs + + def setPTs(self, value): + for x in self._PTs: + x.PTInfo = None + for y in value: + y._PTInfo = self + self._PTs = value + + PTs = property(getPTs, setPTs) + + def addPTs(self, *PTs): + for obj in PTs: + obj.PTInfo = self + + def removePTs(self, *PTs): + for obj in PTs: + obj.PTInfo = None + + # Ratio for the secondary winding tap changer. + secondaryRatio = None + diff --git a/CIM16/IEC61970/Informative/InfAssets/PowerRating.py b/CIM16/IEC61970/Informative/InfAssets/PowerRating.py new file mode 100755 index 00000000..5f9aab70 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/PowerRating.py @@ -0,0 +1,82 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PowerRating(IdentifiedObject): + """There are often stages of power which are associated with stages of cooling. For instance, a transformer may be rated 121kV on the primary, 15kV on the secondary and 4kV on the tertiary winding. These are voltage ratings and the power ratings are generally the same for all three windings and independent of the voltage ratings, there are instances where the tertiary may have a lower power rating. For example, for three stages, the power rating may be 15/20/25 MVA and the cooling is OA/FA/FOA. The 15 MVA rating goes with the OA cooling (Oil and Air cooling). This is called the self cooled rating as there are no external cooling enhancements. The 20 MVA rating goes with the FA cooling (Forced Air cooling), this means that when the fans are running and thus enhancing the cooling characteristics, the transformer can operate at a power level of 20 MVA. The 25 MVA rating goes with the FOA cooling (Forced Oil and Air cooling), this means that when the fans and pumps are running and thus enhancing the cooling characteristics even more than before, the transformer can operate at a power level of 25 MVA. This 15/20/25 MVA does not state how the power is split between the various windings. It may be 25 MVA input on the primary, 25 MVA output on the secondary and 0 MVA output on the tertiary. It may also operate at 25 MVA input on the primary, 17 MVA output on the secondary and 8 MVA output on the tertiary.There are often stages of power which are associated with stages of cooling. For instance, a transformer may be rated 121kV on the primary, 15kV on the secondary and 4kV on the tertiary winding. These are voltage ratings and the power ratings are generally the same for all three windings and independent of the voltage ratings, there are instances where the tertiary may have a lower power rating. For example, for three stages, the power rating may be 15/20/25 MVA and the cooling is OA/FA/FOA. The 15 MVA rating goes with the OA cooling (Oil and Air cooling). This is called the self cooled rating as there are no external cooling enhancements. The 20 MVA rating goes with the FA cooling (Forced Air cooling), this means that when the fans are running and thus enhancing the cooling characteristics, the transformer can operate at a power level of 20 MVA. The 25 MVA rating goes with the FOA cooling (Forced Oil and Air cooling), this means that when the fans and pumps are running and thus enhancing the cooling characteristics even more than before, the transformer can operate at a power level of 25 MVA. This 15/20/25 MVA does not state how the power is split between the various windings. It may be 25 MVA input on the primary, 25 MVA output on the secondary and 0 MVA output on the tertiary. It may also operate at 25 MVA input on the primary, 17 MVA output on the secondary and 8 MVA output on the tertiary. + """ + + def __init__(self, stage=0, powerRating=0.0, coolingKind="forcedAir", TransformerAssets=None, *args, **kw_args): + """Initialises a new 'PowerRating' instance. + + @param stage: Stage of cooling and associated power rating. + @param powerRating: The power rating associated with type of cooling specified for this stage. + @param coolingKind: Kind of cooling system. Values are: "forcedAir", "selfCooling", "forcedOilAndAir", "other" + @param TransformerAssets: + """ + #: Stage of cooling and associated power rating. + self.stage = stage + + #: The power rating associated with type of cooling specified for this stage. + self.powerRating = powerRating + + #: Kind of cooling system. Values are: "forcedAir", "selfCooling", "forcedOilAndAir", "other" + self.coolingKind = coolingKind + + self._TransformerAssets = [] + self.TransformerAssets = [] if TransformerAssets is None else TransformerAssets + + super(PowerRating, self).__init__(*args, **kw_args) + + _attrs = ["stage", "powerRating", "coolingKind"] + _attr_types = {"stage": int, "powerRating": float, "coolingKind": str} + _defaults = {"stage": 0, "powerRating": 0.0, "coolingKind": "forcedAir"} + _enums = {"coolingKind": "CoolingKind"} + _refs = ["TransformerAssets"] + _many_refs = ["TransformerAssets"] + + def getTransformerAssets(self): + + return self._TransformerAssets + + def setTransformerAssets(self, value): + for p in self._TransformerAssets: + filtered = [q for q in p.PowerRatings if q != self] + self._TransformerAssets._PowerRatings = filtered + for r in value: + if self not in r._PowerRatings: + r._PowerRatings.append(self) + self._TransformerAssets = value + + TransformerAssets = property(getTransformerAssets, setTransformerAssets) + + def addTransformerAssets(self, *TransformerAssets): + for obj in TransformerAssets: + if self not in obj._PowerRatings: + obj._PowerRatings.append(self) + self._TransformerAssets.append(obj) + + def removeTransformerAssets(self, *TransformerAssets): + for obj in TransformerAssets: + if self in obj._PowerRatings: + obj._PowerRatings.remove(self) + self._TransformerAssets.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfAssets/Procedure.py b/CIM16/IEC61970/Informative/InfAssets/Procedure.py new file mode 100755 index 00000000..32fa3953 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/Procedure.py @@ -0,0 +1,168 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class Procedure(Document): + """A documented procedure for various types of Work or Work Tasks. One or more procedures guide a compatible unit, a standard way of performing a unit of work. The type of procedure is defined in Procedure.type. For example, when type=Inspection, this procedure coupled with Schedule and other information provides the key items of an inspection plan. Another type of Procedure is a Diagnosis. Note that each specific values and settings to be used in a procedure is intended to be described in an instance of ProcedureValue. A maintenance ticket, a type of Work, is generated whenever maintenance is determined to be needed as a result of an inspection or diagnosis.A documented procedure for various types of Work or Work Tasks. One or more procedures guide a compatible unit, a standard way of performing a unit of work. The type of procedure is defined in Procedure.type. For example, when type=Inspection, this procedure coupled with Schedule and other information provides the key items of an inspection plan. Another type of Procedure is a Diagnosis. Note that each specific values and settings to be used in a procedure is intended to be described in an instance of ProcedureValue. A maintenance ticket, a type of Work, is generated whenever maintenance is determined to be needed as a result of an inspection or diagnosis. + """ + + def __init__(self, corporateCode='', sequenceNumber='', kind="test", instruction='', ProcedureValues=None, ProcedureDataSets=None, CompatibleUnits=None, Limits=None, *args, **kw_args): + """Initialises a new 'Procedure' instance. + + @param corporateCode: Code for this kind of procedure. + @param sequenceNumber: Sequence number in a sequence of procedures being performed. + @param kind: Kind of this procedure. Values are: "test", "maintenance", "other", "inspection", "diagnosis" + @param instruction: The textual description of the procedure, which references instances of ProcedureValue as appropriate. + @param ProcedureValues: UserAttributes used to specify procedure values. An example is to have an instance for each of the following settings when conducting a test: voltage, current, frequency, temperature specified in 'name' attribute, and the corresponding value and units in 'value' attribute. + @param ProcedureDataSets: + @param CompatibleUnits: + @param Limits: + """ + #: Code for this kind of procedure. + self.corporateCode = corporateCode + + #: Sequence number in a sequence of procedures being performed. + self.sequenceNumber = sequenceNumber + + #: Kind of this procedure. Values are: "test", "maintenance", "other", "inspection", "diagnosis" + self.kind = kind + + #: The textual description of the procedure, which references instances of ProcedureValue as appropriate. + self.instruction = instruction + + self._ProcedureValues = [] + self.ProcedureValues = [] if ProcedureValues is None else ProcedureValues + + self._ProcedureDataSets = [] + self.ProcedureDataSets = [] if ProcedureDataSets is None else ProcedureDataSets + + self._CompatibleUnits = [] + self.CompatibleUnits = [] if CompatibleUnits is None else CompatibleUnits + + self._Limits = [] + self.Limits = [] if Limits is None else Limits + + super(Procedure, self).__init__(*args, **kw_args) + + _attrs = ["corporateCode", "sequenceNumber", "kind", "instruction"] + _attr_types = {"corporateCode": str, "sequenceNumber": str, "kind": str, "instruction": str} + _defaults = {"corporateCode": '', "sequenceNumber": '', "kind": "test", "instruction": ''} + _enums = {"kind": "ProcedureKind"} + _refs = ["ProcedureValues", "ProcedureDataSets", "CompatibleUnits", "Limits"] + _many_refs = ["ProcedureValues", "ProcedureDataSets", "CompatibleUnits", "Limits"] + + def getProcedureValues(self): + """UserAttributes used to specify procedure values. An example is to have an instance for each of the following settings when conducting a test: voltage, current, frequency, temperature specified in 'name' attribute, and the corresponding value and units in 'value' attribute. + """ + return self._ProcedureValues + + def setProcedureValues(self, value): + for x in self._ProcedureValues: + x.Procedure = None + for y in value: + y._Procedure = self + self._ProcedureValues = value + + ProcedureValues = property(getProcedureValues, setProcedureValues) + + def addProcedureValues(self, *ProcedureValues): + for obj in ProcedureValues: + obj.Procedure = self + + def removeProcedureValues(self, *ProcedureValues): + for obj in ProcedureValues: + obj.Procedure = None + + def getProcedureDataSets(self): + + return self._ProcedureDataSets + + def setProcedureDataSets(self, value): + for x in self._ProcedureDataSets: + x.Procedure = None + for y in value: + y._Procedure = self + self._ProcedureDataSets = value + + ProcedureDataSets = property(getProcedureDataSets, setProcedureDataSets) + + def addProcedureDataSets(self, *ProcedureDataSets): + for obj in ProcedureDataSets: + obj.Procedure = self + + def removeProcedureDataSets(self, *ProcedureDataSets): + for obj in ProcedureDataSets: + obj.Procedure = None + + def getCompatibleUnits(self): + + return self._CompatibleUnits + + def setCompatibleUnits(self, value): + for p in self._CompatibleUnits: + filtered = [q for q in p.Procedures if q != self] + self._CompatibleUnits._Procedures = filtered + for r in value: + if self not in r._Procedures: + r._Procedures.append(self) + self._CompatibleUnits = value + + CompatibleUnits = property(getCompatibleUnits, setCompatibleUnits) + + def addCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + if self not in obj._Procedures: + obj._Procedures.append(self) + self._CompatibleUnits.append(obj) + + def removeCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + if self in obj._Procedures: + obj._Procedures.remove(self) + self._CompatibleUnits.remove(obj) + + def getLimits(self): + + return self._Limits + + def setLimits(self, value): + for p in self._Limits: + filtered = [q for q in p.Procedures if q != self] + self._Limits._Procedures = filtered + for r in value: + if self not in r._Procedures: + r._Procedures.append(self) + self._Limits = value + + Limits = property(getLimits, setLimits) + + def addLimits(self, *Limits): + for obj in Limits: + if self not in obj._Procedures: + obj._Procedures.append(self) + self._Limits.append(obj) + + def removeLimits(self, *Limits): + for obj in Limits: + if self in obj._Procedures: + obj._Procedures.remove(self) + self._Limits.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfAssets/ProcedureDataSet.py b/CIM16/IEC61970/Informative/InfAssets/ProcedureDataSet.py new file mode 100755 index 00000000..d617cbc1 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/ProcedureDataSet.py @@ -0,0 +1,157 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ProcedureDataSet(Document): + """A data set recorded each time a procedure is executed. Observed results are captured in associated measurement values and/or values for properties relevant to the type of procedure performed.A data set recorded each time a procedure is executed. Observed results are captured in associated measurement values and/or values for properties relevant to the type of procedure performed. + """ + + def __init__(self, completedDateTime='', Properties=None, TransformerObservations=None, Procedure=None, MeasurementValues=None, *args, **kw_args): + """Initialises a new 'ProcedureDataSet' instance. + + @param completedDateTime: Date and time procedure was completed. + @param Properties: UserAttributes used to specify further properties of this procedure data set. Use 'name' to specify what kind of property it is, and 'value.value' attribute for the actual value. + @param TransformerObservations: + @param Procedure: + @param MeasurementValues: + """ + #: Date and time procedure was completed. + self.completedDateTime = completedDateTime + + self._Properties = [] + self.Properties = [] if Properties is None else Properties + + self._TransformerObservations = [] + self.TransformerObservations = [] if TransformerObservations is None else TransformerObservations + + self._Procedure = None + self.Procedure = Procedure + + self._MeasurementValues = [] + self.MeasurementValues = [] if MeasurementValues is None else MeasurementValues + + super(ProcedureDataSet, self).__init__(*args, **kw_args) + + _attrs = ["completedDateTime"] + _attr_types = {"completedDateTime": str} + _defaults = {"completedDateTime": ''} + _enums = {} + _refs = ["Properties", "TransformerObservations", "Procedure", "MeasurementValues"] + _many_refs = ["Properties", "TransformerObservations", "MeasurementValues"] + + def getProperties(self): + """UserAttributes used to specify further properties of this procedure data set. Use 'name' to specify what kind of property it is, and 'value.value' attribute for the actual value. + """ + return self._Properties + + def setProperties(self, value): + for p in self._Properties: + filtered = [q for q in p.ProcedureDataSets if q != self] + self._Properties._ProcedureDataSets = filtered + for r in value: + if self not in r._ProcedureDataSets: + r._ProcedureDataSets.append(self) + self._Properties = value + + Properties = property(getProperties, setProperties) + + def addProperties(self, *Properties): + for obj in Properties: + if self not in obj._ProcedureDataSets: + obj._ProcedureDataSets.append(self) + self._Properties.append(obj) + + def removeProperties(self, *Properties): + for obj in Properties: + if self in obj._ProcedureDataSets: + obj._ProcedureDataSets.remove(self) + self._Properties.remove(obj) + + def getTransformerObservations(self): + + return self._TransformerObservations + + def setTransformerObservations(self, value): + for p in self._TransformerObservations: + filtered = [q for q in p.ProcedureDataSets if q != self] + self._TransformerObservations._ProcedureDataSets = filtered + for r in value: + if self not in r._ProcedureDataSets: + r._ProcedureDataSets.append(self) + self._TransformerObservations = value + + TransformerObservations = property(getTransformerObservations, setTransformerObservations) + + def addTransformerObservations(self, *TransformerObservations): + for obj in TransformerObservations: + if self not in obj._ProcedureDataSets: + obj._ProcedureDataSets.append(self) + self._TransformerObservations.append(obj) + + def removeTransformerObservations(self, *TransformerObservations): + for obj in TransformerObservations: + if self in obj._ProcedureDataSets: + obj._ProcedureDataSets.remove(self) + self._TransformerObservations.remove(obj) + + def getProcedure(self): + + return self._Procedure + + def setProcedure(self, value): + if self._Procedure is not None: + filtered = [x for x in self.Procedure.ProcedureDataSets if x != self] + self._Procedure._ProcedureDataSets = filtered + + self._Procedure = value + if self._Procedure is not None: + if self not in self._Procedure._ProcedureDataSets: + self._Procedure._ProcedureDataSets.append(self) + + Procedure = property(getProcedure, setProcedure) + + def getMeasurementValues(self): + + return self._MeasurementValues + + def setMeasurementValues(self, value): + for p in self._MeasurementValues: + filtered = [q for q in p.ProcedureDataSets if q != self] + self._MeasurementValues._ProcedureDataSets = filtered + for r in value: + if self not in r._ProcedureDataSets: + r._ProcedureDataSets.append(self) + self._MeasurementValues = value + + MeasurementValues = property(getMeasurementValues, setMeasurementValues) + + def addMeasurementValues(self, *MeasurementValues): + for obj in MeasurementValues: + if self not in obj._ProcedureDataSets: + obj._ProcedureDataSets.append(self) + self._MeasurementValues.append(obj) + + def removeMeasurementValues(self, *MeasurementValues): + for obj in MeasurementValues: + if self in obj._ProcedureDataSets: + obj._ProcedureDataSets.remove(self) + self._MeasurementValues.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfAssets/ProtectionEquipmentInfo.py b/CIM16/IEC61970/Informative/InfAssets/ProtectionEquipmentInfo.py new file mode 100755 index 00000000..9fdc6e35 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/ProtectionEquipmentInfo.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class ProtectionEquipmentInfo(AssetInfo): + """Properties of protection equipment asset.Properties of protection equipment asset. + """ + + def __init__(self, groundTrip=0.0, phaseTrip=0.0, *args, **kw_args): + """Initialises a new 'ProtectionEquipmentInfo' instance. + + @param groundTrip: Actual ground trip for this type of relay, if applicable. + @param phaseTrip: Actual phase trip for this type of relay, if applicable. + """ + #: Actual ground trip for this type of relay, if applicable. + self.groundTrip = groundTrip + + #: Actual phase trip for this type of relay, if applicable. + self.phaseTrip = phaseTrip + + super(ProtectionEquipmentInfo, self).__init__(*args, **kw_args) + + _attrs = ["groundTrip", "phaseTrip"] + _attr_types = {"groundTrip": float, "phaseTrip": float} + _defaults = {"groundTrip": 0.0, "phaseTrip": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/RecloserInfo.py b/CIM16/IEC61970/Informative/InfAssets/RecloserInfo.py new file mode 100755 index 00000000..c13ef98e --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/RecloserInfo.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfAssets.SwitchInfo import SwitchInfo + +class RecloserInfo(SwitchInfo): + """Properties of recloser assets.Properties of recloser assets. + """ + + def __init__(self, groundTripNormalEnabled=False, groundTripCapable=False, recloseLockoutCount=0, phaseTripRating=0.0, groundTripRating=0.0, *args, **kw_args): + """Initialises a new 'RecloserInfo' instance. + + @param groundTripNormalEnabled: True if normal status of ground trip is enabled. + @param groundTripCapable: True if device has ground trip capability. + @param recloseLockoutCount: Total number of phase reclose operations. + @param phaseTripRating: Phase trip rating. + @param groundTripRating: Ground trip rating. + """ + #: True if normal status of ground trip is enabled. + self.groundTripNormalEnabled = groundTripNormalEnabled + + #: True if device has ground trip capability. + self.groundTripCapable = groundTripCapable + + #: Total number of phase reclose operations. + self.recloseLockoutCount = recloseLockoutCount + + #: Phase trip rating. + self.phaseTripRating = phaseTripRating + + #: Ground trip rating. + self.groundTripRating = groundTripRating + + super(RecloserInfo, self).__init__(*args, **kw_args) + + _attrs = ["groundTripNormalEnabled", "groundTripCapable", "recloseLockoutCount", "phaseTripRating", "groundTripRating"] + _attr_types = {"groundTripNormalEnabled": bool, "groundTripCapable": bool, "recloseLockoutCount": int, "phaseTripRating": float, "groundTripRating": float} + _defaults = {"groundTripNormalEnabled": False, "groundTripCapable": False, "recloseLockoutCount": 0, "phaseTripRating": 0.0, "groundTripRating": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/ReliabilityInfo.py b/CIM16/IEC61970/Informative/InfAssets/ReliabilityInfo.py new file mode 100755 index 00000000..2cac5041 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/ReliabilityInfo.py @@ -0,0 +1,98 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ReliabilityInfo(IdentifiedObject): + """Information regarding the experienced and expected reliability of a specific asset, type of asset, or asset model.Information regarding the experienced and expected reliability of a specific asset, type of asset, or asset model. + """ + + def __init__(self, momFailureRate=0.0, mTTR=0.0, Specification=None, Assets=None, *args, **kw_args): + """Initialises a new 'ReliabilityInfo' instance. + + @param momFailureRate: Momentary failure rate (temporary failures/kft-year). + @param mTTR: Mean time to repair (MTTR - hours). + @param Specification: + @param Assets: + """ + #: Momentary failure rate (temporary failures/kft-year). + self.momFailureRate = momFailureRate + + #: Mean time to repair (MTTR - hours). + self.mTTR = mTTR + + self._Specification = None + self.Specification = Specification + + self._Assets = [] + self.Assets = [] if Assets is None else Assets + + super(ReliabilityInfo, self).__init__(*args, **kw_args) + + _attrs = ["momFailureRate", "mTTR"] + _attr_types = {"momFailureRate": float, "mTTR": float} + _defaults = {"momFailureRate": 0.0, "mTTR": 0.0} + _enums = {} + _refs = ["Specification", "Assets"] + _many_refs = ["Assets"] + + def getSpecification(self): + + return self._Specification + + def setSpecification(self, value): + if self._Specification is not None: + filtered = [x for x in self.Specification.ReliabilityInfos if x != self] + self._Specification._ReliabilityInfos = filtered + + self._Specification = value + if self._Specification is not None: + if self not in self._Specification._ReliabilityInfos: + self._Specification._ReliabilityInfos.append(self) + + Specification = property(getSpecification, setSpecification) + + def getAssets(self): + + return self._Assets + + def setAssets(self, value): + for p in self._Assets: + filtered = [q for q in p.ReliabilityInfos if q != self] + self._Assets._ReliabilityInfos = filtered + for r in value: + if self not in r._ReliabilityInfos: + r._ReliabilityInfos.append(self) + self._Assets = value + + Assets = property(getAssets, setAssets) + + def addAssets(self, *Assets): + for obj in Assets: + if self not in obj._ReliabilityInfos: + obj._ReliabilityInfos.append(self) + self._Assets.append(obj) + + def removeAssets(self, *Assets): + for obj in Assets: + if self in obj._ReliabilityInfos: + obj._ReliabilityInfos.remove(self) + self._Assets.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfAssets/SVC.py b/CIM16/IEC61970/Informative/InfAssets/SVC.py new file mode 100755 index 00000000..ec9ce9b8 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/SVC.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfAssets.FACTSDevice import FACTSDevice + +class SVC(FACTSDevice): + """SVC asset allows the capacitive and inductive ratings for each phase to be specified individually if required.SVC asset allows the capacitive and inductive ratings for each phase to be specified individually if required. + """ + + def __init__(self, inductiveRating=0.0, capacitiveRating=0.0, *args, **kw_args): + """Initialises a new 'SVC' instance. + + @param inductiveRating: Maximum inductive reactive power + @param capacitiveRating: Maximum capacitive reactive power + """ + #: Maximum inductive reactive power + self.inductiveRating = inductiveRating + + #: Maximum capacitive reactive power + self.capacitiveRating = capacitiveRating + + super(SVC, self).__init__(*args, **kw_args) + + _attrs = ["inductiveRating", "capacitiveRating"] + _attr_types = {"inductiveRating": float, "capacitiveRating": float} + _defaults = {"inductiveRating": 0.0, "capacitiveRating": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/ShuntCompensatorInfo.py b/CIM16/IEC61970/Informative/InfAssets/ShuntCompensatorInfo.py new file mode 100755 index 00000000..068dc214 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/ShuntCompensatorInfo.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class ShuntCompensatorInfo(AssetInfo): + """Properties of shunt capacitor, shunt reactor or switchable bank of shunt capacitor or reactor assets.Properties of shunt capacitor, shunt reactor or switchable bank of shunt capacitor or reactor assets. + """ + + def __init__(self, maxPowerLoss=0.0, ShuntImpedanceInfo=None, *args, **kw_args): + """Initialises a new 'ShuntCompensatorInfo' instance. + + @param maxPowerLoss: Maximum allowed Apparent Power loss + @param ShuntImpedanceInfo: + """ + #: Maximum allowed Apparent Power loss + self.maxPowerLoss = maxPowerLoss + + self._ShuntImpedanceInfo = None + self.ShuntImpedanceInfo = ShuntImpedanceInfo + + super(ShuntCompensatorInfo, self).__init__(*args, **kw_args) + + _attrs = ["maxPowerLoss"] + _attr_types = {"maxPowerLoss": float} + _defaults = {"maxPowerLoss": 0.0} + _enums = {} + _refs = ["ShuntImpedanceInfo"] + _many_refs = [] + + def getShuntImpedanceInfo(self): + + return self._ShuntImpedanceInfo + + def setShuntImpedanceInfo(self, value): + if self._ShuntImpedanceInfo is not None: + filtered = [x for x in self.ShuntImpedanceInfo.ShuntCompensatorInfos if x != self] + self._ShuntImpedanceInfo._ShuntCompensatorInfos = filtered + + self._ShuntImpedanceInfo = value + if self._ShuntImpedanceInfo is not None: + if self not in self._ShuntImpedanceInfo._ShuntCompensatorInfos: + self._ShuntImpedanceInfo._ShuntCompensatorInfos.append(self) + + ShuntImpedanceInfo = property(getShuntImpedanceInfo, setShuntImpedanceInfo) + diff --git a/CIM16/IEC61970/Informative/InfAssets/ShuntImpedanceInfo.py b/CIM16/IEC61970/Informative/InfAssets/ShuntImpedanceInfo.py new file mode 100755 index 00000000..3fdee403 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/ShuntImpedanceInfo.py @@ -0,0 +1,132 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class ShuntImpedanceInfo(AssetInfo): + """Properties of a shunt impedance.Properties of a shunt impedance. + """ + + def __init__(self, maxSwitchOperationCount=0, localControlKind="none", switchOperationCycle=0.0, vRegLineLine=False, highVoltageOverride=0.0, lowVoltageOverride=0.0, regBranch='', cellSize=0.0, localOnLevel='', regBranchKind="recloser", normalOpen=False, controlKind="remoteOnly", regBranchEnd=0, branchDirect=0, localOffLevel='', sensingPhaseCode="s12N", localOverride=False, ShuntCompensatorInfos=None, *args, **kw_args): + """Initialises a new 'ShuntImpedanceInfo' instance. + + @param maxSwitchOperationCount: IdmsShuntImpedanceData.maxNumSwitchOps + @param localControlKind: Kind of local controller. Values are: "none", "temperature", "powerFactor", "voltage", "reactivePower", "time", "current" + @param switchOperationCycle: Time interval between consecutive switching operations. + @param vRegLineLine: True if regulated voltages are measured line to line, otherwise they are measured line to ground. + @param highVoltageOverride: For locally controlled shunt impedances which have a voltage override feature, the high voltage override value. If the voltage is above this value, the shunt impedance will be turned off regardless of the other local controller settings. + @param lowVoltageOverride: For locally controlled shunt impedances which have a voltage override feature, the low voltage override value. If the voltage is below this value, the shunt impedance will be turned on regardless of the other local controller settings. + @param regBranch: For VAR, amp, or power factor locally controlled shunt impedances, the index of the regulation branch. + @param cellSize: The size of the individual units that make up the bank. + @param localOnLevel: Lower control setting. + @param regBranchKind: (For VAR, amp, or power factor locally controlled shunt impedances) Kind of regulation branch. Values are: "recloser", "transformer", "breaker", "fuse", "switch", "sectionner", "other", "line" + @param normalOpen: True if open is normal status for a fixed capacitor bank, otherwise normal status is closed. + @param controlKind: Kind of control (if any). Values are: "remoteOnly", "remoteWithLocalOverride", "localOnly", "fixed" + @param regBranchEnd: For VAR, amp, or power factor locally controlled shunt impedances, the end of the branch that is regulated. The field has the following values: from side, to side, and tertiary (only if the branch is a transformer). + @param branchDirect: For VAR, amp, or power factor locally controlled shunt impedances, the flow direction: in, out. + @param localOffLevel: Upper control setting. + @param sensingPhaseCode: Phases that are measured for controlling the device. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param localOverride: True if the locally controlled capacitor has voltage override capability. + @param ShuntCompensatorInfos: + """ + #: IdmsShuntImpedanceData.maxNumSwitchOps + self.maxSwitchOperationCount = maxSwitchOperationCount + + #: Kind of local controller. Values are: "none", "temperature", "powerFactor", "voltage", "reactivePower", "time", "current" + self.localControlKind = localControlKind + + #: Time interval between consecutive switching operations. + self.switchOperationCycle = switchOperationCycle + + #: True if regulated voltages are measured line to line, otherwise they are measured line to ground. + self.vRegLineLine = vRegLineLine + + #: For locally controlled shunt impedances which have a voltage override feature, the high voltage override value. If the voltage is above this value, the shunt impedance will be turned off regardless of the other local controller settings. + self.highVoltageOverride = highVoltageOverride + + #: For locally controlled shunt impedances which have a voltage override feature, the low voltage override value. If the voltage is below this value, the shunt impedance will be turned on regardless of the other local controller settings. + self.lowVoltageOverride = lowVoltageOverride + + #: For VAR, amp, or power factor locally controlled shunt impedances, the index of the regulation branch. + self.regBranch = regBranch + + #: The size of the individual units that make up the bank. + self.cellSize = cellSize + + #: Lower control setting. + self.localOnLevel = localOnLevel + + #: (For VAR, amp, or power factor locally controlled shunt impedances) Kind of regulation branch. Values are: "recloser", "transformer", "breaker", "fuse", "switch", "sectionner", "other", "line" + self.regBranchKind = regBranchKind + + #: True if open is normal status for a fixed capacitor bank, otherwise normal status is closed. + self.normalOpen = normalOpen + + #: Kind of control (if any). Values are: "remoteOnly", "remoteWithLocalOverride", "localOnly", "fixed" + self.controlKind = controlKind + + #: For VAR, amp, or power factor locally controlled shunt impedances, the end of the branch that is regulated. The field has the following values: from side, to side, and tertiary (only if the branch is a transformer). + self.regBranchEnd = regBranchEnd + + #: For VAR, amp, or power factor locally controlled shunt impedances, the flow direction: in, out. + self.branchDirect = branchDirect + + #: Upper control setting. + self.localOffLevel = localOffLevel + + #: Phases that are measured for controlling the device. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.sensingPhaseCode = sensingPhaseCode + + #: True if the locally controlled capacitor has voltage override capability. + self.localOverride = localOverride + + self._ShuntCompensatorInfos = [] + self.ShuntCompensatorInfos = [] if ShuntCompensatorInfos is None else ShuntCompensatorInfos + + super(ShuntImpedanceInfo, self).__init__(*args, **kw_args) + + _attrs = ["maxSwitchOperationCount", "localControlKind", "switchOperationCycle", "vRegLineLine", "highVoltageOverride", "lowVoltageOverride", "regBranch", "cellSize", "localOnLevel", "regBranchKind", "normalOpen", "controlKind", "regBranchEnd", "branchDirect", "localOffLevel", "sensingPhaseCode", "localOverride"] + _attr_types = {"maxSwitchOperationCount": int, "localControlKind": str, "switchOperationCycle": float, "vRegLineLine": bool, "highVoltageOverride": float, "lowVoltageOverride": float, "regBranch": str, "cellSize": float, "localOnLevel": str, "regBranchKind": str, "normalOpen": bool, "controlKind": str, "regBranchEnd": int, "branchDirect": int, "localOffLevel": str, "sensingPhaseCode": str, "localOverride": bool} + _defaults = {"maxSwitchOperationCount": 0, "localControlKind": "none", "switchOperationCycle": 0.0, "vRegLineLine": False, "highVoltageOverride": 0.0, "lowVoltageOverride": 0.0, "regBranch": '', "cellSize": 0.0, "localOnLevel": '', "regBranchKind": "recloser", "normalOpen": False, "controlKind": "remoteOnly", "regBranchEnd": 0, "branchDirect": 0, "localOffLevel": '', "sensingPhaseCode": "s12N", "localOverride": False} + _enums = {"localControlKind": "ShuntImpedanceLocalControlKind", "regBranchKind": "RegulationBranchKind", "controlKind": "ShuntImpedanceControlKind", "sensingPhaseCode": "PhaseCode"} + _refs = ["ShuntCompensatorInfos"] + _many_refs = ["ShuntCompensatorInfos"] + + def getShuntCompensatorInfos(self): + + return self._ShuntCompensatorInfos + + def setShuntCompensatorInfos(self, value): + for x in self._ShuntCompensatorInfos: + x.ShuntImpedanceInfo = None + for y in value: + y._ShuntImpedanceInfo = self + self._ShuntCompensatorInfos = value + + ShuntCompensatorInfos = property(getShuntCompensatorInfos, setShuntCompensatorInfos) + + def addShuntCompensatorInfos(self, *ShuntCompensatorInfos): + for obj in ShuntCompensatorInfos: + obj.ShuntImpedanceInfo = self + + def removeShuntCompensatorInfos(self, *ShuntCompensatorInfos): + for obj in ShuntCompensatorInfos: + obj.ShuntImpedanceInfo = None + diff --git a/CIM16/IEC61970/Informative/InfAssets/Specification.py b/CIM16/IEC61970/Informative/InfAssets/Specification.py new file mode 100755 index 00000000..93becfaf --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/Specification.py @@ -0,0 +1,228 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class Specification(Document): + """Specification can be used for various purposes relative to an asset, a logical device (PowerSystemResource), location, etc. Examples include documents supplied by manufacturers such as asset installation instructions, asset maintenance instructions, etc.Specification can be used for various purposes relative to an asset, a logical device (PowerSystemResource), location, etc. Examples include documents supplied by manufacturers such as asset installation instructions, asset maintenance instructions, etc. + """ + + def __init__(self, AssetPropertyCurves=None, Mediums=None, AssetProperites=None, ReliabilityInfos=None, DimensionsInfos=None, Ratings=None, QualificationRequirements=None, *args, **kw_args): + """Initialises a new 'Specification' instance. + + @param AssetPropertyCurves: + @param Mediums: + @param AssetProperites: UserAttributes used to specify further properties of the asset covered with this specification. Use 'name' to specify what kind of property it is, and 'value.value' attribute for the actual value. + @param ReliabilityInfos: + @param DimensionsInfos: + @param Ratings: UserAttributes used to specify ratings of the asset covered by this specification. Ratings also can be used to set the initial value of operational measurement limits. Use 'name' to specify what kind of rating it is (e.g., voltage, current), and 'value' attribute for the actual value and unit information of the rating. + @param QualificationRequirements: + """ + self._AssetPropertyCurves = [] + self.AssetPropertyCurves = [] if AssetPropertyCurves is None else AssetPropertyCurves + + self._Mediums = [] + self.Mediums = [] if Mediums is None else Mediums + + self._AssetProperites = [] + self.AssetProperites = [] if AssetProperites is None else AssetProperites + + self._ReliabilityInfos = [] + self.ReliabilityInfos = [] if ReliabilityInfos is None else ReliabilityInfos + + self._DimensionsInfos = [] + self.DimensionsInfos = [] if DimensionsInfos is None else DimensionsInfos + + self._Ratings = [] + self.Ratings = [] if Ratings is None else Ratings + + self._QualificationRequirements = [] + self.QualificationRequirements = [] if QualificationRequirements is None else QualificationRequirements + + super(Specification, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["AssetPropertyCurves", "Mediums", "AssetProperites", "ReliabilityInfos", "DimensionsInfos", "Ratings", "QualificationRequirements"] + _many_refs = ["AssetPropertyCurves", "Mediums", "AssetProperites", "ReliabilityInfos", "DimensionsInfos", "Ratings", "QualificationRequirements"] + + def getAssetPropertyCurves(self): + + return self._AssetPropertyCurves + + def setAssetPropertyCurves(self, value): + for x in self._AssetPropertyCurves: + x.Specification = None + for y in value: + y._Specification = self + self._AssetPropertyCurves = value + + AssetPropertyCurves = property(getAssetPropertyCurves, setAssetPropertyCurves) + + def addAssetPropertyCurves(self, *AssetPropertyCurves): + for obj in AssetPropertyCurves: + obj.Specification = self + + def removeAssetPropertyCurves(self, *AssetPropertyCurves): + for obj in AssetPropertyCurves: + obj.Specification = None + + def getMediums(self): + + return self._Mediums + + def setMediums(self, value): + for x in self._Mediums: + x.Specification = None + for y in value: + y._Specification = self + self._Mediums = value + + Mediums = property(getMediums, setMediums) + + def addMediums(self, *Mediums): + for obj in Mediums: + obj.Specification = self + + def removeMediums(self, *Mediums): + for obj in Mediums: + obj.Specification = None + + def getAssetProperites(self): + """UserAttributes used to specify further properties of the asset covered with this specification. Use 'name' to specify what kind of property it is, and 'value.value' attribute for the actual value. + """ + return self._AssetProperites + + def setAssetProperites(self, value): + for x in self._AssetProperites: + x.PropertySpecification = None + for y in value: + y._PropertySpecification = self + self._AssetProperites = value + + AssetProperites = property(getAssetProperites, setAssetProperites) + + def addAssetProperites(self, *AssetProperites): + for obj in AssetProperites: + obj.PropertySpecification = self + + def removeAssetProperites(self, *AssetProperites): + for obj in AssetProperites: + obj.PropertySpecification = None + + def getReliabilityInfos(self): + + return self._ReliabilityInfos + + def setReliabilityInfos(self, value): + for x in self._ReliabilityInfos: + x.Specification = None + for y in value: + y._Specification = self + self._ReliabilityInfos = value + + ReliabilityInfos = property(getReliabilityInfos, setReliabilityInfos) + + def addReliabilityInfos(self, *ReliabilityInfos): + for obj in ReliabilityInfos: + obj.Specification = self + + def removeReliabilityInfos(self, *ReliabilityInfos): + for obj in ReliabilityInfos: + obj.Specification = None + + def getDimensionsInfos(self): + + return self._DimensionsInfos + + def setDimensionsInfos(self, value): + for p in self._DimensionsInfos: + filtered = [q for q in p.Specifications if q != self] + self._DimensionsInfos._Specifications = filtered + for r in value: + if self not in r._Specifications: + r._Specifications.append(self) + self._DimensionsInfos = value + + DimensionsInfos = property(getDimensionsInfos, setDimensionsInfos) + + def addDimensionsInfos(self, *DimensionsInfos): + for obj in DimensionsInfos: + if self not in obj._Specifications: + obj._Specifications.append(self) + self._DimensionsInfos.append(obj) + + def removeDimensionsInfos(self, *DimensionsInfos): + for obj in DimensionsInfos: + if self in obj._Specifications: + obj._Specifications.remove(self) + self._DimensionsInfos.remove(obj) + + def getRatings(self): + """UserAttributes used to specify ratings of the asset covered by this specification. Ratings also can be used to set the initial value of operational measurement limits. Use 'name' to specify what kind of rating it is (e.g., voltage, current), and 'value' attribute for the actual value and unit information of the rating. + """ + return self._Ratings + + def setRatings(self, value): + for x in self._Ratings: + x.RatingSpecification = None + for y in value: + y._RatingSpecification = self + self._Ratings = value + + Ratings = property(getRatings, setRatings) + + def addRatings(self, *Ratings): + for obj in Ratings: + obj.RatingSpecification = self + + def removeRatings(self, *Ratings): + for obj in Ratings: + obj.RatingSpecification = None + + def getQualificationRequirements(self): + + return self._QualificationRequirements + + def setQualificationRequirements(self, value): + for p in self._QualificationRequirements: + filtered = [q for q in p.Specifications if q != self] + self._QualificationRequirements._Specifications = filtered + for r in value: + if self not in r._Specifications: + r._Specifications.append(self) + self._QualificationRequirements = value + + QualificationRequirements = property(getQualificationRequirements, setQualificationRequirements) + + def addQualificationRequirements(self, *QualificationRequirements): + for obj in QualificationRequirements: + if self not in obj._Specifications: + obj._Specifications.append(self) + self._QualificationRequirements.append(obj) + + def removeQualificationRequirements(self, *QualificationRequirements): + for obj in QualificationRequirements: + if self in obj._Specifications: + obj._Specifications.remove(self) + self._QualificationRequirements.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfAssets/Streetlight.py b/CIM16/IEC61970/Informative/InfAssets/Streetlight.py new file mode 100755 index 00000000..5ecd46be --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/Streetlight.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.Asset import Asset + +class Streetlight(Asset): + """Streetlight asset.Streetlight asset. + """ + + def __init__(self, armLength=0.0, lampKind="metalHalide", lightRating=0.0, Pole=None, *args, **kw_args): + """Initialises a new 'Streetlight' instance. + + @param armLength: Length of arm. Note that a new light may be placed on an existing arm. + @param lampKind: Lamp kind. Values are: "metalHalide", "highPressureSodium", "other", "mercuryVapor" + @param lightRating: Power rating of light. + @param Pole: Streetlight(s) may be attached to a pole. + """ + #: Length of arm. Note that a new light may be placed on an existing arm. + self.armLength = armLength + + #: Lamp kind. Values are: "metalHalide", "highPressureSodium", "other", "mercuryVapor" + self.lampKind = lampKind + + #: Power rating of light. + self.lightRating = lightRating + + self._Pole = None + self.Pole = Pole + + super(Streetlight, self).__init__(*args, **kw_args) + + _attrs = ["armLength", "lampKind", "lightRating"] + _attr_types = {"armLength": float, "lampKind": str, "lightRating": float} + _defaults = {"armLength": 0.0, "lampKind": "metalHalide", "lightRating": 0.0} + _enums = {"lampKind": "StreetlightLampKind"} + _refs = ["Pole"] + _many_refs = [] + + def getPole(self): + """Streetlight(s) may be attached to a pole. + """ + return self._Pole + + def setPole(self, value): + if self._Pole is not None: + filtered = [x for x in self.Pole.Streetlights if x != self] + self._Pole._Streetlights = filtered + + self._Pole = value + if self._Pole is not None: + if self not in self._Pole._Streetlights: + self._Pole._Streetlights.append(self) + + Pole = property(getPole, setPole) + diff --git a/CIM16/IEC61970/Informative/InfAssets/Structure.py b/CIM16/IEC61970/Informative/InfAssets/Structure.py new file mode 100755 index 00000000..af09da49 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/Structure.py @@ -0,0 +1,123 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetContainer import AssetContainer + +class Structure(AssetContainer): + """Construction holding assets such as conductors, transformers, switchgear, etc.Construction holding assets such as conductors, transformers, switchgear, etc. + """ + + def __init__(self, ratedVoltage=0.0, fumigantAppliedDate='', weedRemovedDate='', removeWeed=False, height=0.0, fumigantName='', materialKind="wood", StructureSupportInfos=None, MountingConnections=None, *args, **kw_args): + """Initialises a new 'Structure' instance. + + @param ratedVoltage: Maximum rated voltage of the equipment that can be mounted on/contained within the structure. + @param fumigantAppliedDate: Date fumigant was last applied. + @param weedRemovedDate: Date weed were last removed. + @param removeWeed: True if weeds are to be removed around asset. + @param height: Visible height of structure above ground level for overhead construction (e.g., Pole or Tower) or below ground level for an underground vault, manhole, etc. Refer to associated DimensionPropertiesInfo for other types of dimensions. + @param fumigantName: Name of fumigant. + @param materialKind: Material this structure is made of. Values are: "wood", "concrete", "steel", "other" + @param StructureSupportInfos: + @param MountingConnections: + """ + #: Maximum rated voltage of the equipment that can be mounted on/contained within the structure. + self.ratedVoltage = ratedVoltage + + #: Date fumigant was last applied. + self.fumigantAppliedDate = fumigantAppliedDate + + #: Date weed were last removed. + self.weedRemovedDate = weedRemovedDate + + #: True if weeds are to be removed around asset. + self.removeWeed = removeWeed + + #: Visible height of structure above ground level for overhead construction (e.g., Pole or Tower) or below ground level for an underground vault, manhole, etc. Refer to associated DimensionPropertiesInfo for other types of dimensions. + self.height = height + + #: Name of fumigant. + self.fumigantName = fumigantName + + #: Material this structure is made of. Values are: "wood", "concrete", "steel", "other" + self.materialKind = materialKind + + self._StructureSupportInfos = [] + self.StructureSupportInfos = [] if StructureSupportInfos is None else StructureSupportInfos + + self._MountingConnections = [] + self.MountingConnections = [] if MountingConnections is None else MountingConnections + + super(Structure, self).__init__(*args, **kw_args) + + _attrs = ["ratedVoltage", "fumigantAppliedDate", "weedRemovedDate", "removeWeed", "height", "fumigantName", "materialKind"] + _attr_types = {"ratedVoltage": float, "fumigantAppliedDate": str, "weedRemovedDate": str, "removeWeed": bool, "height": float, "fumigantName": str, "materialKind": str} + _defaults = {"ratedVoltage": 0.0, "fumigantAppliedDate": '', "weedRemovedDate": '', "removeWeed": False, "height": 0.0, "fumigantName": '', "materialKind": "wood"} + _enums = {"materialKind": "StructureMaterialKind"} + _refs = ["StructureSupportInfos", "MountingConnections"] + _many_refs = ["StructureSupportInfos", "MountingConnections"] + + def getStructureSupportInfos(self): + + return self._StructureSupportInfos + + def setStructureSupportInfos(self, value): + for x in self._StructureSupportInfos: + x.SecuredStructure = None + for y in value: + y._SecuredStructure = self + self._StructureSupportInfos = value + + StructureSupportInfos = property(getStructureSupportInfos, setStructureSupportInfos) + + def addStructureSupportInfos(self, *StructureSupportInfos): + for obj in StructureSupportInfos: + obj.SecuredStructure = self + + def removeStructureSupportInfos(self, *StructureSupportInfos): + for obj in StructureSupportInfos: + obj.SecuredStructure = None + + def getMountingConnections(self): + + return self._MountingConnections + + def setMountingConnections(self, value): + for p in self._MountingConnections: + filtered = [q for q in p.StructureInfos if q != self] + self._MountingConnections._StructureInfos = filtered + for r in value: + if self not in r._StructureInfos: + r._StructureInfos.append(self) + self._MountingConnections = value + + MountingConnections = property(getMountingConnections, setMountingConnections) + + def addMountingConnections(self, *MountingConnections): + for obj in MountingConnections: + if self not in obj._StructureInfos: + obj._StructureInfos.append(self) + self._MountingConnections.append(obj) + + def removeMountingConnections(self, *MountingConnections): + for obj in MountingConnections: + if self in obj._StructureInfos: + obj._StructureInfos.remove(self) + self._MountingConnections.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfAssets/StructureSupport.py b/CIM16/IEC61970/Informative/InfAssets/StructureSupport.py new file mode 100755 index 00000000..3f68f23e --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/StructureSupport.py @@ -0,0 +1,87 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.Asset import Asset + +class StructureSupport(Asset): + """Support for structure assets.Support for structure assets. + """ + + def __init__(self, anchorRodCount=0, length=0.0, anchorRodLength=0.0, direction=0.0, anchorKind="concrete", kind="guy", size='', SecuredStructure=None, *args, **kw_args): + """Initialises a new 'StructureSupport' instance. + + @param anchorRodCount: (if anchor) Number of rods used. + @param length: Length of this support structure. + @param anchorRodLength: (if anchor) Length of rod used. + @param direction: Direction of this support structure. + @param anchorKind: (if anchor) Kind of anchor. Values are: "concrete", "helix", "unknown", "multiHelix", "screw", "rod", "other" + @param kind: Kind of structure support. Values are: "guy", "anchor" + @param size: Size of this support structure. + @param SecuredStructure: + """ + #: (if anchor) Number of rods used. + self.anchorRodCount = anchorRodCount + + #: Length of this support structure. + self.length = length + + #: (if anchor) Length of rod used. + self.anchorRodLength = anchorRodLength + + #: Direction of this support structure. + self.direction = direction + + #: (if anchor) Kind of anchor. Values are: "concrete", "helix", "unknown", "multiHelix", "screw", "rod", "other" + self.anchorKind = anchorKind + + #: Kind of structure support. Values are: "guy", "anchor" + self.kind = kind + + #: Size of this support structure. + self.size = size + + self._SecuredStructure = None + self.SecuredStructure = SecuredStructure + + super(StructureSupport, self).__init__(*args, **kw_args) + + _attrs = ["anchorRodCount", "length", "anchorRodLength", "direction", "anchorKind", "kind", "size"] + _attr_types = {"anchorRodCount": int, "length": float, "anchorRodLength": float, "direction": float, "anchorKind": str, "kind": str, "size": str} + _defaults = {"anchorRodCount": 0, "length": 0.0, "anchorRodLength": 0.0, "direction": 0.0, "anchorKind": "concrete", "kind": "guy", "size": ''} + _enums = {"anchorKind": "AnchorKind", "kind": "StructureSupportKind"} + _refs = ["SecuredStructure"] + _many_refs = [] + + def getSecuredStructure(self): + + return self._SecuredStructure + + def setSecuredStructure(self, value): + if self._SecuredStructure is not None: + filtered = [x for x in self.SecuredStructure.StructureSupportInfos if x != self] + self._SecuredStructure._StructureSupportInfos = filtered + + self._SecuredStructure = value + if self._SecuredStructure is not None: + if self not in self._SecuredStructure._StructureSupportInfos: + self._SecuredStructure._StructureSupportInfos.append(self) + + SecuredStructure = property(getSecuredStructure, setSecuredStructure) + diff --git a/CIM16/IEC61970/Informative/InfAssets/SubstationAsset.py b/CIM16/IEC61970/Informative/InfAssets/SubstationAsset.py new file mode 100755 index 00000000..cffa43a2 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/SubstationAsset.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.Asset import Asset + +class SubstationAsset(Asset): + """Substation asset.Substation asset. + """ + + def __init__(self, function="transmission", *args, **kw_args): + """Initialises a new 'SubstationAsset' instance. + + @param function: Function of this substation asset. Values are: "transmission", "distribution", "other", "generation", "subTransmission", "industrial" + """ + #: Function of this substation asset. Values are: "transmission", "distribution", "other", "generation", "subTransmission", "industrial" + self.function = function + + super(SubstationAsset, self).__init__(*args, **kw_args) + + _attrs = ["function"] + _attr_types = {"function": str} + _defaults = {"function": "transmission"} + _enums = {"function": "SubstationFunctionKind"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/SurgeProtectorInfo.py b/CIM16/IEC61970/Informative/InfAssets/SurgeProtectorInfo.py new file mode 100755 index 00000000..0b1c9624 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/SurgeProtectorInfo.py @@ -0,0 +1,81 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class SurgeProtectorInfo(AssetInfo): + """Properties of surge protector asset.Properties of surge protector asset. + """ + + def __init__(self, maxCurrentRating=0.0, maxContinousOperatingVoltage=0.0, nominalDesignVoltage=0.0, maxEnergyAbsorption=0.0, SurgeProtectors=None, *args, **kw_args): + """Initialises a new 'SurgeProtectorInfo' instance. + + @param maxCurrentRating: + @param maxContinousOperatingVoltage: + @param nominalDesignVoltage: + @param maxEnergyAbsorption: + @param SurgeProtectors: All surge protectors described by this data. + """ + + self.maxCurrentRating = maxCurrentRating + + + self.maxContinousOperatingVoltage = maxContinousOperatingVoltage + + + self.nominalDesignVoltage = nominalDesignVoltage + + + self.maxEnergyAbsorption = maxEnergyAbsorption + + self._SurgeProtectors = [] + self.SurgeProtectors = [] if SurgeProtectors is None else SurgeProtectors + + super(SurgeProtectorInfo, self).__init__(*args, **kw_args) + + _attrs = ["maxCurrentRating", "maxContinousOperatingVoltage", "nominalDesignVoltage", "maxEnergyAbsorption"] + _attr_types = {"maxCurrentRating": float, "maxContinousOperatingVoltage": float, "nominalDesignVoltage": float, "maxEnergyAbsorption": float} + _defaults = {"maxCurrentRating": 0.0, "maxContinousOperatingVoltage": 0.0, "nominalDesignVoltage": 0.0, "maxEnergyAbsorption": 0.0} + _enums = {} + _refs = ["SurgeProtectors"] + _many_refs = ["SurgeProtectors"] + + def getSurgeProtectors(self): + """All surge protectors described by this data. + """ + return self._SurgeProtectors + + def setSurgeProtectors(self, value): + for x in self._SurgeProtectors: + x.SurgeProtectorInfo = None + for y in value: + y._SurgeProtectorInfo = self + self._SurgeProtectors = value + + SurgeProtectors = property(getSurgeProtectors, setSurgeProtectors) + + def addSurgeProtectors(self, *SurgeProtectors): + for obj in SurgeProtectors: + obj.SurgeProtectorInfo = self + + def removeSurgeProtectors(self, *SurgeProtectors): + for obj in SurgeProtectors: + obj.SurgeProtectorInfo = None + diff --git a/CIM16/IEC61970/Informative/InfAssets/SwitchInfo.py b/CIM16/IEC61970/Informative/InfAssets/SwitchInfo.py new file mode 100755 index 00000000..6bdfde16 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/SwitchInfo.py @@ -0,0 +1,75 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.AssetInfo import AssetInfo + +class SwitchInfo(AssetInfo): + """Properties of switch assets.Properties of switch assets. + """ + + def __init__(self, dielectricStrength=0.0, gang=False, makingCapacity=0.0, withstandCurrent=0.0, loadBreak=False, minimumCurrent=0.0, interruptingRating=0.0, remote=False, poleCount=0, *args, **kw_args): + """Initialises a new 'SwitchInfo' instance. + + @param dielectricStrength: The maximum rms voltage that may be applied across an open contact without breaking down the dielectric properties of the switch in the open position. + @param gang: True if multi-phase switch controls all phases concurrently. + @param makingCapacity: The highest value of current the switch can make at the rated voltage under specified operating conditions without suffering significant deterioration of its performance. + @param withstandCurrent: The highest value of current the switch can carry in the closed position at the rated voltage under specified operating conditions without suffering significant deterioration of its performance. + @param loadBreak: True if switch has load breaking capabiity. Unless specified false, this is always assumed to be true for breakers and reclosers. + @param minimumCurrent: The lowest value of current that the switch can make, carry and break in uninterrupted duty at the rated voltage under specified operating conditions without suffering significant deterioration of its performance. + @param interruptingRating: Breaking capacity, or short circuit rating, is the maximum rated current which the device can safely interrupt at the rated voltage. + @param remote: True if device is capable of being operated by remote control. + @param poleCount: Number of poles (i.e. of current carrying conductors that are switched). + """ + #: The maximum rms voltage that may be applied across an open contact without breaking down the dielectric properties of the switch in the open position. + self.dielectricStrength = dielectricStrength + + #: True if multi-phase switch controls all phases concurrently. + self.gang = gang + + #: The highest value of current the switch can make at the rated voltage under specified operating conditions without suffering significant deterioration of its performance. + self.makingCapacity = makingCapacity + + #: The highest value of current the switch can carry in the closed position at the rated voltage under specified operating conditions without suffering significant deterioration of its performance. + self.withstandCurrent = withstandCurrent + + #: True if switch has load breaking capabiity. Unless specified false, this is always assumed to be true for breakers and reclosers. + self.loadBreak = loadBreak + + #: The lowest value of current that the switch can make, carry and break in uninterrupted duty at the rated voltage under specified operating conditions without suffering significant deterioration of its performance. + self.minimumCurrent = minimumCurrent + + #: Breaking capacity, or short circuit rating, is the maximum rated current which the device can safely interrupt at the rated voltage. + self.interruptingRating = interruptingRating + + #: True if device is capable of being operated by remote control. + self.remote = remote + + #: Number of poles (i.e. of current carrying conductors that are switched). + self.poleCount = poleCount + + super(SwitchInfo, self).__init__(*args, **kw_args) + + _attrs = ["dielectricStrength", "gang", "makingCapacity", "withstandCurrent", "loadBreak", "minimumCurrent", "interruptingRating", "remote", "poleCount"] + _attr_types = {"dielectricStrength": float, "gang": bool, "makingCapacity": float, "withstandCurrent": float, "loadBreak": bool, "minimumCurrent": float, "interruptingRating": float, "remote": bool, "poleCount": int} + _defaults = {"dielectricStrength": 0.0, "gang": False, "makingCapacity": 0.0, "withstandCurrent": 0.0, "loadBreak": False, "minimumCurrent": 0.0, "interruptingRating": 0.0, "remote": False, "poleCount": 0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/TestDataSet.py b/CIM16/IEC61970/Informative/InfAssets/TestDataSet.py new file mode 100755 index 00000000..d1906d8c --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/TestDataSet.py @@ -0,0 +1,51 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfAssets.ProcedureDataSet import ProcedureDataSet + +class TestDataSet(ProcedureDataSet): + """Test results, usually obtained by a lab or other independent organisation.Test results, usually obtained by a lab or other independent organisation. + """ + + def __init__(self, specimenToLabDateTime='', conclusion='', specimenID='', *args, **kw_args): + """Initialises a new 'TestDataSet' instance. + + @param specimenToLabDateTime: Date and time the specimen was received by the lab. + @param conclusion: Conclusion drawn from test results. + @param specimenID: Identifier of specimen used in inspection or test. + """ + #: Date and time the specimen was received by the lab. + self.specimenToLabDateTime = specimenToLabDateTime + + #: Conclusion drawn from test results. + self.conclusion = conclusion + + #: Identifier of specimen used in inspection or test. + self.specimenID = specimenID + + super(TestDataSet, self).__init__(*args, **kw_args) + + _attrs = ["specimenToLabDateTime", "conclusion", "specimenID"] + _attr_types = {"specimenToLabDateTime": str, "conclusion": str, "specimenID": str} + _defaults = {"specimenToLabDateTime": '', "conclusion": '', "specimenID": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/Tool.py b/CIM16/IEC61970/Informative/InfAssets/Tool.py new file mode 100755 index 00000000..dc0d00fe --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/Tool.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.Asset import Asset + +class Tool(Asset): + """Tool asset.Tool asset. + """ + + def __init__(self, lastCalibrationDate='', Crew=None, *args, **kw_args): + """Initialises a new 'Tool' instance. + + @param lastCalibrationDate: Date the tool was last caibrated, if applicable. + @param Crew: + """ + #: Date the tool was last caibrated, if applicable. + self.lastCalibrationDate = lastCalibrationDate + + self._Crew = None + self.Crew = Crew + + super(Tool, self).__init__(*args, **kw_args) + + _attrs = ["lastCalibrationDate"] + _attr_types = {"lastCalibrationDate": str} + _defaults = {"lastCalibrationDate": ''} + _enums = {} + _refs = ["Crew"] + _many_refs = [] + + def getCrew(self): + + return self._Crew + + def setCrew(self, value): + if self._Crew is not None: + filtered = [x for x in self.Crew.Tools if x != self] + self._Crew._Tools = filtered + + self._Crew = value + if self._Crew is not None: + if self not in self._Crew._Tools: + self._Crew._Tools.append(self) + + Crew = property(getCrew, setCrew) + diff --git a/CIM16/IEC61970/Informative/InfAssets/Tower.py b/CIM16/IEC61970/Informative/InfAssets/Tower.py new file mode 100755 index 00000000..cb91593c --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/Tower.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfAssets.Structure import Structure + +class Tower(Structure): + """Tower asset. Dimensions of the Tower are specified in associated DimensionsInfo class. When used for planning purposes, a transmission tower carrying two 3-phase circuits will have 2 instances of Connection, each of which will have 3 MountingPoint instances, one for each phase all with coordinates relative to a common origin on the tower. (It may also have a 3rd Connection with a single MountingPoint for the Neutral line).Tower asset. Dimensions of the Tower are specified in associated DimensionsInfo class. When used for planning purposes, a transmission tower carrying two 3-phase circuits will have 2 instances of Connection, each of which will have 3 MountingPoint instances, one for each phase all with coordinates relative to a common origin on the tower. (It may also have a 3rd Connection with a single MountingPoint for the Neutral line). + """ + + def __init__(self, constructionKind="suspension", *args, **kw_args): + """Initialises a new 'Tower' instance. + + @param constructionKind: Construction structure on the tower. Values are: "suspension", "tension" + """ + #: Construction structure on the tower. Values are: "suspension", "tension" + self.constructionKind = constructionKind + + super(Tower, self).__init__(*args, **kw_args) + + _attrs = ["constructionKind"] + _attr_types = {"constructionKind": str} + _defaults = {"constructionKind": "suspension"} + _enums = {"constructionKind": "TowerConstructionKind"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/TransformerAsset.py b/CIM16/IEC61970/Informative/InfAssets/TransformerAsset.py new file mode 100755 index 00000000..8b02a993 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/TransformerAsset.py @@ -0,0 +1,139 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.Asset import Asset + +class TransformerAsset(Asset): + """A specific physical (vs. logical) transformer.A specific physical (vs. logical) transformer. + """ + + def __init__(self, reconditionedDateTime='', PowerRatings=None, TransformerObservations=None, TransformerInfo=None, TransformerAssetModel=None, *args, **kw_args): + """Initialises a new 'TransformerAsset' instance. + + @param reconditionedDateTime: Date and time this asset was last reconditioned or had a major overhaul. + @param PowerRatings: + @param TransformerObservations: + @param TransformerInfo: + @param TransformerAssetModel: + """ + #: Date and time this asset was last reconditioned or had a major overhaul. + self.reconditionedDateTime = reconditionedDateTime + + self._PowerRatings = [] + self.PowerRatings = [] if PowerRatings is None else PowerRatings + + self._TransformerObservations = [] + self.TransformerObservations = [] if TransformerObservations is None else TransformerObservations + + self._TransformerInfo = None + self.TransformerInfo = TransformerInfo + + self._TransformerAssetModel = None + self.TransformerAssetModel = TransformerAssetModel + + super(TransformerAsset, self).__init__(*args, **kw_args) + + _attrs = ["reconditionedDateTime"] + _attr_types = {"reconditionedDateTime": str} + _defaults = {"reconditionedDateTime": ''} + _enums = {} + _refs = ["PowerRatings", "TransformerObservations", "TransformerInfo", "TransformerAssetModel"] + _many_refs = ["PowerRatings", "TransformerObservations"] + + def getPowerRatings(self): + + return self._PowerRatings + + def setPowerRatings(self, value): + for p in self._PowerRatings: + filtered = [q for q in p.TransformerAssets if q != self] + self._PowerRatings._TransformerAssets = filtered + for r in value: + if self not in r._TransformerAssets: + r._TransformerAssets.append(self) + self._PowerRatings = value + + PowerRatings = property(getPowerRatings, setPowerRatings) + + def addPowerRatings(self, *PowerRatings): + for obj in PowerRatings: + if self not in obj._TransformerAssets: + obj._TransformerAssets.append(self) + self._PowerRatings.append(obj) + + def removePowerRatings(self, *PowerRatings): + for obj in PowerRatings: + if self in obj._TransformerAssets: + obj._TransformerAssets.remove(self) + self._PowerRatings.remove(obj) + + def getTransformerObservations(self): + + return self._TransformerObservations + + def setTransformerObservations(self, value): + for x in self._TransformerObservations: + x.TransformerAsset = None + for y in value: + y._TransformerAsset = self + self._TransformerObservations = value + + TransformerObservations = property(getTransformerObservations, setTransformerObservations) + + def addTransformerObservations(self, *TransformerObservations): + for obj in TransformerObservations: + obj.TransformerAsset = self + + def removeTransformerObservations(self, *TransformerObservations): + for obj in TransformerObservations: + obj.TransformerAsset = None + + def getTransformerInfo(self): + + return self._TransformerInfo + + def setTransformerInfo(self, value): + if self._TransformerInfo is not None: + filtered = [x for x in self.TransformerInfo.TransformerAssets if x != self] + self._TransformerInfo._TransformerAssets = filtered + + self._TransformerInfo = value + if self._TransformerInfo is not None: + if self not in self._TransformerInfo._TransformerAssets: + self._TransformerInfo._TransformerAssets.append(self) + + TransformerInfo = property(getTransformerInfo, setTransformerInfo) + + def getTransformerAssetModel(self): + + return self._TransformerAssetModel + + def setTransformerAssetModel(self, value): + if self._TransformerAssetModel is not None: + filtered = [x for x in self.TransformerAssetModel.TransformerAssets if x != self] + self._TransformerAssetModel._TransformerAssets = filtered + + self._TransformerAssetModel = value + if self._TransformerAssetModel is not None: + if self not in self._TransformerAssetModel._TransformerAssets: + self._TransformerAssetModel._TransformerAssets.append(self) + + TransformerAssetModel = property(getTransformerAssetModel, setTransformerAssetModel) + diff --git a/CIM16/IEC61970/Informative/InfAssets/TransformerObservation.py b/CIM16/IEC61970/Informative/InfAssets/TransformerObservation.py new file mode 100755 index 00000000..4ce461a3 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/TransformerObservation.py @@ -0,0 +1,217 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerObservation(IdentifiedObject): + """Common information captured during transformer inspections and/or diagnostics. Note that some properties may be measured through other means and therefore have measurement values in addition to the observed values recorded here.Common information captured during transformer inspections and/or diagnostics. Note that some properties may be measured through other means and therefore have measurement values in addition to the observed values recorded here. + """ + + def __init__(self, oilNeutralizationNumber='', waterContent='', oilLevel='', freqResp='', oilDielectricStrength=0.0, oilColor='', hotSpotTemp=0.0, dga='', furfuralDP='', oilIFT='', bushingTemp=0.0, topOilTemp=0.0, pumpVibration='', BushingInsultationPFs=None, ProcedureDataSets=None, Transformer=None, status=None, WindingInsulationPFs=None, TransformerAsset=None, *args, **kw_args): + """Initialises a new 'TransformerObservation' instance. + + @param oilNeutralizationNumber: Oil Quality Analysis-Neutralization Number - Number - Mg KOH. + @param waterContent: Water Content expressed in parts per million. + @param oilLevel: The level of oil in the transformer. + @param freqResp: Frequency Response Analysis. Typical values are: acceptable, slight movement, significant movement, failed, near failure. A graphic of the response diagram, which is a type of document, may be associated with this analysis through the recursive document relationship of the ProcedureDataSet. + @param oilDielectricStrength: Oil Quality Analysis-Dielectric Strength. + @param oilColor: Oil Quality Analysis-Color. + @param hotSpotTemp: Hotspot oil temperature. + @param dga: Dissolved Gas Analysis. Typical values are: Acceptable, Overheating, Corona, Sparking, Arcing. + @param furfuralDP: Overall measure of furfural in oil and mechanical strength of paper. DP, the degree of polymerization, is the strength of the paper. Furfural is a measure of furfural compounds, often expressed in parts per million. + @param oilIFT: Oil Quality Analysis- inter facial tension (IFT) - number-Dynes/CM. + @param bushingTemp: Bushing temperature. + @param topOilTemp: Top oil temperature. + @param pumpVibration: Pump vibration, with typical values being: nominal, high. + @param BushingInsultationPFs: + @param ProcedureDataSets: + @param Transformer: + @param status: + @param WindingInsulationPFs: + @param TransformerAsset: + """ + #: Oil Quality Analysis-Neutralization Number - Number - Mg KOH. + self.oilNeutralizationNumber = oilNeutralizationNumber + + #: Water Content expressed in parts per million. + self.waterContent = waterContent + + #: The level of oil in the transformer. + self.oilLevel = oilLevel + + #: Frequency Response Analysis. Typical values are: acceptable, slight movement, significant movement, failed, near failure. A graphic of the response diagram, which is a type of document, may be associated with this analysis through the recursive document relationship of the ProcedureDataSet. + self.freqResp = freqResp + + #: Oil Quality Analysis-Dielectric Strength. + self.oilDielectricStrength = oilDielectricStrength + + #: Oil Quality Analysis-Color. + self.oilColor = oilColor + + #: Hotspot oil temperature. + self.hotSpotTemp = hotSpotTemp + + #: Dissolved Gas Analysis. Typical values are: Acceptable, Overheating, Corona, Sparking, Arcing. + self.dga = dga + + #: Overall measure of furfural in oil and mechanical strength of paper. DP, the degree of polymerization, is the strength of the paper. Furfural is a measure of furfural compounds, often expressed in parts per million. + self.furfuralDP = furfuralDP + + #: Oil Quality Analysis- inter facial tension (IFT) - number-Dynes/CM. + self.oilIFT = oilIFT + + #: Bushing temperature. + self.bushingTemp = bushingTemp + + #: Top oil temperature. + self.topOilTemp = topOilTemp + + #: Pump vibration, with typical values being: nominal, high. + self.pumpVibration = pumpVibration + + self._BushingInsultationPFs = [] + self.BushingInsultationPFs = [] if BushingInsultationPFs is None else BushingInsultationPFs + + self._ProcedureDataSets = [] + self.ProcedureDataSets = [] if ProcedureDataSets is None else ProcedureDataSets + + self._Transformer = None + self.Transformer = Transformer + + self.status = status + + self._WindingInsulationPFs = [] + self.WindingInsulationPFs = [] if WindingInsulationPFs is None else WindingInsulationPFs + + self._TransformerAsset = None + self.TransformerAsset = TransformerAsset + + super(TransformerObservation, self).__init__(*args, **kw_args) + + _attrs = ["oilNeutralizationNumber", "waterContent", "oilLevel", "freqResp", "oilDielectricStrength", "oilColor", "hotSpotTemp", "dga", "furfuralDP", "oilIFT", "bushingTemp", "topOilTemp", "pumpVibration"] + _attr_types = {"oilNeutralizationNumber": str, "waterContent": str, "oilLevel": str, "freqResp": str, "oilDielectricStrength": float, "oilColor": str, "hotSpotTemp": float, "dga": str, "furfuralDP": str, "oilIFT": str, "bushingTemp": float, "topOilTemp": float, "pumpVibration": str} + _defaults = {"oilNeutralizationNumber": '', "waterContent": '', "oilLevel": '', "freqResp": '', "oilDielectricStrength": 0.0, "oilColor": '', "hotSpotTemp": 0.0, "dga": '', "furfuralDP": '', "oilIFT": '', "bushingTemp": 0.0, "topOilTemp": 0.0, "pumpVibration": ''} + _enums = {} + _refs = ["BushingInsultationPFs", "ProcedureDataSets", "Transformer", "status", "WindingInsulationPFs", "TransformerAsset"] + _many_refs = ["BushingInsultationPFs", "ProcedureDataSets", "WindingInsulationPFs"] + + def getBushingInsultationPFs(self): + + return self._BushingInsultationPFs + + def setBushingInsultationPFs(self, value): + for x in self._BushingInsultationPFs: + x.TransformerObservation = None + for y in value: + y._TransformerObservation = self + self._BushingInsultationPFs = value + + BushingInsultationPFs = property(getBushingInsultationPFs, setBushingInsultationPFs) + + def addBushingInsultationPFs(self, *BushingInsultationPFs): + for obj in BushingInsultationPFs: + obj.TransformerObservation = self + + def removeBushingInsultationPFs(self, *BushingInsultationPFs): + for obj in BushingInsultationPFs: + obj.TransformerObservation = None + + def getProcedureDataSets(self): + + return self._ProcedureDataSets + + def setProcedureDataSets(self, value): + for p in self._ProcedureDataSets: + filtered = [q for q in p.TransformerObservations if q != self] + self._ProcedureDataSets._TransformerObservations = filtered + for r in value: + if self not in r._TransformerObservations: + r._TransformerObservations.append(self) + self._ProcedureDataSets = value + + ProcedureDataSets = property(getProcedureDataSets, setProcedureDataSets) + + def addProcedureDataSets(self, *ProcedureDataSets): + for obj in ProcedureDataSets: + if self not in obj._TransformerObservations: + obj._TransformerObservations.append(self) + self._ProcedureDataSets.append(obj) + + def removeProcedureDataSets(self, *ProcedureDataSets): + for obj in ProcedureDataSets: + if self in obj._TransformerObservations: + obj._TransformerObservations.remove(self) + self._ProcedureDataSets.remove(obj) + + def getTransformer(self): + + return self._Transformer + + def setTransformer(self, value): + if self._Transformer is not None: + filtered = [x for x in self.Transformer.TransformerObservations if x != self] + self._Transformer._TransformerObservations = filtered + + self._Transformer = value + if self._Transformer is not None: + if self not in self._Transformer._TransformerObservations: + self._Transformer._TransformerObservations.append(self) + + Transformer = property(getTransformer, setTransformer) + + status = None + + def getWindingInsulationPFs(self): + + return self._WindingInsulationPFs + + def setWindingInsulationPFs(self, value): + for x in self._WindingInsulationPFs: + x.TransformerObservation = None + for y in value: + y._TransformerObservation = self + self._WindingInsulationPFs = value + + WindingInsulationPFs = property(getWindingInsulationPFs, setWindingInsulationPFs) + + def addWindingInsulationPFs(self, *WindingInsulationPFs): + for obj in WindingInsulationPFs: + obj.TransformerObservation = self + + def removeWindingInsulationPFs(self, *WindingInsulationPFs): + for obj in WindingInsulationPFs: + obj.TransformerObservation = None + + def getTransformerAsset(self): + + return self._TransformerAsset + + def setTransformerAsset(self, value): + if self._TransformerAsset is not None: + filtered = [x for x in self.TransformerAsset.TransformerObservations if x != self] + self._TransformerAsset._TransformerObservations = filtered + + self._TransformerAsset = value + if self._TransformerAsset is not None: + if self not in self._TransformerAsset._TransformerObservations: + self._TransformerAsset._TransformerObservations.append(self) + + TransformerAsset = property(getTransformerAsset, setTransformerAsset) + diff --git a/CIM16/IEC61970/Informative/InfAssets/UndergroundStructure.py b/CIM16/IEC61970/Informative/InfAssets/UndergroundStructure.py new file mode 100755 index 00000000..63ee1c5c --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/UndergroundStructure.py @@ -0,0 +1,55 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfAssets.Structure import Structure + +class UndergroundStructure(Structure): + """Underground structure.Underground structure. + """ + + def __init__(self, hasVentilation=False, kind="trench", material='', sealingWarrantyExpiresDate='', *args, **kw_args): + """Initialises a new 'UndergroundStructure' instance. + + @param hasVentilation: True if vault is ventilating. + @param kind: True if vault is ventilating. Values are: "trench", "pullbox", "vault", "burd", "subsurfaceEnclosure", "handhole", "enclosure", "tunnel", "manhole", "pad" + @param material: Primary material of underground structure. + @param sealingWarrantyExpiresDate: Date sealing warranty expires. + """ + #: True if vault is ventilating. + self.hasVentilation = hasVentilation + + #: True if vault is ventilating. Values are: "trench", "pullbox", "vault", "burd", "subsurfaceEnclosure", "handhole", "enclosure", "tunnel", "manhole", "pad" + self.kind = kind + + #: Primary material of underground structure. + self.material = material + + #: Date sealing warranty expires. + self.sealingWarrantyExpiresDate = sealingWarrantyExpiresDate + + super(UndergroundStructure, self).__init__(*args, **kw_args) + + _attrs = ["hasVentilation", "kind", "material", "sealingWarrantyExpiresDate"] + _attr_types = {"hasVentilation": bool, "kind": str, "material": str, "sealingWarrantyExpiresDate": str} + _defaults = {"hasVentilation": False, "kind": "trench", "material": '', "sealingWarrantyExpiresDate": ''} + _enums = {"kind": "UndergroundStructureKind"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfAssets/Vehicle.py b/CIM16/IEC61970/Informative/InfAssets/Vehicle.py new file mode 100755 index 00000000..bea6b195 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/Vehicle.py @@ -0,0 +1,71 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.Asset import Asset + +class Vehicle(Asset): + """Vehicle asset.Vehicle asset. + """ + + def __init__(self, odometerReading=0.0, odometerReadDateTime='', usageKind="crew", Crew=None, *args, **kw_args): + """Initialises a new 'Vehicle' instance. + + @param odometerReading: Odometer reading of this vehicle as of the 'odometerReadingDateTime'. Refer to associated ActivityRecords for earlier readings. + @param odometerReadDateTime: Date and time the last odometer reading was recorded. + @param usageKind: The general categorization type of vehicle as categorized by the utility's asset management standards and practices. Note: (1) Vehicle model is defined by AssetModel, and (2) Specific people and organizations and their roles relative to this vehicle may be determined by the inherited Asset-ErpPerson and Asset-ErpOrganization associations. Values are: "crew", "contractor", "user", "other" + @param Crew: + """ + #: Odometer reading of this vehicle as of the 'odometerReadingDateTime'. Refer to associated ActivityRecords for earlier readings. + self.odometerReading = odometerReading + + #: Date and time the last odometer reading was recorded. + self.odometerReadDateTime = odometerReadDateTime + + #: The general categorization type of vehicle as categorized by the utility's asset management standards and practices. Note: (1) Vehicle model is defined by AssetModel, and (2) Specific people and organizations and their roles relative to this vehicle may be determined by the inherited Asset-ErpPerson and Asset-ErpOrganization associations. Values are: "crew", "contractor", "user", "other" + self.usageKind = usageKind + + self._Crew = None + self.Crew = Crew + + super(Vehicle, self).__init__(*args, **kw_args) + + _attrs = ["odometerReading", "odometerReadDateTime", "usageKind"] + _attr_types = {"odometerReading": float, "odometerReadDateTime": str, "usageKind": str} + _defaults = {"odometerReading": 0.0, "odometerReadDateTime": '', "usageKind": "crew"} + _enums = {"usageKind": "VehicleUsageKind"} + _refs = ["Crew"] + _many_refs = [] + + def getCrew(self): + + return self._Crew + + def setCrew(self, value): + if self._Crew is not None: + filtered = [x for x in self.Crew.Vehicles if x != self] + self._Crew._Vehicles = filtered + + self._Crew = value + if self._Crew is not None: + if self not in self._Crew._Vehicles: + self._Crew._Vehicles.append(self) + + Crew = property(getCrew, setCrew) + diff --git a/CIM16/IEC61970/Informative/InfAssets/WindingInsulation.py b/CIM16/IEC61970/Informative/InfAssets/WindingInsulation.py new file mode 100755 index 00000000..f1b8b139 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/WindingInsulation.py @@ -0,0 +1,136 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class WindingInsulation(IdentifiedObject): + """Winding insulation condition as a result of a test.Winding insulation condition as a result of a test. + """ + + def __init__(self, insulationPFStatus='', insulationResistance='', leakageReactance=0.0, Ground=None, TransformerObservation=None, ToWinding=None, FromWinding=None, status=None, *args, **kw_args): + """Initialises a new 'WindingInsulation' instance. + + @param insulationPFStatus: Status of Winding Insulation Power Factor as of statusDate: Acceptable, Minor Deterioration or Moisture Absorption, Major Deterioration or Moisture Absorption, Failed. + @param insulationResistance: For testType, status of Winding Insulation Resistance as of statusDate. Typical values are: Acceptable, Questionable, Failed. + @param leakageReactance: As of statusDate, the leakage reactance measured at the 'from' winding with the 'to' winding short-circuited and all other windings open-circuited. + @param Ground: + @param TransformerObservation: + @param ToWinding: + @param FromWinding: + @param status: + """ + #: Status of Winding Insulation Power Factor as of statusDate: Acceptable, Minor Deterioration or Moisture Absorption, Major Deterioration or Moisture Absorption, Failed. + self.insulationPFStatus = insulationPFStatus + + #: For testType, status of Winding Insulation Resistance as of statusDate. Typical values are: Acceptable, Questionable, Failed. + self.insulationResistance = insulationResistance + + #: As of statusDate, the leakage reactance measured at the 'from' winding with the 'to' winding short-circuited and all other windings open-circuited. + self.leakageReactance = leakageReactance + + self._Ground = None + self.Ground = Ground + + self._TransformerObservation = None + self.TransformerObservation = TransformerObservation + + self._ToWinding = None + self.ToWinding = ToWinding + + self._FromWinding = None + self.FromWinding = FromWinding + + self.status = status + + super(WindingInsulation, self).__init__(*args, **kw_args) + + _attrs = ["insulationPFStatus", "insulationResistance", "leakageReactance"] + _attr_types = {"insulationPFStatus": str, "insulationResistance": str, "leakageReactance": float} + _defaults = {"insulationPFStatus": '', "insulationResistance": '', "leakageReactance": 0.0} + _enums = {} + _refs = ["Ground", "TransformerObservation", "ToWinding", "FromWinding", "status"] + _many_refs = [] + + def getGround(self): + + return self._Ground + + def setGround(self, value): + if self._Ground is not None: + filtered = [x for x in self.Ground.WindingInsulations if x != self] + self._Ground._WindingInsulations = filtered + + self._Ground = value + if self._Ground is not None: + if self not in self._Ground._WindingInsulations: + self._Ground._WindingInsulations.append(self) + + Ground = property(getGround, setGround) + + def getTransformerObservation(self): + + return self._TransformerObservation + + def setTransformerObservation(self, value): + if self._TransformerObservation is not None: + filtered = [x for x in self.TransformerObservation.WindingInsulationPFs if x != self] + self._TransformerObservation._WindingInsulationPFs = filtered + + self._TransformerObservation = value + if self._TransformerObservation is not None: + if self not in self._TransformerObservation._WindingInsulationPFs: + self._TransformerObservation._WindingInsulationPFs.append(self) + + TransformerObservation = property(getTransformerObservation, setTransformerObservation) + + def getToWinding(self): + + return self._ToWinding + + def setToWinding(self, value): + if self._ToWinding is not None: + filtered = [x for x in self.ToWinding.ToWindingInsulations if x != self] + self._ToWinding._ToWindingInsulations = filtered + + self._ToWinding = value + if self._ToWinding is not None: + if self not in self._ToWinding._ToWindingInsulations: + self._ToWinding._ToWindingInsulations.append(self) + + ToWinding = property(getToWinding, setToWinding) + + def getFromWinding(self): + + return self._FromWinding + + def setFromWinding(self, value): + if self._FromWinding is not None: + filtered = [x for x in self.FromWinding.FromWindingInsulations if x != self] + self._FromWinding._FromWindingInsulations = filtered + + self._FromWinding = value + if self._FromWinding is not None: + if self not in self._FromWinding._FromWindingInsulations: + self._FromWinding._FromWindingInsulations.append(self) + + FromWinding = property(getFromWinding, setFromWinding) + + status = None + diff --git a/CIM16/IEC61970/Informative/InfAssets/WorkEquipment.py b/CIM16/IEC61970/Informative/InfAssets/WorkEquipment.py new file mode 100755 index 00000000..eae026df --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/WorkEquipment.py @@ -0,0 +1,84 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Assets.Asset import Asset + +class WorkEquipment(Asset): + """Equipment used to perform units of work by crews, office staff, etc.Equipment used to perform units of work by crews, office staff, etc. + """ + + def __init__(self, Crew=None, Usages=None, *args, **kw_args): + """Initialises a new 'WorkEquipment' instance. + + @param Crew: + @param Usages: + """ + self._Crew = None + self.Crew = Crew + + self._Usages = [] + self.Usages = [] if Usages is None else Usages + + super(WorkEquipment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Crew", "Usages"] + _many_refs = ["Usages"] + + def getCrew(self): + + return self._Crew + + def setCrew(self, value): + if self._Crew is not None: + filtered = [x for x in self.Crew.WorkEquipmentAssets if x != self] + self._Crew._WorkEquipmentAssets = filtered + + self._Crew = value + if self._Crew is not None: + if self not in self._Crew._WorkEquipmentAssets: + self._Crew._WorkEquipmentAssets.append(self) + + Crew = property(getCrew, setCrew) + + def getUsages(self): + + return self._Usages + + def setUsages(self, value): + for x in self._Usages: + x.WorkEquipmentAsset = None + for y in value: + y._WorkEquipmentAsset = self + self._Usages = value + + Usages = property(getUsages, setUsages) + + def addUsages(self, *Usages): + for obj in Usages: + obj.WorkEquipmentAsset = self + + def removeUsages(self, *Usages): + for obj in Usages: + obj.WorkEquipmentAsset = None + diff --git a/CIM16/IEC61970/Informative/InfAssets/__init__.py b/CIM16/IEC61970/Informative/InfAssets/__init__.py new file mode 100755 index 00000000..bfddb0be --- /dev/null +++ b/CIM16/IEC61970/Informative/InfAssets/__init__.py @@ -0,0 +1,210 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The package is used to define asset-level models for objects. Assets may be comprised of other assets and may have relationships to other assets. Assets also have owners and values. Assets may also have a relationship to a PowerSystemResource in the Wires model. TODO: The following has been copied from a very old version of draft Part 11, so the references are wrong, but we store the knowledge here to reuse later: 'Assets are the basic units which define a physical infrastructure. PowerSystemResources are logical objects meaningful to operations which are constructed from one or more Assets, although PowerSystemResources are not required to specifiy their component Assets. The Asset package is comprosed of several packages. The key concepts of an Asset are as follows: The following sections describe the packages in the Assets package. The AssetBasics package defines the relationship between Asset and other classes, such as Organization, PowerSystemResource and Document. Point assets are those assets whose physical location can be described in terms of a single coordinate, such as a pole or a switch. Linear assets are those assets whose physical location is best described in terms of a line, plyline or polygon. Asset work triggers are used to determine when inspection and/or maintenance are required for assets.' +""" + +from CIM16.IEC61970.Informative.InfAssets.FACTSDevice import FACTSDevice +from CIM16.IEC61970.Informative.InfAssets.DocAssetRole import DocAssetRole +from CIM16.IEC61970.Informative.InfAssets.DuctBank import DuctBank +from CIM16.IEC61970.Informative.InfAssets.ConductorAsset import ConductorAsset +from CIM16.IEC61970.Informative.InfAssets.FinancialInfo import FinancialInfo +from CIM16.IEC61970.Informative.InfAssets.ProtectionEquipmentInfo import ProtectionEquipmentInfo +from CIM16.IEC61970.Informative.InfAssets.ProcedureDataSet import ProcedureDataSet +from CIM16.IEC61970.Informative.InfAssets.WindingInsulation import WindingInsulation +from CIM16.IEC61970.Informative.InfAssets.Specification import Specification +from CIM16.IEC61970.Informative.InfAssets.UndergroundStructure import UndergroundStructure +from CIM16.IEC61970.Informative.InfAssets.PotentialTransformerInfo import PotentialTransformerInfo +from CIM16.IEC61970.Informative.InfAssets.Structure import Structure +from CIM16.IEC61970.Informative.InfAssets.CurrentTransformerInfo import CurrentTransformerInfo +from CIM16.IEC61970.Informative.InfAssets.BushingInsulationPF import BushingInsulationPF +from CIM16.IEC61970.Informative.InfAssets.Joint import Joint +from CIM16.IEC61970.Informative.InfAssets.ElectricalInfo import ElectricalInfo +from CIM16.IEC61970.Informative.InfAssets.WorkEquipment import WorkEquipment +from CIM16.IEC61970.Informative.InfAssets.FaultIndicatorInfo import FaultIndicatorInfo +from CIM16.IEC61970.Informative.InfAssets.Duct import Duct +from CIM16.IEC61970.Informative.InfAssets.PowerRating import PowerRating +from CIM16.IEC61970.Informative.InfAssets.AssetAssetRole import AssetAssetRole +from CIM16.IEC61970.Informative.InfAssets.TransformerAsset import TransformerAsset +from CIM16.IEC61970.Informative.InfAssets.Procedure import Procedure +from CIM16.IEC61970.Informative.InfAssets.BreakerInfo import BreakerInfo +from CIM16.IEC61970.Informative.InfAssets.CompositeSwitchInfo import CompositeSwitchInfo +from CIM16.IEC61970.Informative.InfAssets.Cabinet import Cabinet +from CIM16.IEC61970.Informative.InfAssets.Bushing import Bushing +from CIM16.IEC61970.Informative.InfAssets.Vehicle import Vehicle +from CIM16.IEC61970.Informative.InfAssets.SurgeProtectorInfo import SurgeProtectorInfo +from CIM16.IEC61970.Informative.InfAssets.StructureSupport import StructureSupport +from CIM16.IEC61970.Informative.InfAssets.ComEquipment import ComEquipment +from CIM16.IEC61970.Informative.InfAssets.AssetPropertyCurve import AssetPropertyCurve +from CIM16.IEC61970.Informative.InfAssets.FailureEvent import FailureEvent +from CIM16.IEC61970.Informative.InfAssets.DimensionsInfo import DimensionsInfo +from CIM16.IEC61970.Informative.InfAssets.Tower import Tower +from CIM16.IEC61970.Informative.InfAssets.MountingConnection import MountingConnection +from CIM16.IEC61970.Informative.InfAssets.Medium import Medium +from CIM16.IEC61970.Informative.InfAssets.RecloserInfo import RecloserInfo +from CIM16.IEC61970.Informative.InfAssets.Facility import Facility +from CIM16.IEC61970.Informative.InfAssets.ShuntImpedanceInfo import ShuntImpedanceInfo +from CIM16.IEC61970.Informative.InfAssets.ShuntCompensatorInfo import ShuntCompensatorInfo +from CIM16.IEC61970.Informative.InfAssets.MountingPoint import MountingPoint +from CIM16.IEC61970.Informative.InfAssets.SubstationAsset import SubstationAsset +from CIM16.IEC61970.Informative.InfAssets.Streetlight import Streetlight +from CIM16.IEC61970.Informative.InfAssets.Tool import Tool +from CIM16.IEC61970.Informative.InfAssets.SVC import SVC +from CIM16.IEC61970.Informative.InfAssets.OrgAssetRole import OrgAssetRole +from CIM16.IEC61970.Informative.InfAssets.TestDataSet import TestDataSet +from CIM16.IEC61970.Informative.InfAssets.GenericAssetModelOrMaterial import GenericAssetModelOrMaterial +from CIM16.IEC61970.Informative.InfAssets.ReliabilityInfo import ReliabilityInfo +from CIM16.IEC61970.Informative.InfAssets.TransformerObservation import TransformerObservation +from CIM16.IEC61970.Informative.InfAssets.Pole import Pole +from CIM16.IEC61970.Informative.InfAssets.SwitchInfo import SwitchInfo + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#InfAssets" +nsPrefix = "cimInfAssets" + + +class AnchorKind(str): + """Values are: concrete, helix, unknown, multiHelix, screw, rod, other + """ + pass + +class TowerConstructionKind(str): + """Values are: suspension, tension + """ + pass + +class ProcedureKind(str): + """Values are: test, maintenance, other, inspection, diagnosis + """ + pass + +class FacilityKind(str): + """Values are: plant, building, storage, switching, generation + """ + pass + +class MediumKind(str): + """Values are: gas, liquid, solid + """ + pass + +class UndergroundStructureKind(str): + """Values are: trench, pullbox, vault, burd, subsurfaceEnclosure, handhole, enclosure, tunnel, manhole, pad + """ + pass + +class PolePreservativeKind(str): + """Values are: penta, unknown, chemonite, other, naphthena, creosote, cellon + """ + pass + +class ShuntImpedanceLocalControlKind(str): + """Values are: none, temperature, powerFactor, voltage, reactivePower, time, current + """ + pass + +class CoolingKind(str): + """Values are: forcedAir, selfCooling, forcedOilAndAir, other + """ + pass + +class RegulationBranchKind(str): + """Values are: recloser, transformer, breaker, fuse, switch, sectionner, other, line + """ + pass + +class VehicleUsageKind(str): + """Values are: crew, contractor, user, other + """ + pass + +class SubstationFunctionKind(str): + """Values are: transmission, distribution, other, generation, subTransmission, industrial + """ + pass + +class JointFillKind(str): + """Values are: epoxy, noFillPrefab, airNoFilling, other, asphaltic, insoluseal, oil, noVoid, petrolatum, bluefill254 + """ + pass + +class BushingInsulationPfTestKind(str): + """Values are: c2, c1 + """ + pass + +class PoleTreatmentKind(str): + """Values are: unknown, natural, grayStain, greenStain, penta, butt, other, full + """ + pass + +class FaultIndicatorResetKind(str): + """Values are: automatic, other, remote, manual + """ + pass + +class ShuntImpedanceControlKind(str): + """Values are: remoteOnly, remoteWithLocalOverride, localOnly, fixed + """ + pass + +class JointConfigurationKind(str): + """Values are: other, wires2to1, wires3to1, wires1to1 + """ + pass + +class PoleBaseKind(str): + """Values are: dirt, asphalt, unknown, cement, other + """ + pass + +class FACTSDeviceKind(str): + """Values are: tcpar, tssc, tsbr, svc, tcsc, tcvl, statcom, upfc + """ + pass + +class StructureSupportKind(str): + """Values are: guy, anchor + """ + pass + +class BushingInsulationKind(str): + """Values are: solidPorcelain, compound, other, paperoil + """ + pass + +class StructureMaterialKind(str): + """Values are: wood, concrete, steel, other + """ + pass + +class StreetlightLampKind(str): + """Values are: metalHalide, highPressureSodium, other, mercuryVapor + """ + pass + +class CompositeSwitchKind(str): + """Values are: throwOver, regulatorBypass, escoThrowOver, ral, other, gral, ugMultiSwitch + """ + pass + +class FailureIsolationMethodKind(str): + """Values are: fuse, manuallyIsolated, breakerOperation, other, burnedInTheClear + """ + pass diff --git a/CIM16/IEC61970/Informative/InfCommon/Bank.py b/CIM16/IEC61970/Informative/InfCommon/Bank.py new file mode 100755 index 00000000..c1232d76 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCommon/Bank.py @@ -0,0 +1,77 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Organisation import Organisation + +class Bank(Organisation): + """Organisation that is a commercial bank, agency, or other institution that offers a similar service.Organisation that is a commercial bank, agency, or other institution that offers a similar service. + """ + + def __init__(self, bic='', iban='', branchCode='', BankAccounts=None, *args, **kw_args): + """Initialises a new 'Bank' instance. + + @param bic: Bank identifier code as defined in ISO 9362; for use in countries wher IBAN is not yet in operation. + @param iban: International bank account number defined in ISO 13616; for countries where IBAN is not in operation, the existing BIC or SWIFT codes may be used instead (see ISO 9362). + @param branchCode: Codified reference to the particular branch of the bank where BankAccount is held. + @param BankAccounts: All BankAccounts this Bank provides. + """ + #: Bank identifier code as defined in ISO 9362; for use in countries wher IBAN is not yet in operation. + self.bic = bic + + #: International bank account number defined in ISO 13616; for countries where IBAN is not in operation, the existing BIC or SWIFT codes may be used instead (see ISO 9362). + self.iban = iban + + #: Codified reference to the particular branch of the bank where BankAccount is held. + self.branchCode = branchCode + + self._BankAccounts = [] + self.BankAccounts = [] if BankAccounts is None else BankAccounts + + super(Bank, self).__init__(*args, **kw_args) + + _attrs = ["bic", "iban", "branchCode"] + _attr_types = {"bic": str, "iban": str, "branchCode": str} + _defaults = {"bic": '', "iban": '', "branchCode": ''} + _enums = {} + _refs = ["BankAccounts"] + _many_refs = ["BankAccounts"] + + def getBankAccounts(self): + """All BankAccounts this Bank provides. + """ + return self._BankAccounts + + def setBankAccounts(self, value): + for x in self._BankAccounts: + x.Bank = None + for y in value: + y._Bank = self + self._BankAccounts = value + + BankAccounts = property(getBankAccounts, setBankAccounts) + + def addBankAccounts(self, *BankAccounts): + for obj in BankAccounts: + obj.Bank = self + + def removeBankAccounts(self, *BankAccounts): + for obj in BankAccounts: + obj.Bank = None + diff --git a/CIM16/IEC61970/Informative/InfCommon/BankAccount.py b/CIM16/IEC61970/Informative/InfCommon/BankAccount.py new file mode 100755 index 00000000..4452078a --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCommon/BankAccount.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class BankAccount(Document): + """Bank account.Bank account. + """ + + def __init__(self, accountNumber='', ServiceSupplier=None, Bank=None, *args, **kw_args): + """Initialises a new 'BankAccount' instance. + + @param accountNumber: Account reference number. + @param ServiceSupplier: ServiceSupplier that is owner of this BankAccount. + @param Bank: Bank that provides this BankAccount. + """ + #: Account reference number. + self.accountNumber = accountNumber + + self._ServiceSupplier = None + self.ServiceSupplier = ServiceSupplier + + self._Bank = None + self.Bank = Bank + + super(BankAccount, self).__init__(*args, **kw_args) + + _attrs = ["accountNumber"] + _attr_types = {"accountNumber": str} + _defaults = {"accountNumber": ''} + _enums = {} + _refs = ["ServiceSupplier", "Bank"] + _many_refs = [] + + def getServiceSupplier(self): + """ServiceSupplier that is owner of this BankAccount. + """ + return self._ServiceSupplier + + def setServiceSupplier(self, value): + if self._ServiceSupplier is not None: + filtered = [x for x in self.ServiceSupplier.BankAccounts if x != self] + self._ServiceSupplier._BankAccounts = filtered + + self._ServiceSupplier = value + if self._ServiceSupplier is not None: + if self not in self._ServiceSupplier._BankAccounts: + self._ServiceSupplier._BankAccounts.append(self) + + ServiceSupplier = property(getServiceSupplier, setServiceSupplier) + + def getBank(self): + """Bank that provides this BankAccount. + """ + return self._Bank + + def setBank(self, value): + if self._Bank is not None: + filtered = [x for x in self.Bank.BankAccounts if x != self] + self._Bank._BankAccounts = filtered + + self._Bank = value + if self._Bank is not None: + if self not in self._Bank._BankAccounts: + self._Bank._BankAccounts.append(self) + + Bank = property(getBank, setBank) + diff --git a/CIM16/IEC61970/Informative/InfCommon/BusinessPlan.py b/CIM16/IEC61970/Informative/InfCommon/BusinessPlan.py new file mode 100755 index 00000000..4aeaec2f --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCommon/BusinessPlan.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class BusinessPlan(Document): + """A BusinessPlan is an organized sequence of predetermined actions required to complete a future organizational objective. It is a type of document that typically references a schedule, physical and/or logical resources (assets and/or PowerSystemResources), locations, etc.A BusinessPlan is an organized sequence of predetermined actions required to complete a future organizational objective. It is a type of document that typically references a schedule, physical and/or logical resources (assets and/or PowerSystemResources), locations, etc. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'BusinessPlan' instance. + + """ + super(BusinessPlan, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfCommon/BusinessRole.py b/CIM16/IEC61970/Informative/InfCommon/BusinessRole.py new file mode 100755 index 00000000..1df2d358 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCommon/BusinessRole.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class BusinessRole(IdentifiedObject): + """A business role that this organisation plays. A single organisation typically performs many functions, each one described as a role.A business role that this organisation plays. A single organisation typically performs many functions, each one described as a role. + """ + + def __init__(self, category='', Organisations=None, status=None, *args, **kw_args): + """Initialises a new 'BusinessRole' instance. + + @param category: Category by utility's corporate standards and practices. + @param Organisations: + @param status: + """ + #: Category by utility's corporate standards and practices. + self.category = category + + self._Organisations = [] + self.Organisations = [] if Organisations is None else Organisations + + self.status = status + + super(BusinessRole, self).__init__(*args, **kw_args) + + _attrs = ["category"] + _attr_types = {"category": str} + _defaults = {"category": ''} + _enums = {} + _refs = ["Organisations", "status"] + _many_refs = ["Organisations"] + + def getOrganisations(self): + + return self._Organisations + + def setOrganisations(self, value): + for p in self._Organisations: + filtered = [q for q in p.BusinessRoles if q != self] + self._Organisations._BusinessRoles = filtered + for r in value: + if self not in r._BusinessRoles: + r._BusinessRoles.append(self) + self._Organisations = value + + Organisations = property(getOrganisations, setOrganisations) + + def addOrganisations(self, *Organisations): + for obj in Organisations: + if self not in obj._BusinessRoles: + obj._BusinessRoles.append(self) + self._Organisations.append(obj) + + def removeOrganisations(self, *Organisations): + for obj in Organisations: + if self in obj._BusinessRoles: + obj._BusinessRoles.remove(self) + self._Organisations.remove(obj) + + status = None + diff --git a/CIM16/IEC61970/Informative/InfCommon/Craft.py b/CIM16/IEC61970/Informative/InfCommon/Craft.py new file mode 100755 index 00000000..bcee27e1 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCommon/Craft.py @@ -0,0 +1,141 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Craft(IdentifiedObject): + """Craft of a person or a crew. Examples include overhead electric, underground electric, high pressure gas, etc. This ensures necessary knowledge and skills before being allowed to perform certain types of work.Craft of a person or a crew. Examples include overhead electric, underground electric, high pressure gas, etc. This ensures necessary knowledge and skills before being allowed to perform certain types of work. + """ + + def __init__(self, category='', Skills=None, ErpPersons=None, status=None, Capabilities=None, *args, **kw_args): + """Initialises a new 'Craft' instance. + + @param category: Category by utility's work mangement standards and practices. + @param Skills: + @param ErpPersons: + @param status: + @param Capabilities: + """ + #: Category by utility's work mangement standards and practices. + self.category = category + + self._Skills = [] + self.Skills = [] if Skills is None else Skills + + self._ErpPersons = [] + self.ErpPersons = [] if ErpPersons is None else ErpPersons + + self.status = status + + self._Capabilities = [] + self.Capabilities = [] if Capabilities is None else Capabilities + + super(Craft, self).__init__(*args, **kw_args) + + _attrs = ["category"] + _attr_types = {"category": str} + _defaults = {"category": ''} + _enums = {} + _refs = ["Skills", "ErpPersons", "status", "Capabilities"] + _many_refs = ["Skills", "ErpPersons", "Capabilities"] + + def getSkills(self): + + return self._Skills + + def setSkills(self, value): + for p in self._Skills: + filtered = [q for q in p.Crafts if q != self] + self._Skills._Crafts = filtered + for r in value: + if self not in r._Crafts: + r._Crafts.append(self) + self._Skills = value + + Skills = property(getSkills, setSkills) + + def addSkills(self, *Skills): + for obj in Skills: + if self not in obj._Crafts: + obj._Crafts.append(self) + self._Skills.append(obj) + + def removeSkills(self, *Skills): + for obj in Skills: + if self in obj._Crafts: + obj._Crafts.remove(self) + self._Skills.remove(obj) + + def getErpPersons(self): + + return self._ErpPersons + + def setErpPersons(self, value): + for p in self._ErpPersons: + filtered = [q for q in p.Crafts if q != self] + self._ErpPersons._Crafts = filtered + for r in value: + if self not in r._Crafts: + r._Crafts.append(self) + self._ErpPersons = value + + ErpPersons = property(getErpPersons, setErpPersons) + + def addErpPersons(self, *ErpPersons): + for obj in ErpPersons: + if self not in obj._Crafts: + obj._Crafts.append(self) + self._ErpPersons.append(obj) + + def removeErpPersons(self, *ErpPersons): + for obj in ErpPersons: + if self in obj._Crafts: + obj._Crafts.remove(self) + self._ErpPersons.remove(obj) + + status = None + + def getCapabilities(self): + + return self._Capabilities + + def setCapabilities(self, value): + for p in self._Capabilities: + filtered = [q for q in p.Crafts if q != self] + self._Capabilities._Crafts = filtered + for r in value: + if self not in r._Crafts: + r._Crafts.append(self) + self._Capabilities = value + + Capabilities = property(getCapabilities, setCapabilities) + + def addCapabilities(self, *Capabilities): + for obj in Capabilities: + if self not in obj._Crafts: + obj._Crafts.append(self) + self._Capabilities.append(obj) + + def removeCapabilities(self, *Capabilities): + for obj in Capabilities: + if self in obj._Crafts: + obj._Crafts.remove(self) + self._Capabilities.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfCommon/DocDocRole.py b/CIM16/IEC61970/Informative/InfCommon/DocDocRole.py new file mode 100755 index 00000000..1b6cc288 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCommon/DocDocRole.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.Role import Role + +class DocDocRole(Role): + """Roles played between Documents and other Documents.Roles played between Documents and other Documents. + """ + + def __init__(self, ToDocument=None, FromDocument=None, *args, **kw_args): + """Initialises a new 'DocDocRole' instance. + + @param ToDocument: + @param FromDocument: + """ + self._ToDocument = None + self.ToDocument = ToDocument + + self._FromDocument = None + self.FromDocument = FromDocument + + super(DocDocRole, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ToDocument", "FromDocument"] + _many_refs = [] + + def getToDocument(self): + + return self._ToDocument + + def setToDocument(self, value): + if self._ToDocument is not None: + filtered = [x for x in self.ToDocument.FromDocumentRoles if x != self] + self._ToDocument._FromDocumentRoles = filtered + + self._ToDocument = value + if self._ToDocument is not None: + if self not in self._ToDocument._FromDocumentRoles: + self._ToDocument._FromDocumentRoles.append(self) + + ToDocument = property(getToDocument, setToDocument) + + def getFromDocument(self): + + return self._FromDocument + + def setFromDocument(self, value): + if self._FromDocument is not None: + filtered = [x for x in self.FromDocument.ToDocumentRoles if x != self] + self._FromDocument._ToDocumentRoles = filtered + + self._FromDocument = value + if self._FromDocument is not None: + if self not in self._FromDocument._ToDocumentRoles: + self._FromDocument._ToDocumentRoles.append(self) + + FromDocument = property(getFromDocument, setFromDocument) + diff --git a/CIM16/IEC61970/Informative/InfCommon/DocPsrRole.py b/CIM16/IEC61970/Informative/InfCommon/DocPsrRole.py new file mode 100755 index 00000000..3ff2fe30 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCommon/DocPsrRole.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.Role import Role + +class DocPsrRole(Role): + """Potential roles that might played by a document relative to a type of PowerSystemResource.Potential roles that might played by a document relative to a type of PowerSystemResource. + """ + + def __init__(self, Document=None, PowerSystemResource=None, *args, **kw_args): + """Initialises a new 'DocPsrRole' instance. + + @param Document: + @param PowerSystemResource: + """ + self._Document = None + self.Document = Document + + self._PowerSystemResource = None + self.PowerSystemResource = PowerSystemResource + + super(DocPsrRole, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Document", "PowerSystemResource"] + _many_refs = [] + + def getDocument(self): + + return self._Document + + def setDocument(self, value): + if self._Document is not None: + filtered = [x for x in self.Document.PowerSystemResourceRoles if x != self] + self._Document._PowerSystemResourceRoles = filtered + + self._Document = value + if self._Document is not None: + if self not in self._Document._PowerSystemResourceRoles: + self._Document._PowerSystemResourceRoles.append(self) + + Document = property(getDocument, setDocument) + + def getPowerSystemResource(self): + + return self._PowerSystemResource + + def setPowerSystemResource(self, value): + if self._PowerSystemResource is not None: + filtered = [x for x in self.PowerSystemResource.DocumentRoles if x != self] + self._PowerSystemResource._DocumentRoles = filtered + + self._PowerSystemResource = value + if self._PowerSystemResource is not None: + if self not in self._PowerSystemResource._DocumentRoles: + self._PowerSystemResource._DocumentRoles.append(self) + + PowerSystemResource = property(getPowerSystemResource, setPowerSystemResource) + diff --git a/CIM16/IEC61970/Informative/InfCommon/Ratio.py b/CIM16/IEC61970/Informative/InfCommon/Ratio.py new file mode 100755 index 00000000..05590cb6 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCommon/Ratio.py @@ -0,0 +1,45 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class Ratio(object): + """Fraction specified explicitly with a numerator and denominator, which can be used to calculate the quotient.Fraction specified explicitly with a numerator and denominator, which can be used to calculate the quotient. + """ + + def __init__(self, numerator=0.0, denominator=0.0): + """Initialises a new 'Ratio' instance. + + @param numerator: The part of a fraction that is above the line and signifies the number to be divided by the denominator. + @param denominator: The part of a fraction that is below the line and that functions as the divisor of the numerator. + """ + #: The part of a fraction that is above the line and signifies the number to be divided by the denominator. + self.numerator = numerator + + #: The part of a fraction that is below the line and that functions as the divisor of the numerator. + self.denominator = denominator + + + _attrs = ["numerator", "denominator"] + _attr_types = {"numerator": float, "denominator": float} + _defaults = {"numerator": 0.0, "denominator": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfCommon/Role.py b/CIM16/IEC61970/Informative/InfCommon/Role.py new file mode 100755 index 00000000..1b17f802 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCommon/Role.py @@ -0,0 +1,48 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Role(IdentifiedObject): + """Enumeration of potential roles that might be played by one object relative to another.Enumeration of potential roles that might be played by one object relative to another. + """ + + def __init__(self, category='', status=None, *args, **kw_args): + """Initialises a new 'Role' instance. + + @param category: Category of role. + @param status: + """ + #: Category of role. + self.category = category + + self.status = status + + super(Role, self).__init__(*args, **kw_args) + + _attrs = ["category"] + _attr_types = {"category": str} + _defaults = {"category": ''} + _enums = {} + _refs = ["status"] + _many_refs = [] + + status = None + diff --git a/CIM16/IEC61970/Informative/InfCommon/ScheduleParameterInfo.py b/CIM16/IEC61970/Informative/InfCommon/ScheduleParameterInfo.py new file mode 100755 index 00000000..38149015 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCommon/ScheduleParameterInfo.py @@ -0,0 +1,132 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ScheduleParameterInfo(IdentifiedObject): + """Schedule parameters for an activity that is to occur, is occurring, or has completed.Schedule parameters for an activity that is to occur, is occurring, or has completed. + """ + + def __init__(self, ForInspectionDataSet=None, requestedWindow=None, Documents=None, estimatedWindow=None, ScheduledEvents=None, status=None, *args, **kw_args): + """Initialises a new 'ScheduleParameterInfo' instance. + + @param ForInspectionDataSet: + @param requestedWindow: Requested date and time interval for activity execution. + @param Documents: + @param estimatedWindow: Estimated date and time for activity execution (with earliest possibility of activity initiation and latest possibility of activity completion). + @param ScheduledEvents: + @param status: + """ + self._ForInspectionDataSet = None + self.ForInspectionDataSet = ForInspectionDataSet + + self.requestedWindow = requestedWindow + + self._Documents = [] + self.Documents = [] if Documents is None else Documents + + self.estimatedWindow = estimatedWindow + + self._ScheduledEvents = [] + self.ScheduledEvents = [] if ScheduledEvents is None else ScheduledEvents + + self.status = status + + super(ScheduleParameterInfo, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ForInspectionDataSet", "requestedWindow", "Documents", "estimatedWindow", "ScheduledEvents", "status"] + _many_refs = ["Documents", "ScheduledEvents"] + + def getForInspectionDataSet(self): + + return self._ForInspectionDataSet + + def setForInspectionDataSet(self, value): + if self._ForInspectionDataSet is not None: + filtered = [x for x in self.ForInspectionDataSet.AccordingToSchedules if x != self] + self._ForInspectionDataSet._AccordingToSchedules = filtered + + self._ForInspectionDataSet = value + if self._ForInspectionDataSet is not None: + if self not in self._ForInspectionDataSet._AccordingToSchedules: + self._ForInspectionDataSet._AccordingToSchedules.append(self) + + ForInspectionDataSet = property(getForInspectionDataSet, setForInspectionDataSet) + + # Requested date and time interval for activity execution. + requestedWindow = None + + def getDocuments(self): + + return self._Documents + + def setDocuments(self, value): + for p in self._Documents: + filtered = [q for q in p.ScheduleParameterInfos if q != self] + self._Documents._ScheduleParameterInfos = filtered + for r in value: + if self not in r._ScheduleParameterInfos: + r._ScheduleParameterInfos.append(self) + self._Documents = value + + Documents = property(getDocuments, setDocuments) + + def addDocuments(self, *Documents): + for obj in Documents: + if self not in obj._ScheduleParameterInfos: + obj._ScheduleParameterInfos.append(self) + self._Documents.append(obj) + + def removeDocuments(self, *Documents): + for obj in Documents: + if self in obj._ScheduleParameterInfos: + obj._ScheduleParameterInfos.remove(self) + self._Documents.remove(obj) + + # Estimated date and time for activity execution (with earliest possibility of activity initiation and latest possibility of activity completion). + estimatedWindow = None + + def getScheduledEvents(self): + + return self._ScheduledEvents + + def setScheduledEvents(self, value): + for x in self._ScheduledEvents: + x.ScheduleParameterInfo = None + for y in value: + y._ScheduleParameterInfo = self + self._ScheduledEvents = value + + ScheduledEvents = property(getScheduledEvents, setScheduledEvents) + + def addScheduledEvents(self, *ScheduledEvents): + for obj in ScheduledEvents: + obj.ScheduleParameterInfo = self + + def removeScheduledEvents(self, *ScheduledEvents): + for obj in ScheduledEvents: + obj.ScheduleParameterInfo = None + + status = None + diff --git a/CIM16/IEC61970/Informative/InfCommon/ScheduledEvent.py b/CIM16/IEC61970/Informative/InfCommon/ScheduledEvent.py new file mode 100755 index 00000000..16c06c97 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCommon/ScheduledEvent.py @@ -0,0 +1,162 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ScheduledEvent(IdentifiedObject): + """Signifies an event to trigger one or more activities, such as reading a meter, recalculating a bill, requesting work, when generating units must be scheduled for maintenance, when a transformer is scheduled to be refurbished, etc.Signifies an event to trigger one or more activities, such as reading a meter, recalculating a bill, requesting work, when generating units must be scheduled for maintenance, when a transformer is scheduled to be refurbished, etc. + """ + + def __init__(self, duration=0.0, category='', Document=None, ActivityRecord=None, status=None, TimePoint=None, ScheduleParameterInfo=None, Assets=None, *args, **kw_args): + """Initialises a new 'ScheduledEvent' instance. + + @param duration: Duration of the scheduled event, for example, the time to ramp between values. + @param category: Category of scheduled event. + @param Document: + @param ActivityRecord: + @param status: + @param TimePoint: + @param ScheduleParameterInfo: + @param Assets: + """ + #: Duration of the scheduled event, for example, the time to ramp between values. + self.duration = duration + + #: Category of scheduled event. + self.category = category + + self._Document = None + self.Document = Document + + self._ActivityRecord = None + self.ActivityRecord = ActivityRecord + + self.status = status + + self._TimePoint = None + self.TimePoint = TimePoint + + self._ScheduleParameterInfo = None + self.ScheduleParameterInfo = ScheduleParameterInfo + + self._Assets = [] + self.Assets = [] if Assets is None else Assets + + super(ScheduledEvent, self).__init__(*args, **kw_args) + + _attrs = ["duration", "category"] + _attr_types = {"duration": float, "category": str} + _defaults = {"duration": 0.0, "category": ''} + _enums = {} + _refs = ["Document", "ActivityRecord", "status", "TimePoint", "ScheduleParameterInfo", "Assets"] + _many_refs = ["Assets"] + + def getDocument(self): + + return self._Document + + def setDocument(self, value): + if self._Document is not None: + filtered = [x for x in self.Document.ScheduledEvents if x != self] + self._Document._ScheduledEvents = filtered + + self._Document = value + if self._Document is not None: + if self not in self._Document._ScheduledEvents: + self._Document._ScheduledEvents.append(self) + + Document = property(getDocument, setDocument) + + def getActivityRecord(self): + + return self._ActivityRecord + + def setActivityRecord(self, value): + if self._ActivityRecord is not None: + self._ActivityRecord._ScheduledEvent = None + + self._ActivityRecord = value + if self._ActivityRecord is not None: + self._ActivityRecord.ScheduledEvent = None + self._ActivityRecord._ScheduledEvent = self + + ActivityRecord = property(getActivityRecord, setActivityRecord) + + status = None + + def getTimePoint(self): + + return self._TimePoint + + def setTimePoint(self, value): + if self._TimePoint is not None: + filtered = [x for x in self.TimePoint.ScheduledEvents if x != self] + self._TimePoint._ScheduledEvents = filtered + + self._TimePoint = value + if self._TimePoint is not None: + if self not in self._TimePoint._ScheduledEvents: + self._TimePoint._ScheduledEvents.append(self) + + TimePoint = property(getTimePoint, setTimePoint) + + def getScheduleParameterInfo(self): + + return self._ScheduleParameterInfo + + def setScheduleParameterInfo(self, value): + if self._ScheduleParameterInfo is not None: + filtered = [x for x in self.ScheduleParameterInfo.ScheduledEvents if x != self] + self._ScheduleParameterInfo._ScheduledEvents = filtered + + self._ScheduleParameterInfo = value + if self._ScheduleParameterInfo is not None: + if self not in self._ScheduleParameterInfo._ScheduledEvents: + self._ScheduleParameterInfo._ScheduledEvents.append(self) + + ScheduleParameterInfo = property(getScheduleParameterInfo, setScheduleParameterInfo) + + def getAssets(self): + + return self._Assets + + def setAssets(self, value): + for p in self._Assets: + filtered = [q for q in p.ScheduledEvents if q != self] + self._Assets._ScheduledEvents = filtered + for r in value: + if self not in r._ScheduledEvents: + r._ScheduledEvents.append(self) + self._Assets = value + + Assets = property(getAssets, setAssets) + + def addAssets(self, *Assets): + for obj in Assets: + if self not in obj._ScheduledEvents: + obj._ScheduledEvents.append(self) + self._Assets.append(obj) + + def removeAssets(self, *Assets): + for obj in Assets: + if self in obj._ScheduledEvents: + obj._ScheduledEvents.remove(self) + self._Assets.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfCommon/Skill.py b/CIM16/IEC61970/Informative/InfCommon/Skill.py new file mode 100755 index 00000000..38bb214f --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCommon/Skill.py @@ -0,0 +1,135 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class Skill(Document): + """Proficiency level of a craft, which is required to operate or maintain a particular type of asset and/or perform certain types of work.Proficiency level of a craft, which is required to operate or maintain a particular type of asset and/or perform certain types of work. + """ + + def __init__(self, effectiveDateTime='', level="apprentice", Crafts=None, ErpPerson=None, QualificationRequirements=None, certificationPeriod=None, *args, **kw_args): + """Initialises a new 'Skill' instance. + + @param effectiveDateTime: Date and time the skill became effective. + @param level: Level of skill for a Craft. Values are: "apprentice", "other", "master", "standard" + @param Crafts: + @param ErpPerson: + @param QualificationRequirements: + @param certificationPeriod: Interval between the certification and its expiry. + """ + #: Date and time the skill became effective. + self.effectiveDateTime = effectiveDateTime + + #: Level of skill for a Craft. Values are: "apprentice", "other", "master", "standard" + self.level = level + + self._Crafts = [] + self.Crafts = [] if Crafts is None else Crafts + + self._ErpPerson = None + self.ErpPerson = ErpPerson + + self._QualificationRequirements = [] + self.QualificationRequirements = [] if QualificationRequirements is None else QualificationRequirements + + self.certificationPeriod = certificationPeriod + + super(Skill, self).__init__(*args, **kw_args) + + _attrs = ["effectiveDateTime", "level"] + _attr_types = {"effectiveDateTime": str, "level": str} + _defaults = {"effectiveDateTime": '', "level": "apprentice"} + _enums = {"level": "SkillLevelKind"} + _refs = ["Crafts", "ErpPerson", "QualificationRequirements", "certificationPeriod"] + _many_refs = ["Crafts", "QualificationRequirements"] + + def getCrafts(self): + + return self._Crafts + + def setCrafts(self, value): + for p in self._Crafts: + filtered = [q for q in p.Skills if q != self] + self._Crafts._Skills = filtered + for r in value: + if self not in r._Skills: + r._Skills.append(self) + self._Crafts = value + + Crafts = property(getCrafts, setCrafts) + + def addCrafts(self, *Crafts): + for obj in Crafts: + if self not in obj._Skills: + obj._Skills.append(self) + self._Crafts.append(obj) + + def removeCrafts(self, *Crafts): + for obj in Crafts: + if self in obj._Skills: + obj._Skills.remove(self) + self._Crafts.remove(obj) + + def getErpPerson(self): + + return self._ErpPerson + + def setErpPerson(self, value): + if self._ErpPerson is not None: + filtered = [x for x in self.ErpPerson.Skills if x != self] + self._ErpPerson._Skills = filtered + + self._ErpPerson = value + if self._ErpPerson is not None: + if self not in self._ErpPerson._Skills: + self._ErpPerson._Skills.append(self) + + ErpPerson = property(getErpPerson, setErpPerson) + + def getQualificationRequirements(self): + + return self._QualificationRequirements + + def setQualificationRequirements(self, value): + for p in self._QualificationRequirements: + filtered = [q for q in p.Skills if q != self] + self._QualificationRequirements._Skills = filtered + for r in value: + if self not in r._Skills: + r._Skills.append(self) + self._QualificationRequirements = value + + QualificationRequirements = property(getQualificationRequirements, setQualificationRequirements) + + def addQualificationRequirements(self, *QualificationRequirements): + for obj in QualificationRequirements: + if self not in obj._Skills: + obj._Skills.append(self) + self._QualificationRequirements.append(obj) + + def removeQualificationRequirements(self, *QualificationRequirements): + for obj in QualificationRequirements: + if self in obj._Skills: + obj._Skills.remove(self) + self._QualificationRequirements.remove(obj) + + # Interval between the certification and its expiry. + certificationPeriod = None + diff --git a/CIM16/IEC61970/Informative/InfCommon/__init__.py b/CIM16/IEC61970/Informative/InfCommon/__init__.py new file mode 100755 index 00000000..a735e8c4 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCommon/__init__.py @@ -0,0 +1,44 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package contains functions common for distribution management. TODO: The following has been copied from a very old version of draft Part 11, so the references are wrong, but we store the knowledge here to reuse later: 'Locations are logical entities which are related to a geographical position. Locations can be defined as points, lines or polygons. Location serves as a parent class for e.g. Zone, WorkLocation or ServiceLocation. Both Assets and PowerSystemResources are typically associated to a location. Aside from coordinates, useful properties of Locations can include Directions (i.e. driving instructions) and relationships to Organizations. ActivityRecord is a generalized class used to track the history of an object (e.g. Asset, PowerSystemResource, Customer, Location, Organisation or ErpContact). An ActivityRecord is a type of Document. Key properties of an ActivityRecord include statusDate, status, statusReason and remarks. TODO: Update attribute names. The graphical and geographical aspects of Assets, Locations and PowerSystemResources are managed using Graphical Markup Language (GML), which was defined by the Open GIS Consortium. Using GML, a diagram is a collection of presentation objects. This package defines the classes Diagram and Presentation. TODO: These are now under Common package.' +""" + +from CIM16.IEC61970.Informative.InfCommon.Role import Role +from CIM16.IEC61970.Informative.InfCommon.Bank import Bank +from CIM16.IEC61970.Informative.InfCommon.Skill import Skill +from CIM16.IEC61970.Informative.InfCommon.BusinessRole import BusinessRole +from CIM16.IEC61970.Informative.InfCommon.ScheduledEvent import ScheduledEvent +from CIM16.IEC61970.Informative.InfCommon.ScheduleParameterInfo import ScheduleParameterInfo +from CIM16.IEC61970.Informative.InfCommon.DocPsrRole import DocPsrRole +from CIM16.IEC61970.Informative.InfCommon.Ratio import Ratio +from CIM16.IEC61970.Informative.InfCommon.BankAccount import BankAccount +from CIM16.IEC61970.Informative.InfCommon.Craft import Craft +from CIM16.IEC61970.Informative.InfCommon.DocDocRole import DocDocRole +from CIM16.IEC61970.Informative.InfCommon.BusinessPlan import BusinessPlan + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#InfCommon" +nsPrefix = "cimInfCommon" + + +class SkillLevelKind(str): + """Values are: apprentice, other, master, standard + """ + pass diff --git a/CIM16/IEC61970/Informative/InfCore/ModelingAuthority.py b/CIM16/IEC61970/Informative/InfCore/ModelingAuthority.py new file mode 100755 index 00000000..bea4a9c2 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCore/ModelingAuthority.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ModelingAuthority(IdentifiedObject): + """A Modeling Authority is an entity responsible for supplying and maintaining the data defining a specific set of objects in a network model.A Modeling Authority is an entity responsible for supplying and maintaining the data defining a specific set of objects in a network model. + """ + + def __init__(self, ModelingAuthoritySets=None, *args, **kw_args): + """Initialises a new 'ModelingAuthority' instance. + + @param ModelingAuthoritySets: A Modeling Authority set supplies and maintains the data for the objects in a Modeling Authority Set. + """ + self._ModelingAuthoritySets = [] + self.ModelingAuthoritySets = [] if ModelingAuthoritySets is None else ModelingAuthoritySets + + super(ModelingAuthority, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ModelingAuthoritySets"] + _many_refs = ["ModelingAuthoritySets"] + + def getModelingAuthoritySets(self): + """A Modeling Authority set supplies and maintains the data for the objects in a Modeling Authority Set. + """ + return self._ModelingAuthoritySets + + def setModelingAuthoritySets(self, value): + for x in self._ModelingAuthoritySets: + x.ModelingAuthority = None + for y in value: + y._ModelingAuthority = self + self._ModelingAuthoritySets = value + + ModelingAuthoritySets = property(getModelingAuthoritySets, setModelingAuthoritySets) + + def addModelingAuthoritySets(self, *ModelingAuthoritySets): + for obj in ModelingAuthoritySets: + obj.ModelingAuthority = self + + def removeModelingAuthoritySets(self, *ModelingAuthoritySets): + for obj in ModelingAuthoritySets: + obj.ModelingAuthority = None + diff --git a/CIM16/IEC61970/Informative/InfCore/ModelingAuthoritySet.py b/CIM16/IEC61970/Informative/InfCore/ModelingAuthoritySet.py new file mode 100755 index 00000000..bde1f6ad --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCore/ModelingAuthoritySet.py @@ -0,0 +1,86 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ModelingAuthoritySet(IdentifiedObject): + """A Modeling Authority Set is a group of objects in a network model where the data is supplied and maintained by the same Modeling Authority. This class is typically not included in instance data exchange as this information is tracked by other mechanisms in the exchange.A Modeling Authority Set is a group of objects in a network model where the data is supplied and maintained by the same Modeling Authority. This class is typically not included in instance data exchange as this information is tracked by other mechanisms in the exchange. + """ + + def __init__(self, IdentifiedObjects=None, ModelingAuthority=None, *args, **kw_args): + """Initialises a new 'ModelingAuthoritySet' instance. + + @param IdentifiedObjects: An IdentifiedObject belongs to a Modeling Authority Set for purposes of defining a group of data maintained by the same Modeling Authority. + @param ModelingAuthority: A Modeling Authority set supplies and maintains the data for the objects in a Modeling Authority Set. + """ + self._IdentifiedObjects = [] + self.IdentifiedObjects = [] if IdentifiedObjects is None else IdentifiedObjects + + self._ModelingAuthority = None + self.ModelingAuthority = ModelingAuthority + + super(ModelingAuthoritySet, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["IdentifiedObjects", "ModelingAuthority"] + _many_refs = ["IdentifiedObjects"] + + def getIdentifiedObjects(self): + """An IdentifiedObject belongs to a Modeling Authority Set for purposes of defining a group of data maintained by the same Modeling Authority. + """ + return self._IdentifiedObjects + + def setIdentifiedObjects(self, value): + for x in self._IdentifiedObjects: + x.ModelingAuthoritySet = None + for y in value: + y._ModelingAuthoritySet = self + self._IdentifiedObjects = value + + IdentifiedObjects = property(getIdentifiedObjects, setIdentifiedObjects) + + def addIdentifiedObjects(self, *IdentifiedObjects): + for obj in IdentifiedObjects: + obj.ModelingAuthoritySet = self + + def removeIdentifiedObjects(self, *IdentifiedObjects): + for obj in IdentifiedObjects: + obj.ModelingAuthoritySet = None + + def getModelingAuthority(self): + """A Modeling Authority set supplies and maintains the data for the objects in a Modeling Authority Set. + """ + return self._ModelingAuthority + + def setModelingAuthority(self, value): + if self._ModelingAuthority is not None: + filtered = [x for x in self.ModelingAuthority.ModelingAuthoritySets if x != self] + self._ModelingAuthority._ModelingAuthoritySets = filtered + + self._ModelingAuthority = value + if self._ModelingAuthority is not None: + if self not in self._ModelingAuthority._ModelingAuthoritySets: + self._ModelingAuthority._ModelingAuthoritySets.append(self) + + ModelingAuthority = property(getModelingAuthority, setModelingAuthority) + diff --git a/CIM16/IEC61970/Informative/InfCore/__init__.py b/CIM16/IEC61970/Informative/InfCore/__init__.py new file mode 100755 index 00000000..fa8485c6 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCore/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +from CIM16.IEC61970.Informative.InfCore.ModelingAuthority import ModelingAuthority +from CIM16.IEC61970.Informative.InfCore.ModelingAuthoritySet import ModelingAuthoritySet + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#InfCore" +nsPrefix = "cimInfCore" + diff --git a/CIM16/IEC61970/Informative/InfCustomers/ComplianceEvent.py b/CIM16/IEC61970/Informative/InfCustomers/ComplianceEvent.py new file mode 100755 index 00000000..f7001455 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCustomers/ComplianceEvent.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.ActivityRecord import ActivityRecord + +class ComplianceEvent(ActivityRecord): + """Compliance events are used for reporting regulatory or contract compliance issues and/or variances. These might be created as a consequence of local business processes and associated rules. It is anticipated that this class will be customised extensively to meet local implementation needs. Use inherited 'category' to indicate that, for example, expected performance will not be met or reported as mandated.Compliance events are used for reporting regulatory or contract compliance issues and/or variances. These might be created as a consequence of local business processes and associated rules. It is anticipated that this class will be customised extensively to meet local implementation needs. Use inherited 'category' to indicate that, for example, expected performance will not be met or reported as mandated. + """ + + def __init__(self, deadline='', *args, **kw_args): + """Initialises a new 'ComplianceEvent' instance. + + @param deadline: The deadline for compliance. + """ + #: The deadline for compliance. + self.deadline = deadline + + super(ComplianceEvent, self).__init__(*args, **kw_args) + + _attrs = ["deadline"] + _attr_types = {"deadline": str} + _defaults = {"deadline": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfCustomers/CustomerBillingInfo.py b/CIM16/IEC61970/Informative/InfCustomers/CustomerBillingInfo.py new file mode 100755 index 00000000..fbb85393 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCustomers/CustomerBillingInfo.py @@ -0,0 +1,122 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class CustomerBillingInfo(Document): + """The creation of the monthly customer billing statements is the method employed to notify Customers of charges, adjustments and credits applied to their account for Services and Products. The actuall billing occurs through an ErpInvoice. The CustomerBillingInfo includes information from the payment, collection, meter reading, installed meter, service, site, customer, customer account, customer agreement, services and pricing subject areas. Each component price shows up as a separate line item on the ErpInvoice. The Customer Billing Statement may include collection and account messages, marketing/civic event messages and bill inserts. One Customer Billing Statement is produced for all Agreements under a CustomerAccount per billing cycle date defined in 'CustomerAccount.billingCycle'. The history of CustomerBillingInfo, Invoices and Payments is to be maintained in associated ActivityRecords.The creation of the monthly customer billing statements is the method employed to notify Customers of charges, adjustments and credits applied to their account for Services and Products. The actuall billing occurs through an ErpInvoice. The CustomerBillingInfo includes information from the payment, collection, meter reading, installed meter, service, site, customer, customer account, customer agreement, services and pricing subject areas. Each component price shows up as a separate line item on the ErpInvoice. The Customer Billing Statement may include collection and account messages, marketing/civic event messages and bill inserts. One Customer Billing Statement is produced for all Agreements under a CustomerAccount per billing cycle date defined in 'CustomerAccount.billingCycle'. The history of CustomerBillingInfo, Invoices and Payments is to be maintained in associated ActivityRecords. + """ + + def __init__(self, pymtPlanType='', kind="consolidatedUdc", pymtPlanAmt=0.0, lastPaymentAmt=0.0, dueDate='', outBalance=0.0, lastPaymentDate='', billingDate='', ErpInvoiceLineItems=None, CustomerAccount=None, *args, **kw_args): + """Initialises a new 'CustomerBillingInfo' instance. + + @param pymtPlanType: Type of payment plan. + @param kind: Kind of bill customer receives. Values are: "consolidatedUdc", "other", "separateEssUdc", "consolidatedEss" + @param pymtPlanAmt: Monthly amortized amount due during each billing cycle for the CustomerAccount balance for which the Payment Plan is set-up. + @param lastPaymentAmt: Amount of the last payment received from the customer. It is retained in the Customer Billing system, although the details of each payment are tracked in the ERP system. + @param dueDate: Calculated date upon which a customer billing amount is due, used in the invoicing process to determine when a Customer's Payment is delinquent. It takes into consideration the regulatory criteria and the Customer's requested due date. In the absence of a Customer requested due date, the due date is typically calculated from the regulated number of days and the 'billingDate'. + @param outBalance: Outstanding balance on the CustomerAccount as of the statement date. + @param lastPaymentDate: Date of the last payment received from the customer. It is retained in the Customer Billing system, although the details of each payment are tracked in the ERP system. + @param billingDate: Business date designated for the billing run which produced this CustomerBillingInfo. + @param ErpInvoiceLineItems: + @param CustomerAccount: + """ + #: Type of payment plan. + self.pymtPlanType = pymtPlanType + + #: Kind of bill customer receives. Values are: "consolidatedUdc", "other", "separateEssUdc", "consolidatedEss" + self.kind = kind + + #: Monthly amortized amount due during each billing cycle for the CustomerAccount balance for which the Payment Plan is set-up. + self.pymtPlanAmt = pymtPlanAmt + + #: Amount of the last payment received from the customer. It is retained in the Customer Billing system, although the details of each payment are tracked in the ERP system. + self.lastPaymentAmt = lastPaymentAmt + + #: Calculated date upon which a customer billing amount is due, used in the invoicing process to determine when a Customer's Payment is delinquent. It takes into consideration the regulatory criteria and the Customer's requested due date. In the absence of a Customer requested due date, the due date is typically calculated from the regulated number of days and the 'billingDate'. + self.dueDate = dueDate + + #: Outstanding balance on the CustomerAccount as of the statement date. + self.outBalance = outBalance + + #: Date of the last payment received from the customer. It is retained in the Customer Billing system, although the details of each payment are tracked in the ERP system. + self.lastPaymentDate = lastPaymentDate + + #: Business date designated for the billing run which produced this CustomerBillingInfo. + self.billingDate = billingDate + + self._ErpInvoiceLineItems = [] + self.ErpInvoiceLineItems = [] if ErpInvoiceLineItems is None else ErpInvoiceLineItems + + self._CustomerAccount = None + self.CustomerAccount = CustomerAccount + + super(CustomerBillingInfo, self).__init__(*args, **kw_args) + + _attrs = ["pymtPlanType", "kind", "pymtPlanAmt", "lastPaymentAmt", "dueDate", "outBalance", "lastPaymentDate", "billingDate"] + _attr_types = {"pymtPlanType": str, "kind": str, "pymtPlanAmt": float, "lastPaymentAmt": float, "dueDate": str, "outBalance": float, "lastPaymentDate": str, "billingDate": str} + _defaults = {"pymtPlanType": '', "kind": "consolidatedUdc", "pymtPlanAmt": 0.0, "lastPaymentAmt": 0.0, "dueDate": '', "outBalance": 0.0, "lastPaymentDate": '', "billingDate": ''} + _enums = {"kind": "CustomerBillingKind"} + _refs = ["ErpInvoiceLineItems", "CustomerAccount"] + _many_refs = ["ErpInvoiceLineItems"] + + def getErpInvoiceLineItems(self): + + return self._ErpInvoiceLineItems + + def setErpInvoiceLineItems(self, value): + for p in self._ErpInvoiceLineItems: + filtered = [q for q in p.CustomerBillingInfos if q != self] + self._ErpInvoiceLineItems._CustomerBillingInfos = filtered + for r in value: + if self not in r._CustomerBillingInfos: + r._CustomerBillingInfos.append(self) + self._ErpInvoiceLineItems = value + + ErpInvoiceLineItems = property(getErpInvoiceLineItems, setErpInvoiceLineItems) + + def addErpInvoiceLineItems(self, *ErpInvoiceLineItems): + for obj in ErpInvoiceLineItems: + if self not in obj._CustomerBillingInfos: + obj._CustomerBillingInfos.append(self) + self._ErpInvoiceLineItems.append(obj) + + def removeErpInvoiceLineItems(self, *ErpInvoiceLineItems): + for obj in ErpInvoiceLineItems: + if self in obj._CustomerBillingInfos: + obj._CustomerBillingInfos.remove(self) + self._ErpInvoiceLineItems.remove(obj) + + def getCustomerAccount(self): + + return self._CustomerAccount + + def setCustomerAccount(self, value): + if self._CustomerAccount is not None: + filtered = [x for x in self.CustomerAccount.CustomerBillingInfos if x != self] + self._CustomerAccount._CustomerBillingInfos = filtered + + self._CustomerAccount = value + if self._CustomerAccount is not None: + if self not in self._CustomerAccount._CustomerBillingInfos: + self._CustomerAccount._CustomerBillingInfos.append(self) + + CustomerAccount = property(getCustomerAccount, setCustomerAccount) + diff --git a/CIM16/IEC61970/Informative/InfCustomers/ExternalCustomerAgreement.py b/CIM16/IEC61970/Informative/InfCustomers/ExternalCustomerAgreement.py new file mode 100755 index 00000000..44f3c299 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCustomers/ExternalCustomerAgreement.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Agreement import Agreement + +class ExternalCustomerAgreement(Agreement): + """A type of customer agreement involving an external agency. For example, a customer may form a contracts with an Energy Service Supplier if Direct Access is permitted.A type of customer agreement involving an external agency. For example, a customer may form a contracts with an Energy Service Supplier if Direct Access is permitted. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'ExternalCustomerAgreement' instance. + + """ + super(ExternalCustomerAgreement, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfCustomers/OutageHistory.py b/CIM16/IEC61970/Informative/InfCustomers/OutageHistory.py new file mode 100755 index 00000000..0eac48fd --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCustomers/OutageHistory.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class OutageHistory(Document): + """A document collecting OutageReports, that allows utilities to examine the number of outages suffered by a customer. Also provides data to calculate the total supply interruption to any customer over a given period.A document collecting OutageReports, that allows utilities to examine the number of outages suffered by a customer. Also provides data to calculate the total supply interruption to any customer over a given period. + """ + + def __init__(self, OutageReports=None, *args, **kw_args): + """Initialises a new 'OutageHistory' instance. + + @param OutageReports: OutageReports per customer for which this OutageHistory is created. + """ + self._OutageReports = [] + self.OutageReports = [] if OutageReports is None else OutageReports + + super(OutageHistory, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["OutageReports"] + _many_refs = ["OutageReports"] + + def getOutageReports(self): + """OutageReports per customer for which this OutageHistory is created. + """ + return self._OutageReports + + def setOutageReports(self, value): + for x in self._OutageReports: + x.OutageHistory = None + for y in value: + y._OutageHistory = self + self._OutageReports = value + + OutageReports = property(getOutageReports, setOutageReports) + + def addOutageReports(self, *OutageReports): + for obj in OutageReports: + obj.OutageHistory = self + + def removeOutageReports(self, *OutageReports): + for obj in OutageReports: + obj.OutageHistory = None + diff --git a/CIM16/IEC61970/Informative/InfCustomers/PowerQualityPricing.py b/CIM16/IEC61970/Informative/InfCustomers/PowerQualityPricing.py new file mode 100755 index 00000000..a8497a77 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCustomers/PowerQualityPricing.py @@ -0,0 +1,75 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class PowerQualityPricing(Document): + """Pricing can be based on power quality.Pricing can be based on power quality. + """ + + def __init__(self, normalLowVoltLimit=0.0, valueUninterruptedServiceEnergy=0.0, voltLimitViolCost=0.0, normalHighVoltLimit=0.0, emergencyHighVoltLimit=0.0, emergencyLowVoltLimit=0.0, powerFactorMin=0.0, voltImbalanceViolCost=0.0, valueUninterruptedServiceP=0.0, *args, **kw_args): + """Initialises a new 'PowerQualityPricing' instance. + + @param normalLowVoltLimit: Normal low voltage limit. + @param valueUninterruptedServiceEnergy: Value of uninterrupted service (Cost per energy). + @param voltLimitViolCost: Voltage limit violation cost (Cost per unit Voltage). + @param normalHighVoltLimit: Normal high voltage limit. + @param emergencyHighVoltLimit: Emergency high voltage limit. + @param emergencyLowVoltLimit: Emergency low voltage limit. + @param powerFactorMin: Threshold minimum power factor for this PricingStructure, specified in instances where a special charge is levied if the actual power factor for a Service falls below the value specified here. + @param voltImbalanceViolCost: Voltage imbalance violation cost (Cost per unit Voltage). + @param valueUninterruptedServiceP: Value of uninterrupted service (Cost per active power). + """ + #: Normal low voltage limit. + self.normalLowVoltLimit = normalLowVoltLimit + + #: Value of uninterrupted service (Cost per energy). + self.valueUninterruptedServiceEnergy = valueUninterruptedServiceEnergy + + #: Voltage limit violation cost (Cost per unit Voltage). + self.voltLimitViolCost = voltLimitViolCost + + #: Normal high voltage limit. + self.normalHighVoltLimit = normalHighVoltLimit + + #: Emergency high voltage limit. + self.emergencyHighVoltLimit = emergencyHighVoltLimit + + #: Emergency low voltage limit. + self.emergencyLowVoltLimit = emergencyLowVoltLimit + + #: Threshold minimum power factor for this PricingStructure, specified in instances where a special charge is levied if the actual power factor for a Service falls below the value specified here. + self.powerFactorMin = powerFactorMin + + #: Voltage imbalance violation cost (Cost per unit Voltage). + self.voltImbalanceViolCost = voltImbalanceViolCost + + #: Value of uninterrupted service (Cost per active power). + self.valueUninterruptedServiceP = valueUninterruptedServiceP + + super(PowerQualityPricing, self).__init__(*args, **kw_args) + + _attrs = ["normalLowVoltLimit", "valueUninterruptedServiceEnergy", "voltLimitViolCost", "normalHighVoltLimit", "emergencyHighVoltLimit", "emergencyLowVoltLimit", "powerFactorMin", "voltImbalanceViolCost", "valueUninterruptedServiceP"] + _attr_types = {"normalLowVoltLimit": float, "valueUninterruptedServiceEnergy": float, "voltLimitViolCost": float, "normalHighVoltLimit": float, "emergencyHighVoltLimit": float, "emergencyLowVoltLimit": float, "powerFactorMin": float, "voltImbalanceViolCost": float, "valueUninterruptedServiceP": float} + _defaults = {"normalLowVoltLimit": 0.0, "valueUninterruptedServiceEnergy": 0.0, "voltLimitViolCost": 0.0, "normalHighVoltLimit": 0.0, "emergencyHighVoltLimit": 0.0, "emergencyLowVoltLimit": 0.0, "powerFactorMin": 0.0, "voltImbalanceViolCost": 0.0, "valueUninterruptedServiceP": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfCustomers/ServiceGuarantee.py b/CIM16/IEC61970/Informative/InfCustomers/ServiceGuarantee.py new file mode 100755 index 00000000..426e1498 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCustomers/ServiceGuarantee.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ServiceGuarantee(Document): + """A service guarantee, often imposed by a regulator, defines conditions that, if not satisfied, will result in the utility making a monetary payment to the customer. Note that guarantee's identifier is in the 'name' attribute and the status of the guarantee is in the 'Status.status' attribute. Example service requirements include: 1) If power is not restored within 24 hours, customers can claim $50 for residential customers or $100 for commercial and industrial customers. In addition for each extra period of 12 hours the customer's supply has not been activated, the customer can claim $25. 2) If a customer has a question about their electricity bill, the utility will investigate and respond to the inquiry within 15 working days. If utility fails to meet its guarantee, utility will automatically pay the customer $50.A service guarantee, often imposed by a regulator, defines conditions that, if not satisfied, will result in the utility making a monetary payment to the customer. Note that guarantee's identifier is in the 'name' attribute and the status of the guarantee is in the 'Status.status' attribute. Example service requirements include: 1) If power is not restored within 24 hours, customers can claim $50 for residential customers or $100 for commercial and industrial customers. In addition for each extra period of 12 hours the customer's supply has not been activated, the customer can claim $25. 2) If a customer has a question about their electricity bill, the utility will investigate and respond to the inquiry within 15 working days. If utility fails to meet its guarantee, utility will automatically pay the customer $50. + """ + + def __init__(self, automaticPay=False, payAmount=0.0, serviceRequirement='', applicationPeriod=None, *args, **kw_args): + """Initialises a new 'ServiceGuarantee' instance. + + @param automaticPay: True if utility must autmatically pay the specified amount whenever the condition is not satisified, otherwise customer must make a claim to receive payment. + @param payAmount: Amount to be paid by the service provider to the customer for each violation of the 'serviceRequirement'. + @param serviceRequirement: Explanation of the requirement and conditions for satisfying it. + @param applicationPeriod: Period in which this service guantee applies. + """ + #: True if utility must autmatically pay the specified amount whenever the condition is not satisified, otherwise customer must make a claim to receive payment. + self.automaticPay = automaticPay + + #: Amount to be paid by the service provider to the customer for each violation of the 'serviceRequirement'. + self.payAmount = payAmount + + #: Explanation of the requirement and conditions for satisfying it. + self.serviceRequirement = serviceRequirement + + self.applicationPeriod = applicationPeriod + + super(ServiceGuarantee, self).__init__(*args, **kw_args) + + _attrs = ["automaticPay", "payAmount", "serviceRequirement"] + _attr_types = {"automaticPay": bool, "payAmount": float, "serviceRequirement": str} + _defaults = {"automaticPay": False, "payAmount": 0.0, "serviceRequirement": ''} + _enums = {} + _refs = ["applicationPeriod"] + _many_refs = [] + + # Period in which this service guantee applies. + applicationPeriod = None + diff --git a/CIM16/IEC61970/Informative/InfCustomers/StandardIndustryCode.py b/CIM16/IEC61970/Informative/InfCustomers/StandardIndustryCode.py new file mode 100755 index 00000000..ef4d3d5a --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCustomers/StandardIndustryCode.py @@ -0,0 +1,68 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class StandardIndustryCode(Document): + """The Standard Industrial Classification (SIC) are the codes that identify the type of products/service an industry is involved in, and used for statutory reporting purposes. For example, in the USA these codes are located by the federal government, and then published in a book entitled 'The Standard Industrial Classification Manual'. The codes are arranged in a hierarchical structure. Note that Residential Service Agreements are not classified according to the SIC codes.The Standard Industrial Classification (SIC) are the codes that identify the type of products/service an industry is involved in, and used for statutory reporting purposes. For example, in the USA these codes are located by the federal government, and then published in a book entitled 'The Standard Industrial Classification Manual'. The codes are arranged in a hierarchical structure. Note that Residential Service Agreements are not classified according to the SIC codes. + """ + + def __init__(self, code='', CustomerAgreements=None, *args, **kw_args): + """Initialises a new 'StandardIndustryCode' instance. + + @param code: Standard alphanumeric code assigned to a particular product/service within an industry. + @param CustomerAgreements: + """ + #: Standard alphanumeric code assigned to a particular product/service within an industry. + self.code = code + + self._CustomerAgreements = [] + self.CustomerAgreements = [] if CustomerAgreements is None else CustomerAgreements + + super(StandardIndustryCode, self).__init__(*args, **kw_args) + + _attrs = ["code"] + _attr_types = {"code": str} + _defaults = {"code": ''} + _enums = {} + _refs = ["CustomerAgreements"] + _many_refs = ["CustomerAgreements"] + + def getCustomerAgreements(self): + + return self._CustomerAgreements + + def setCustomerAgreements(self, value): + for x in self._CustomerAgreements: + x.StandardIndustryCode = None + for y in value: + y._StandardIndustryCode = self + self._CustomerAgreements = value + + CustomerAgreements = property(getCustomerAgreements, setCustomerAgreements) + + def addCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + obj.StandardIndustryCode = self + + def removeCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + obj.StandardIndustryCode = None + diff --git a/CIM16/IEC61970/Informative/InfCustomers/SubscribePowerCurve.py b/CIM16/IEC61970/Informative/InfCustomers/SubscribePowerCurve.py new file mode 100755 index 00000000..5a1ebbf1 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCustomers/SubscribePowerCurve.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class SubscribePowerCurve(Curve): + """Price curve for specifying the cost of energy (X) at points in time (y1) according to a prcing structure, which is based on a tariff.Price curve for specifying the cost of energy (X) at points in time (y1) according to a prcing structure, which is based on a tariff. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'SubscribePowerCurve' instance. + + """ + super(SubscribePowerCurve, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfCustomers/WorkBillingInfo.py b/CIM16/IEC61970/Informative/InfCustomers/WorkBillingInfo.py new file mode 100755 index 00000000..1910fe44 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCustomers/WorkBillingInfo.py @@ -0,0 +1,143 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class WorkBillingInfo(Document): + """Billing information for work performed for the customer. The history of Work Billing Info, Invoices, and Payments is to be maintained in associated ActivityRecords.Billing information for work performed for the customer. The history of Work Billing Info, Invoices, and Payments is to be maintained in associated ActivityRecords. + """ + + def __init__(self, issueDateTime='', deposit=0.0, costEstimate=0.0, discount=0.0, dueDateTime='', receivedDateTime='', workPrice=0.0, Works=None, CustomerAccount=None, ErpLineItems=None, *args, **kw_args): + """Initialises a new 'WorkBillingInfo' instance. + + @param issueDateTime: Date and time bill was issued to client. + @param deposit: Amount of price on deposit. + @param costEstimate: Estimated cost for work. + @param discount: Discount from standard price. + @param dueDateTime: Date and time by which payment for bill is expected from client. + @param receivedDateTime: Date payment was received from client. + @param workPrice: Amount of bill. + @param Works: + @param CustomerAccount: + @param ErpLineItems: + """ + #: Date and time bill was issued to client. + self.issueDateTime = issueDateTime + + #: Amount of price on deposit. + self.deposit = deposit + + #: Estimated cost for work. + self.costEstimate = costEstimate + + #: Discount from standard price. + self.discount = discount + + #: Date and time by which payment for bill is expected from client. + self.dueDateTime = dueDateTime + + #: Date payment was received from client. + self.receivedDateTime = receivedDateTime + + #: Amount of bill. + self.workPrice = workPrice + + self._Works = [] + self.Works = [] if Works is None else Works + + self._CustomerAccount = None + self.CustomerAccount = CustomerAccount + + self._ErpLineItems = [] + self.ErpLineItems = [] if ErpLineItems is None else ErpLineItems + + super(WorkBillingInfo, self).__init__(*args, **kw_args) + + _attrs = ["issueDateTime", "deposit", "costEstimate", "discount", "dueDateTime", "receivedDateTime", "workPrice"] + _attr_types = {"issueDateTime": str, "deposit": float, "costEstimate": float, "discount": float, "dueDateTime": str, "receivedDateTime": str, "workPrice": float} + _defaults = {"issueDateTime": '', "deposit": 0.0, "costEstimate": 0.0, "discount": 0.0, "dueDateTime": '', "receivedDateTime": '', "workPrice": 0.0} + _enums = {} + _refs = ["Works", "CustomerAccount", "ErpLineItems"] + _many_refs = ["Works", "ErpLineItems"] + + def getWorks(self): + + return self._Works + + def setWorks(self, value): + for x in self._Works: + x.WorkBillingInfo = None + for y in value: + y._WorkBillingInfo = self + self._Works = value + + Works = property(getWorks, setWorks) + + def addWorks(self, *Works): + for obj in Works: + obj.WorkBillingInfo = self + + def removeWorks(self, *Works): + for obj in Works: + obj.WorkBillingInfo = None + + def getCustomerAccount(self): + + return self._CustomerAccount + + def setCustomerAccount(self, value): + if self._CustomerAccount is not None: + filtered = [x for x in self.CustomerAccount.WorkBillingInfos if x != self] + self._CustomerAccount._WorkBillingInfos = filtered + + self._CustomerAccount = value + if self._CustomerAccount is not None: + if self not in self._CustomerAccount._WorkBillingInfos: + self._CustomerAccount._WorkBillingInfos.append(self) + + CustomerAccount = property(getCustomerAccount, setCustomerAccount) + + def getErpLineItems(self): + + return self._ErpLineItems + + def setErpLineItems(self, value): + for p in self._ErpLineItems: + filtered = [q for q in p.WorkBillingInfos if q != self] + self._ErpLineItems._WorkBillingInfos = filtered + for r in value: + if self not in r._WorkBillingInfos: + r._WorkBillingInfos.append(self) + self._ErpLineItems = value + + ErpLineItems = property(getErpLineItems, setErpLineItems) + + def addErpLineItems(self, *ErpLineItems): + for obj in ErpLineItems: + if self not in obj._WorkBillingInfos: + obj._WorkBillingInfos.append(self) + self._ErpLineItems.append(obj) + + def removeErpLineItems(self, *ErpLineItems): + for obj in ErpLineItems: + if self in obj._WorkBillingInfos: + obj._WorkBillingInfos.remove(self) + self._ErpLineItems.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfCustomers/__init__.py b/CIM16/IEC61970/Informative/InfCustomers/__init__.py new file mode 100755 index 00000000..939cf999 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfCustomers/__init__.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The package is used to define detailed customer models. +""" + +from CIM16.IEC61970.Informative.InfCustomers.StandardIndustryCode import StandardIndustryCode +from CIM16.IEC61970.Informative.InfCustomers.OutageHistory import OutageHistory +from CIM16.IEC61970.Informative.InfCustomers.ComplianceEvent import ComplianceEvent +from CIM16.IEC61970.Informative.InfCustomers.CustomerBillingInfo import CustomerBillingInfo +from CIM16.IEC61970.Informative.InfCustomers.ServiceGuarantee import ServiceGuarantee +from CIM16.IEC61970.Informative.InfCustomers.SubscribePowerCurve import SubscribePowerCurve +from CIM16.IEC61970.Informative.InfCustomers.ExternalCustomerAgreement import ExternalCustomerAgreement +from CIM16.IEC61970.Informative.InfCustomers.PowerQualityPricing import PowerQualityPricing +from CIM16.IEC61970.Informative.InfCustomers.WorkBillingInfo import WorkBillingInfo + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#InfCustomers" +nsPrefix = "cimInfCustomers" + + +class CustomerBillingKind(str): + """Values are: consolidatedUdc, other, separateEssUdc, consolidatedEss + """ + pass diff --git a/CIM16/IEC61970/Informative/InfERPSupport/DocErpPersonRole.py b/CIM16/IEC61970/Informative/InfERPSupport/DocErpPersonRole.py new file mode 100755 index 00000000..22235f46 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/DocErpPersonRole.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.Role import Role + +class DocErpPersonRole(Role): + """Roles played between Persons and Documents.Roles played between Persons and Documents. + """ + + def __init__(self, Document=None, ErpPerson=None, *args, **kw_args): + """Initialises a new 'DocErpPersonRole' instance. + + @param Document: + @param ErpPerson: + """ + self._Document = None + self.Document = Document + + self._ErpPerson = None + self.ErpPerson = ErpPerson + + super(DocErpPersonRole, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Document", "ErpPerson"] + _many_refs = [] + + def getDocument(self): + + return self._Document + + def setDocument(self, value): + if self._Document is not None: + filtered = [x for x in self.Document.ErpPersonRoles if x != self] + self._Document._ErpPersonRoles = filtered + + self._Document = value + if self._Document is not None: + if self not in self._Document._ErpPersonRoles: + self._Document._ErpPersonRoles.append(self) + + Document = property(getDocument, setDocument) + + def getErpPerson(self): + + return self._ErpPerson + + def setErpPerson(self, value): + if self._ErpPerson is not None: + filtered = [x for x in self.ErpPerson.DocumentRoles if x != self] + self._ErpPerson._DocumentRoles = filtered + + self._ErpPerson = value + if self._ErpPerson is not None: + if self not in self._ErpPerson._DocumentRoles: + self._ErpPerson._DocumentRoles.append(self) + + ErpPerson = property(getErpPerson, setErpPerson) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/DocOrgRole.py b/CIM16/IEC61970/Informative/InfERPSupport/DocOrgRole.py new file mode 100755 index 00000000..3851b7d4 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/DocOrgRole.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.Role import Role + +class DocOrgRole(Role): + """Roles played between Organisations and Documents.Roles played between Organisations and Documents. + """ + + def __init__(self, Document=None, ErpOrganisation=None, *args, **kw_args): + """Initialises a new 'DocOrgRole' instance. + + @param Document: + @param ErpOrganisation: + """ + self._Document = None + self.Document = Document + + self._ErpOrganisation = None + self.ErpOrganisation = ErpOrganisation + + super(DocOrgRole, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Document", "ErpOrganisation"] + _many_refs = [] + + def getDocument(self): + + return self._Document + + def setDocument(self, value): + if self._Document is not None: + filtered = [x for x in self.Document.ErpOrganisationRoles if x != self] + self._Document._ErpOrganisationRoles = filtered + + self._Document = value + if self._Document is not None: + if self not in self._Document._ErpOrganisationRoles: + self._Document._ErpOrganisationRoles.append(self) + + Document = property(getDocument, setDocument) + + def getErpOrganisation(self): + + return self._ErpOrganisation + + def setErpOrganisation(self, value): + if self._ErpOrganisation is not None: + filtered = [x for x in self.ErpOrganisation.DocumentRoles if x != self] + self._ErpOrganisation._DocumentRoles = filtered + + self._ErpOrganisation = value + if self._ErpOrganisation is not None: + if self not in self._ErpOrganisation._DocumentRoles: + self._ErpOrganisation._DocumentRoles.append(self) + + ErpOrganisation = property(getErpOrganisation, setErpOrganisation) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpBOM.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpBOM.py new file mode 100755 index 00000000..a8ffab9a --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpBOM.py @@ -0,0 +1,84 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpBOM(Document): + """Information that generally describes the Bill of Material Structure and its contents for a utility. This is used by ERP systems to transfer Bill of Material information between two business applications.Information that generally describes the Bill of Material Structure and its contents for a utility. This is used by ERP systems to transfer Bill of Material information between two business applications. + """ + + def __init__(self, Design=None, ErpBomItemDatas=None, *args, **kw_args): + """Initialises a new 'ErpBOM' instance. + + @param Design: + @param ErpBomItemDatas: + """ + self._Design = None + self.Design = Design + + self._ErpBomItemDatas = [] + self.ErpBomItemDatas = [] if ErpBomItemDatas is None else ErpBomItemDatas + + super(ErpBOM, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Design", "ErpBomItemDatas"] + _many_refs = ["ErpBomItemDatas"] + + def getDesign(self): + + return self._Design + + def setDesign(self, value): + if self._Design is not None: + filtered = [x for x in self.Design.ErpBOMs if x != self] + self._Design._ErpBOMs = filtered + + self._Design = value + if self._Design is not None: + if self not in self._Design._ErpBOMs: + self._Design._ErpBOMs.append(self) + + Design = property(getDesign, setDesign) + + def getErpBomItemDatas(self): + + return self._ErpBomItemDatas + + def setErpBomItemDatas(self, value): + for x in self._ErpBomItemDatas: + x.ErpBOM = None + for y in value: + y._ErpBOM = self + self._ErpBomItemDatas = value + + ErpBomItemDatas = property(getErpBomItemDatas, setErpBomItemDatas) + + def addErpBomItemDatas(self, *ErpBomItemDatas): + for obj in ErpBomItemDatas: + obj.ErpBOM = self + + def removeErpBomItemDatas(self, *ErpBomItemDatas): + for obj in ErpBomItemDatas: + obj.ErpBOM = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpBankAccount.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpBankAccount.py new file mode 100755 index 00000000..8ae739ec --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpBankAccount.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.BankAccount import BankAccount + +class ErpBankAccount(BankAccount): + """Relationship under a particular name, usually evidenced by a deposit against which withdrawals can be made. Types of bank accounts include: demand, time, custodial, joint, trustee, corporate, special, and regular accounts. A statement of transactions during a fiscal period and the resulting balance is maintained on each account. For Payment metering, the account is associated with Bank and Supplier, reflecting details of the bank account used for depositing revenue collected by TokenVendor. The name of the account holder should be specified in 'name' attribute.Relationship under a particular name, usually evidenced by a deposit against which withdrawals can be made. Types of bank accounts include: demand, time, custodial, joint, trustee, corporate, special, and regular accounts. A statement of transactions during a fiscal period and the resulting balance is maintained on each account. For Payment metering, the account is associated with Bank and Supplier, reflecting details of the bank account used for depositing revenue collected by TokenVendor. The name of the account holder should be specified in 'name' attribute. + """ + + def __init__(self, bankABA='', *args, **kw_args): + """Initialises a new 'ErpBankAccount' instance. + + @param bankABA: Bank ABA. + """ + #: Bank ABA. + self.bankABA = bankABA + + super(ErpBankAccount, self).__init__(*args, **kw_args) + + _attrs = ["bankABA"] + _attr_types = {"bankABA": str} + _defaults = {"bankABA": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpBomItemData.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpBomItemData.py new file mode 100755 index 00000000..bacfd30c --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpBomItemData.py @@ -0,0 +1,99 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpBomItemData(IdentifiedObject): + """An individual item on a bill of materials.An individual item on a bill of materials. + """ + + def __init__(self, TypeAsset=None, ErpBOM=None, DesignLocation=None, *args, **kw_args): + """Initialises a new 'ErpBomItemData' instance. + + @param TypeAsset: + @param ErpBOM: + @param DesignLocation: + """ + self._TypeAsset = None + self.TypeAsset = TypeAsset + + self._ErpBOM = None + self.ErpBOM = ErpBOM + + self._DesignLocation = None + self.DesignLocation = DesignLocation + + super(ErpBomItemData, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TypeAsset", "ErpBOM", "DesignLocation"] + _many_refs = [] + + def getTypeAsset(self): + + return self._TypeAsset + + def setTypeAsset(self, value): + if self._TypeAsset is not None: + filtered = [x for x in self.TypeAsset.ErpBomItemDatas if x != self] + self._TypeAsset._ErpBomItemDatas = filtered + + self._TypeAsset = value + if self._TypeAsset is not None: + if self not in self._TypeAsset._ErpBomItemDatas: + self._TypeAsset._ErpBomItemDatas.append(self) + + TypeAsset = property(getTypeAsset, setTypeAsset) + + def getErpBOM(self): + + return self._ErpBOM + + def setErpBOM(self, value): + if self._ErpBOM is not None: + filtered = [x for x in self.ErpBOM.ErpBomItemDatas if x != self] + self._ErpBOM._ErpBomItemDatas = filtered + + self._ErpBOM = value + if self._ErpBOM is not None: + if self not in self._ErpBOM._ErpBomItemDatas: + self._ErpBOM._ErpBomItemDatas.append(self) + + ErpBOM = property(getErpBOM, setErpBOM) + + def getDesignLocation(self): + + return self._DesignLocation + + def setDesignLocation(self, value): + if self._DesignLocation is not None: + filtered = [x for x in self.DesignLocation.ErpBomItemDatas if x != self] + self._DesignLocation._ErpBomItemDatas = filtered + + self._DesignLocation = value + if self._DesignLocation is not None: + if self not in self._DesignLocation._ErpBomItemDatas: + self._DesignLocation._ErpBomItemDatas.append(self) + + DesignLocation = property(getDesignLocation, setDesignLocation) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpChartOfAccounts.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpChartOfAccounts.py new file mode 100755 index 00000000..c44d94f5 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpChartOfAccounts.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpChartOfAccounts(Document): + """Accounting structure of a business. Each account represents a financial aspect of a business, such as its Accounts Payable, or the value of its inventory, or its office supply expenses.Accounting structure of a business. Each account represents a financial aspect of a business, such as its Accounts Payable, or the value of its inventory, or its office supply expenses. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'ErpChartOfAccounts' instance. + + """ + super(ErpChartOfAccounts, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpCompetency.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpCompetency.py new file mode 100755 index 00000000..20493791 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpCompetency.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpCompetency(IdentifiedObject): + """Information that describes aptitudes of a utility employee. Unlike Skills that an ErpPerson must be certified to perform before undertaking certain type of assignments (to be able to perfrom a Craft), ErpCompetency has more to do with typical Human Resource (HR) matters such as schooling, training, etc.Information that describes aptitudes of a utility employee. Unlike Skills that an ErpPerson must be certified to perform before undertaking certain type of assignments (to be able to perfrom a Craft), ErpCompetency has more to do with typical Human Resource (HR) matters such as schooling, training, etc. + """ + + def __init__(self, ErpPersons=None, *args, **kw_args): + """Initialises a new 'ErpCompetency' instance. + + @param ErpPersons: + """ + self._ErpPersons = [] + self.ErpPersons = [] if ErpPersons is None else ErpPersons + + super(ErpCompetency, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpPersons"] + _many_refs = ["ErpPersons"] + + def getErpPersons(self): + + return self._ErpPersons + + def setErpPersons(self, value): + for x in self._ErpPersons: + x.ErpCompetency = None + for y in value: + y._ErpCompetency = self + self._ErpPersons = value + + ErpPersons = property(getErpPersons, setErpPersons) + + def addErpPersons(self, *ErpPersons): + for obj in ErpPersons: + obj.ErpCompetency = self + + def removeErpPersons(self, *ErpPersons): + for obj in ErpPersons: + obj.ErpCompetency = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpEngChangeOrder.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpEngChangeOrder.py new file mode 100755 index 00000000..cc45d4af --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpEngChangeOrder.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpEngChangeOrder(Document): + """General Utility Engineering Change Order information.General Utility Engineering Change Order information. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'ErpEngChangeOrder' instance. + + """ + super(ErpEngChangeOrder, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpInventory.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpInventory.py new file mode 100755 index 00000000..6eced606 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpInventory.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpInventory(IdentifiedObject): + """Utility inventory-related information about an item or part (and not for description of the item and its attributes). It is used by ERP applications to enable the synchronization of Inventory data that exists on separate Item Master databases. This data is not the master data that describes the attributes of the item such as dimensions, weight, or unit of measure - it describes the item as it exists at a specific location.Utility inventory-related information about an item or part (and not for description of the item and its attributes). It is used by ERP applications to enable the synchronization of Inventory data that exists on separate Item Master databases. This data is not the master data that describes the attributes of the item such as dimensions, weight, or unit of measure - it describes the item as it exists at a specific location. + """ + + def __init__(self, Asset=None, status=None, *args, **kw_args): + """Initialises a new 'ErpInventory' instance. + + @param Asset: + @param status: + """ + self._Asset = None + self.Asset = Asset + + self.status = status + + super(ErpInventory, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Asset", "status"] + _many_refs = [] + + def getAsset(self): + + return self._Asset + + def setAsset(self, value): + if self._Asset is not None: + self._Asset._ErpInventory = None + + self._Asset = value + if self._Asset is not None: + self._Asset.ErpInventory = None + self._Asset._ErpInventory = self + + Asset = property(getAsset, setAsset) + + status = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpInventoryCount.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpInventoryCount.py new file mode 100755 index 00000000..a44f534e --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpInventoryCount.py @@ -0,0 +1,84 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpInventoryCount(IdentifiedObject): + """This is related to Inventory physical counts organized by AssetModel. Note that a count of a type of asset can be accomplished by the association inherited by AssetModel (from Document) to Asset. It enables ERP applications to transfer an inventory count between ERP and the actual physical inventory location. This count may be a cycle count or a physical count.This is related to Inventory physical counts organized by AssetModel. Note that a count of a type of asset can be accomplished by the association inherited by AssetModel (from Document) to Asset. It enables ERP applications to transfer an inventory count between ERP and the actual physical inventory location. This count may be a cycle count or a physical count. + """ + + def __init__(self, status=None, MaterialItem=None, AssetModel=None, *args, **kw_args): + """Initialises a new 'ErpInventoryCount' instance. + + @param status: + @param MaterialItem: + @param AssetModel: + """ + self.status = status + + self._MaterialItem = None + self.MaterialItem = MaterialItem + + self._AssetModel = None + self.AssetModel = AssetModel + + super(ErpInventoryCount, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["status", "MaterialItem", "AssetModel"] + _many_refs = [] + + status = None + + def getMaterialItem(self): + + return self._MaterialItem + + def setMaterialItem(self, value): + if self._MaterialItem is not None: + filtered = [x for x in self.MaterialItem.ErpInventoryCounts if x != self] + self._MaterialItem._ErpInventoryCounts = filtered + + self._MaterialItem = value + if self._MaterialItem is not None: + if self not in self._MaterialItem._ErpInventoryCounts: + self._MaterialItem._ErpInventoryCounts.append(self) + + MaterialItem = property(getMaterialItem, setMaterialItem) + + def getAssetModel(self): + + return self._AssetModel + + def setAssetModel(self, value): + if self._AssetModel is not None: + filtered = [x for x in self.AssetModel.ErpInventoryCounts if x != self] + self._AssetModel._ErpInventoryCounts = filtered + + self._AssetModel = value + if self._AssetModel is not None: + if self not in self._AssetModel._ErpInventoryCounts: + self._AssetModel._ErpInventoryCounts.append(self) + + AssetModel = property(getAssetModel, setAssetModel) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpInvoice.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpInvoice.py new file mode 100755 index 00000000..d9bdfdfd --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpInvoice.py @@ -0,0 +1,120 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpInvoice(Document): + """A roll up of invoice line items. The whole invoice has a due date and amount to be paid, with information such as customer, banks etc. being obtained through associations. The invoice roll up is based on individual line items that each contain amounts and descriptions for specific services or products.A roll up of invoice line items. The whole invoice has a due date and amount to be paid, with information such as customer, banks etc. being obtained through associations. The invoice roll up is based on individual line items that each contain amounts and descriptions for specific services or products. + """ + + def __init__(self, mailedDate='', transactionDateTime='', amount=0.0, dueDate='', billMediaKind="other", referenceNumber='', kind="sales", transferType='', proForma=False, ErpInvoiceLineItems=None, CustomerAccount=None, *args, **kw_args): + """Initialises a new 'ErpInvoice' instance. + + @param mailedDate: Date on which the customer billing statement/invoice was printed/mailed. + @param transactionDateTime: Date and time when the invoice is issued. + @param amount: Total amount due on this invoice based on line items and applicable adjustments. + @param dueDate: Calculated date upon which the Invoice amount is due. + @param billMediaKind: Kind of media by which the CustomerBillingInfo was delivered. Values are: "other", "paper", "electronic" + @param referenceNumber: Number of an invoice to be reference by this invoice. + @param kind: Kind of invoice (default is 'sales'). Values are: "sales", "purchase" + @param transferType: Type of invoice transfer. + @param proForma: True if payment is to be paid by a Customer to accept a particular ErpQuote (with associated Design) and have work initiated, at which time an associated ErpInvoice should automatically be generated. EprPayment.subjectStatus satisfies terms specificed in the ErpQuote. + @param ErpInvoiceLineItems: + @param CustomerAccount: + """ + #: Date on which the customer billing statement/invoice was printed/mailed. + self.mailedDate = mailedDate + + #: Date and time when the invoice is issued. + self.transactionDateTime = transactionDateTime + + #: Total amount due on this invoice based on line items and applicable adjustments. + self.amount = amount + + #: Calculated date upon which the Invoice amount is due. + self.dueDate = dueDate + + #: Kind of media by which the CustomerBillingInfo was delivered. Values are: "other", "paper", "electronic" + self.billMediaKind = billMediaKind + + #: Number of an invoice to be reference by this invoice. + self.referenceNumber = referenceNumber + + #: Kind of invoice (default is 'sales'). Values are: "sales", "purchase" + self.kind = kind + + #: Type of invoice transfer. + self.transferType = transferType + + #: True if payment is to be paid by a Customer to accept a particular ErpQuote (with associated Design) and have work initiated, at which time an associated ErpInvoice should automatically be generated. EprPayment.subjectStatus satisfies terms specificed in the ErpQuote. + self.proForma = proForma + + self._ErpInvoiceLineItems = [] + self.ErpInvoiceLineItems = [] if ErpInvoiceLineItems is None else ErpInvoiceLineItems + + self._CustomerAccount = None + self.CustomerAccount = CustomerAccount + + super(ErpInvoice, self).__init__(*args, **kw_args) + + _attrs = ["mailedDate", "transactionDateTime", "amount", "dueDate", "billMediaKind", "referenceNumber", "kind", "transferType", "proForma"] + _attr_types = {"mailedDate": str, "transactionDateTime": str, "amount": float, "dueDate": str, "billMediaKind": str, "referenceNumber": str, "kind": str, "transferType": str, "proForma": bool} + _defaults = {"mailedDate": '', "transactionDateTime": '', "amount": 0.0, "dueDate": '', "billMediaKind": "other", "referenceNumber": '', "kind": "sales", "transferType": '', "proForma": False} + _enums = {"billMediaKind": "BillMediaKind", "kind": "ErpInvoiceKind"} + _refs = ["ErpInvoiceLineItems", "CustomerAccount"] + _many_refs = ["ErpInvoiceLineItems"] + + def getErpInvoiceLineItems(self): + + return self._ErpInvoiceLineItems + + def setErpInvoiceLineItems(self, value): + for x in self._ErpInvoiceLineItems: + x.ErpInvoice = None + for y in value: + y._ErpInvoice = self + self._ErpInvoiceLineItems = value + + ErpInvoiceLineItems = property(getErpInvoiceLineItems, setErpInvoiceLineItems) + + def addErpInvoiceLineItems(self, *ErpInvoiceLineItems): + for obj in ErpInvoiceLineItems: + obj.ErpInvoice = self + + def removeErpInvoiceLineItems(self, *ErpInvoiceLineItems): + for obj in ErpInvoiceLineItems: + obj.ErpInvoice = None + + def getCustomerAccount(self): + + return self._CustomerAccount + + def setCustomerAccount(self, value): + if self._CustomerAccount is not None: + filtered = [x for x in self.CustomerAccount.ErpInvoicees if x != self] + self._CustomerAccount._ErpInvoicees = filtered + + self._CustomerAccount = value + if self._CustomerAccount is not None: + if self not in self._CustomerAccount._ErpInvoicees: + self._CustomerAccount._ErpInvoicees.append(self) + + CustomerAccount = property(getCustomerAccount, setCustomerAccount) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpInvoiceLineItem.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpInvoiceLineItem.py new file mode 100755 index 00000000..90a24dd4 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpInvoiceLineItem.py @@ -0,0 +1,368 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpInvoiceLineItem(Document): + """An individual line item on an invoice.An individual line item on an invoice. + """ + + def __init__(self, lineNumber='', glDateTime='', lineAmount=0.0, netAmount=0.0, kind="other", lineVersion='', glAccount='', previousAmount=0.0, ErpPayments=None, ContainerErpInvoiceLineItem=None, WorkBillingInfos=None, ErpQuoteLineItem=None, UserAttributes=None, ErpRecDelvLineItem=None, ErpPayableLineItem=None, ComponentErpInvoiceLineItems=None, billPeriod=None, ErpInvoice=None, CustomerBillingInfos=None, ErpRecLineItem=None, ErpJournalEntries=None, *args, **kw_args): + """Initialises a new 'ErpInvoiceLineItem' instance. + + @param lineNumber: Line item number on invoice statement. + @param glDateTime: Date and time line item will be posted to the General Ledger. + @param lineAmount: Amount due for this line item. + @param netAmount: Net line item charge amount. + @param kind: Kind of line item. Values are: "other", "recalculation", "initial" + @param lineVersion: Version number of the bill run. + @param glAccount: General Ledger account code, must be a valid combination. + @param previousAmount: Previous line item charge amount. + @param ErpPayments: + @param ContainerErpInvoiceLineItem: + @param WorkBillingInfos: + @param ErpQuoteLineItem: + @param UserAttributes: + @param ErpRecDelvLineItem: + @param ErpPayableLineItem: + @param ComponentErpInvoiceLineItems: + @param billPeriod: Bill period for the line item. + @param ErpInvoice: + @param CustomerBillingInfos: Customer billing for services rendered. + @param ErpRecLineItem: + @param ErpJournalEntries: + """ + #: Line item number on invoice statement. + self.lineNumber = lineNumber + + #: Date and time line item will be posted to the General Ledger. + self.glDateTime = glDateTime + + #: Amount due for this line item. + self.lineAmount = lineAmount + + #: Net line item charge amount. + self.netAmount = netAmount + + #: Kind of line item. Values are: "other", "recalculation", "initial" + self.kind = kind + + #: Version number of the bill run. + self.lineVersion = lineVersion + + #: General Ledger account code, must be a valid combination. + self.glAccount = glAccount + + #: Previous line item charge amount. + self.previousAmount = previousAmount + + self._ErpPayments = [] + self.ErpPayments = [] if ErpPayments is None else ErpPayments + + self._ContainerErpInvoiceLineItem = None + self.ContainerErpInvoiceLineItem = ContainerErpInvoiceLineItem + + self._WorkBillingInfos = [] + self.WorkBillingInfos = [] if WorkBillingInfos is None else WorkBillingInfos + + self._ErpQuoteLineItem = None + self.ErpQuoteLineItem = ErpQuoteLineItem + + self._UserAttributes = [] + self.UserAttributes = [] if UserAttributes is None else UserAttributes + + self._ErpRecDelvLineItem = None + self.ErpRecDelvLineItem = ErpRecDelvLineItem + + self._ErpPayableLineItem = None + self.ErpPayableLineItem = ErpPayableLineItem + + self._ComponentErpInvoiceLineItems = [] + self.ComponentErpInvoiceLineItems = [] if ComponentErpInvoiceLineItems is None else ComponentErpInvoiceLineItems + + self.billPeriod = billPeriod + + self._ErpInvoice = None + self.ErpInvoice = ErpInvoice + + self._CustomerBillingInfos = [] + self.CustomerBillingInfos = [] if CustomerBillingInfos is None else CustomerBillingInfos + + self._ErpRecLineItem = None + self.ErpRecLineItem = ErpRecLineItem + + self._ErpJournalEntries = [] + self.ErpJournalEntries = [] if ErpJournalEntries is None else ErpJournalEntries + + super(ErpInvoiceLineItem, self).__init__(*args, **kw_args) + + _attrs = ["lineNumber", "glDateTime", "lineAmount", "netAmount", "kind", "lineVersion", "glAccount", "previousAmount"] + _attr_types = {"lineNumber": str, "glDateTime": str, "lineAmount": float, "netAmount": float, "kind": str, "lineVersion": str, "glAccount": str, "previousAmount": float} + _defaults = {"lineNumber": '', "glDateTime": '', "lineAmount": 0.0, "netAmount": 0.0, "kind": "other", "lineVersion": '', "glAccount": '', "previousAmount": 0.0} + _enums = {"kind": "ErpInvoiceLineItemKind"} + _refs = ["ErpPayments", "ContainerErpInvoiceLineItem", "WorkBillingInfos", "ErpQuoteLineItem", "UserAttributes", "ErpRecDelvLineItem", "ErpPayableLineItem", "ComponentErpInvoiceLineItems", "billPeriod", "ErpInvoice", "CustomerBillingInfos", "ErpRecLineItem", "ErpJournalEntries"] + _many_refs = ["ErpPayments", "WorkBillingInfos", "UserAttributes", "ComponentErpInvoiceLineItems", "CustomerBillingInfos", "ErpJournalEntries"] + + def getErpPayments(self): + + return self._ErpPayments + + def setErpPayments(self, value): + for p in self._ErpPayments: + filtered = [q for q in p.ErpInvoiceLineItems if q != self] + self._ErpPayments._ErpInvoiceLineItems = filtered + for r in value: + if self not in r._ErpInvoiceLineItems: + r._ErpInvoiceLineItems.append(self) + self._ErpPayments = value + + ErpPayments = property(getErpPayments, setErpPayments) + + def addErpPayments(self, *ErpPayments): + for obj in ErpPayments: + if self not in obj._ErpInvoiceLineItems: + obj._ErpInvoiceLineItems.append(self) + self._ErpPayments.append(obj) + + def removeErpPayments(self, *ErpPayments): + for obj in ErpPayments: + if self in obj._ErpInvoiceLineItems: + obj._ErpInvoiceLineItems.remove(self) + self._ErpPayments.remove(obj) + + def getContainerErpInvoiceLineItem(self): + + return self._ContainerErpInvoiceLineItem + + def setContainerErpInvoiceLineItem(self, value): + if self._ContainerErpInvoiceLineItem is not None: + filtered = [x for x in self.ContainerErpInvoiceLineItem.ComponentErpInvoiceLineItems if x != self] + self._ContainerErpInvoiceLineItem._ComponentErpInvoiceLineItems = filtered + + self._ContainerErpInvoiceLineItem = value + if self._ContainerErpInvoiceLineItem is not None: + if self not in self._ContainerErpInvoiceLineItem._ComponentErpInvoiceLineItems: + self._ContainerErpInvoiceLineItem._ComponentErpInvoiceLineItems.append(self) + + ContainerErpInvoiceLineItem = property(getContainerErpInvoiceLineItem, setContainerErpInvoiceLineItem) + + def getWorkBillingInfos(self): + + return self._WorkBillingInfos + + def setWorkBillingInfos(self, value): + for p in self._WorkBillingInfos: + filtered = [q for q in p.ErpLineItems if q != self] + self._WorkBillingInfos._ErpLineItems = filtered + for r in value: + if self not in r._ErpLineItems: + r._ErpLineItems.append(self) + self._WorkBillingInfos = value + + WorkBillingInfos = property(getWorkBillingInfos, setWorkBillingInfos) + + def addWorkBillingInfos(self, *WorkBillingInfos): + for obj in WorkBillingInfos: + if self not in obj._ErpLineItems: + obj._ErpLineItems.append(self) + self._WorkBillingInfos.append(obj) + + def removeWorkBillingInfos(self, *WorkBillingInfos): + for obj in WorkBillingInfos: + if self in obj._ErpLineItems: + obj._ErpLineItems.remove(self) + self._WorkBillingInfos.remove(obj) + + def getErpQuoteLineItem(self): + + return self._ErpQuoteLineItem + + def setErpQuoteLineItem(self, value): + if self._ErpQuoteLineItem is not None: + self._ErpQuoteLineItem._ErpInvoiceLineItem = None + + self._ErpQuoteLineItem = value + if self._ErpQuoteLineItem is not None: + self._ErpQuoteLineItem.ErpInvoiceLineItem = None + self._ErpQuoteLineItem._ErpInvoiceLineItem = self + + ErpQuoteLineItem = property(getErpQuoteLineItem, setErpQuoteLineItem) + + def getUserAttributes(self): + + return self._UserAttributes + + def setUserAttributes(self, value): + for p in self._UserAttributes: + filtered = [q for q in p.ErpInvoiceLineItems if q != self] + self._UserAttributes._ErpInvoiceLineItems = filtered + for r in value: + if self not in r._ErpInvoiceLineItems: + r._ErpInvoiceLineItems.append(self) + self._UserAttributes = value + + UserAttributes = property(getUserAttributes, setUserAttributes) + + def addUserAttributes(self, *UserAttributes): + for obj in UserAttributes: + if self not in obj._ErpInvoiceLineItems: + obj._ErpInvoiceLineItems.append(self) + self._UserAttributes.append(obj) + + def removeUserAttributes(self, *UserAttributes): + for obj in UserAttributes: + if self in obj._ErpInvoiceLineItems: + obj._ErpInvoiceLineItems.remove(self) + self._UserAttributes.remove(obj) + + def getErpRecDelvLineItem(self): + + return self._ErpRecDelvLineItem + + def setErpRecDelvLineItem(self, value): + if self._ErpRecDelvLineItem is not None: + self._ErpRecDelvLineItem._ErpInvoiceLineItem = None + + self._ErpRecDelvLineItem = value + if self._ErpRecDelvLineItem is not None: + self._ErpRecDelvLineItem.ErpInvoiceLineItem = None + self._ErpRecDelvLineItem._ErpInvoiceLineItem = self + + ErpRecDelvLineItem = property(getErpRecDelvLineItem, setErpRecDelvLineItem) + + def getErpPayableLineItem(self): + + return self._ErpPayableLineItem + + def setErpPayableLineItem(self, value): + if self._ErpPayableLineItem is not None: + self._ErpPayableLineItem._ErpInvoiceLineItem = None + + self._ErpPayableLineItem = value + if self._ErpPayableLineItem is not None: + self._ErpPayableLineItem.ErpInvoiceLineItem = None + self._ErpPayableLineItem._ErpInvoiceLineItem = self + + ErpPayableLineItem = property(getErpPayableLineItem, setErpPayableLineItem) + + def getComponentErpInvoiceLineItems(self): + + return self._ComponentErpInvoiceLineItems + + def setComponentErpInvoiceLineItems(self, value): + for x in self._ComponentErpInvoiceLineItems: + x.ContainerErpInvoiceLineItem = None + for y in value: + y._ContainerErpInvoiceLineItem = self + self._ComponentErpInvoiceLineItems = value + + ComponentErpInvoiceLineItems = property(getComponentErpInvoiceLineItems, setComponentErpInvoiceLineItems) + + def addComponentErpInvoiceLineItems(self, *ComponentErpInvoiceLineItems): + for obj in ComponentErpInvoiceLineItems: + obj.ContainerErpInvoiceLineItem = self + + def removeComponentErpInvoiceLineItems(self, *ComponentErpInvoiceLineItems): + for obj in ComponentErpInvoiceLineItems: + obj.ContainerErpInvoiceLineItem = None + + # Bill period for the line item. + billPeriod = None + + def getErpInvoice(self): + + return self._ErpInvoice + + def setErpInvoice(self, value): + if self._ErpInvoice is not None: + filtered = [x for x in self.ErpInvoice.ErpInvoiceLineItems if x != self] + self._ErpInvoice._ErpInvoiceLineItems = filtered + + self._ErpInvoice = value + if self._ErpInvoice is not None: + if self not in self._ErpInvoice._ErpInvoiceLineItems: + self._ErpInvoice._ErpInvoiceLineItems.append(self) + + ErpInvoice = property(getErpInvoice, setErpInvoice) + + def getCustomerBillingInfos(self): + """Customer billing for services rendered. + """ + return self._CustomerBillingInfos + + def setCustomerBillingInfos(self, value): + for p in self._CustomerBillingInfos: + filtered = [q for q in p.ErpInvoiceLineItems if q != self] + self._CustomerBillingInfos._ErpInvoiceLineItems = filtered + for r in value: + if self not in r._ErpInvoiceLineItems: + r._ErpInvoiceLineItems.append(self) + self._CustomerBillingInfos = value + + CustomerBillingInfos = property(getCustomerBillingInfos, setCustomerBillingInfos) + + def addCustomerBillingInfos(self, *CustomerBillingInfos): + for obj in CustomerBillingInfos: + if self not in obj._ErpInvoiceLineItems: + obj._ErpInvoiceLineItems.append(self) + self._CustomerBillingInfos.append(obj) + + def removeCustomerBillingInfos(self, *CustomerBillingInfos): + for obj in CustomerBillingInfos: + if self in obj._ErpInvoiceLineItems: + obj._ErpInvoiceLineItems.remove(self) + self._CustomerBillingInfos.remove(obj) + + def getErpRecLineItem(self): + + return self._ErpRecLineItem + + def setErpRecLineItem(self, value): + if self._ErpRecLineItem is not None: + self._ErpRecLineItem._ErpInvoiceLineItem = None + + self._ErpRecLineItem = value + if self._ErpRecLineItem is not None: + self._ErpRecLineItem.ErpInvoiceLineItem = None + self._ErpRecLineItem._ErpInvoiceLineItem = self + + ErpRecLineItem = property(getErpRecLineItem, setErpRecLineItem) + + def getErpJournalEntries(self): + + return self._ErpJournalEntries + + def setErpJournalEntries(self, value): + for x in self._ErpJournalEntries: + x.ErpInvoiceLineItem = None + for y in value: + y._ErpInvoiceLineItem = self + self._ErpJournalEntries = value + + ErpJournalEntries = property(getErpJournalEntries, setErpJournalEntries) + + def addErpJournalEntries(self, *ErpJournalEntries): + for obj in ErpJournalEntries: + obj.ErpInvoiceLineItem = self + + def removeErpJournalEntries(self, *ErpJournalEntries): + for obj in ErpJournalEntries: + obj.ErpInvoiceLineItem = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpIssueInventory.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpIssueInventory.py new file mode 100755 index 00000000..9c2c7eaf --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpIssueInventory.py @@ -0,0 +1,84 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpIssueInventory(IdentifiedObject): + """Can be used to request an application to process an issue or request information about an issue.Can be used to request an application to process an issue or request information about an issue. + """ + + def __init__(self, TypeAsset=None, status=None, TypeMaterial=None, *args, **kw_args): + """Initialises a new 'ErpIssueInventory' instance. + + @param TypeAsset: + @param status: + @param TypeMaterial: + """ + self._TypeAsset = None + self.TypeAsset = TypeAsset + + self.status = status + + self._TypeMaterial = None + self.TypeMaterial = TypeMaterial + + super(ErpIssueInventory, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TypeAsset", "status", "TypeMaterial"] + _many_refs = [] + + def getTypeAsset(self): + + return self._TypeAsset + + def setTypeAsset(self, value): + if self._TypeAsset is not None: + filtered = [x for x in self.TypeAsset.ErpInventoryIssues if x != self] + self._TypeAsset._ErpInventoryIssues = filtered + + self._TypeAsset = value + if self._TypeAsset is not None: + if self not in self._TypeAsset._ErpInventoryIssues: + self._TypeAsset._ErpInventoryIssues.append(self) + + TypeAsset = property(getTypeAsset, setTypeAsset) + + status = None + + def getTypeMaterial(self): + + return self._TypeMaterial + + def setTypeMaterial(self, value): + if self._TypeMaterial is not None: + filtered = [x for x in self.TypeMaterial.ErpIssueInventories if x != self] + self._TypeMaterial._ErpIssueInventories = filtered + + self._TypeMaterial = value + if self._TypeMaterial is not None: + if self not in self._TypeMaterial._ErpIssueInventories: + self._TypeMaterial._ErpIssueInventories.append(self) + + TypeMaterial = property(getTypeMaterial, setTypeMaterial) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpItemMaster.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpItemMaster.py new file mode 100755 index 00000000..d0e886c7 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpItemMaster.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpItemMaster(IdentifiedObject): + """Any unique purchased part for manufactured product tracked by ERP systems for a utility. Item, as used by the OAG, refers to the basic information about an item, including its attributes, cost, and locations. It does not include item quantities. Compare to the Inventory, which includes all quantities and other location-specific information.Any unique purchased part for manufactured product tracked by ERP systems for a utility. Item, as used by the OAG, refers to the basic information about an item, including its attributes, cost, and locations. It does not include item quantities. Compare to the Inventory, which includes all quantities and other location-specific information. + """ + + def __init__(self, Asset=None, status=None, *args, **kw_args): + """Initialises a new 'ErpItemMaster' instance. + + @param Asset: + @param status: + """ + self._Asset = None + self.Asset = Asset + + self.status = status + + super(ErpItemMaster, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Asset", "status"] + _many_refs = [] + + def getAsset(self): + + return self._Asset + + def setAsset(self, value): + if self._Asset is not None: + self._Asset._ErpItemMaster = None + + self._Asset = value + if self._Asset is not None: + self._Asset.ErpItemMaster = None + self._Asset._ErpItemMaster = self + + Asset = property(getAsset, setAsset) + + status = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpJournal.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpJournal.py new file mode 100755 index 00000000..9bfd26de --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpJournal.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpJournal(Document): + """Book for recording accounting transactions as they occur. Transactions and adjustments are first recorded in a journal, which is like a diary of instructions, advising which account to be charged and by how much. A journal represents a change in the balances of a business's financial accounts. Many tasks or transactions throughout an enterprise will result in the creation of a journal. Some examples are creating a customer invoice, paying a vendor, transferring inventory, or paying employees.Book for recording accounting transactions as they occur. Transactions and adjustments are first recorded in a journal, which is like a diary of instructions, advising which account to be charged and by how much. A journal represents a change in the balances of a business's financial accounts. Many tasks or transactions throughout an enterprise will result in the creation of a journal. Some examples are creating a customer invoice, paying a vendor, transferring inventory, or paying employees. + """ + + def __init__(self, ErpJournalEntries=None, *args, **kw_args): + """Initialises a new 'ErpJournal' instance. + + @param ErpJournalEntries: + """ + self._ErpJournalEntries = [] + self.ErpJournalEntries = [] if ErpJournalEntries is None else ErpJournalEntries + + super(ErpJournal, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpJournalEntries"] + _many_refs = ["ErpJournalEntries"] + + def getErpJournalEntries(self): + + return self._ErpJournalEntries + + def setErpJournalEntries(self, value): + for x in self._ErpJournalEntries: + x.ErpJournal = None + for y in value: + y._ErpJournal = self + self._ErpJournalEntries = value + + ErpJournalEntries = property(getErpJournalEntries, setErpJournalEntries) + + def addErpJournalEntries(self, *ErpJournalEntries): + for obj in ErpJournalEntries: + obj.ErpJournal = self + + def removeErpJournalEntries(self, *ErpJournalEntries): + for obj in ErpJournalEntries: + obj.ErpJournal = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpJournalEntry.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpJournalEntry.py new file mode 100755 index 00000000..d7ace379 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpJournalEntry.py @@ -0,0 +1,216 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpJournalEntry(IdentifiedObject): + """Details of an individual entry in a journal, which is to be posted to a ledger on the posting date.Details of an individual entry in a journal, which is to be posted to a ledger on the posting date. + """ + + def __init__(self, transactionDateTime='', sourceID='', postingDateTime='', amount=0.0, accountID='', status=None, ErpPayableLineItems=None, ErpInvoiceLineItem=None, ErpRecLineItems=None, ErpLedgerEntry=None, CostTypes=None, ErpJournal=None, *args, **kw_args): + """Initialises a new 'ErpJournalEntry' instance. + + @param transactionDateTime: Date and time journal entry was recorded. + @param sourceID: The identifer of the source for this entry. + @param postingDateTime: Date and time this entry is to be posted to the ledger. + @param amount: The amount of the debit or credit for this account. + @param accountID: Account identifier for this entry. + @param status: + @param ErpPayableLineItems: + @param ErpInvoiceLineItem: + @param ErpRecLineItems: + @param ErpLedgerEntry: + @param CostTypes: + @param ErpJournal: + """ + #: Date and time journal entry was recorded. + self.transactionDateTime = transactionDateTime + + #: The identifer of the source for this entry. + self.sourceID = sourceID + + #: Date and time this entry is to be posted to the ledger. + self.postingDateTime = postingDateTime + + #: The amount of the debit or credit for this account. + self.amount = amount + + #: Account identifier for this entry. + self.accountID = accountID + + self.status = status + + self._ErpPayableLineItems = [] + self.ErpPayableLineItems = [] if ErpPayableLineItems is None else ErpPayableLineItems + + self._ErpInvoiceLineItem = None + self.ErpInvoiceLineItem = ErpInvoiceLineItem + + self._ErpRecLineItems = [] + self.ErpRecLineItems = [] if ErpRecLineItems is None else ErpRecLineItems + + self._ErpLedgerEntry = None + self.ErpLedgerEntry = ErpLedgerEntry + + self._CostTypes = [] + self.CostTypes = [] if CostTypes is None else CostTypes + + self._ErpJournal = None + self.ErpJournal = ErpJournal + + super(ErpJournalEntry, self).__init__(*args, **kw_args) + + _attrs = ["transactionDateTime", "sourceID", "postingDateTime", "amount", "accountID"] + _attr_types = {"transactionDateTime": str, "sourceID": str, "postingDateTime": str, "amount": float, "accountID": str} + _defaults = {"transactionDateTime": '', "sourceID": '', "postingDateTime": '', "amount": 0.0, "accountID": ''} + _enums = {} + _refs = ["status", "ErpPayableLineItems", "ErpInvoiceLineItem", "ErpRecLineItems", "ErpLedgerEntry", "CostTypes", "ErpJournal"] + _many_refs = ["ErpPayableLineItems", "ErpRecLineItems", "CostTypes"] + + status = None + + def getErpPayableLineItems(self): + + return self._ErpPayableLineItems + + def setErpPayableLineItems(self, value): + for p in self._ErpPayableLineItems: + filtered = [q for q in p.ErpJournalEntries if q != self] + self._ErpPayableLineItems._ErpJournalEntries = filtered + for r in value: + if self not in r._ErpJournalEntries: + r._ErpJournalEntries.append(self) + self._ErpPayableLineItems = value + + ErpPayableLineItems = property(getErpPayableLineItems, setErpPayableLineItems) + + def addErpPayableLineItems(self, *ErpPayableLineItems): + for obj in ErpPayableLineItems: + if self not in obj._ErpJournalEntries: + obj._ErpJournalEntries.append(self) + self._ErpPayableLineItems.append(obj) + + def removeErpPayableLineItems(self, *ErpPayableLineItems): + for obj in ErpPayableLineItems: + if self in obj._ErpJournalEntries: + obj._ErpJournalEntries.remove(self) + self._ErpPayableLineItems.remove(obj) + + def getErpInvoiceLineItem(self): + + return self._ErpInvoiceLineItem + + def setErpInvoiceLineItem(self, value): + if self._ErpInvoiceLineItem is not None: + filtered = [x for x in self.ErpInvoiceLineItem.ErpJournalEntries if x != self] + self._ErpInvoiceLineItem._ErpJournalEntries = filtered + + self._ErpInvoiceLineItem = value + if self._ErpInvoiceLineItem is not None: + if self not in self._ErpInvoiceLineItem._ErpJournalEntries: + self._ErpInvoiceLineItem._ErpJournalEntries.append(self) + + ErpInvoiceLineItem = property(getErpInvoiceLineItem, setErpInvoiceLineItem) + + def getErpRecLineItems(self): + + return self._ErpRecLineItems + + def setErpRecLineItems(self, value): + for p in self._ErpRecLineItems: + filtered = [q for q in p.ErpJournalEntries if q != self] + self._ErpRecLineItems._ErpJournalEntries = filtered + for r in value: + if self not in r._ErpJournalEntries: + r._ErpJournalEntries.append(self) + self._ErpRecLineItems = value + + ErpRecLineItems = property(getErpRecLineItems, setErpRecLineItems) + + def addErpRecLineItems(self, *ErpRecLineItems): + for obj in ErpRecLineItems: + if self not in obj._ErpJournalEntries: + obj._ErpJournalEntries.append(self) + self._ErpRecLineItems.append(obj) + + def removeErpRecLineItems(self, *ErpRecLineItems): + for obj in ErpRecLineItems: + if self in obj._ErpJournalEntries: + obj._ErpJournalEntries.remove(self) + self._ErpRecLineItems.remove(obj) + + def getErpLedgerEntry(self): + + return self._ErpLedgerEntry + + def setErpLedgerEntry(self, value): + if self._ErpLedgerEntry is not None: + self._ErpLedgerEntry._ErpJounalEntry = None + + self._ErpLedgerEntry = value + if self._ErpLedgerEntry is not None: + self._ErpLedgerEntry.ErpJounalEntry = None + self._ErpLedgerEntry._ErpJounalEntry = self + + ErpLedgerEntry = property(getErpLedgerEntry, setErpLedgerEntry) + + def getCostTypes(self): + + return self._CostTypes + + def setCostTypes(self, value): + for p in self._CostTypes: + filtered = [q for q in p.ErpJournalEntries if q != self] + self._CostTypes._ErpJournalEntries = filtered + for r in value: + if self not in r._ErpJournalEntries: + r._ErpJournalEntries.append(self) + self._CostTypes = value + + CostTypes = property(getCostTypes, setCostTypes) + + def addCostTypes(self, *CostTypes): + for obj in CostTypes: + if self not in obj._ErpJournalEntries: + obj._ErpJournalEntries.append(self) + self._CostTypes.append(obj) + + def removeCostTypes(self, *CostTypes): + for obj in CostTypes: + if self in obj._ErpJournalEntries: + obj._ErpJournalEntries.remove(self) + self._CostTypes.remove(obj) + + def getErpJournal(self): + + return self._ErpJournal + + def setErpJournal(self, value): + if self._ErpJournal is not None: + filtered = [x for x in self.ErpJournal.ErpJournalEntries if x != self] + self._ErpJournal._ErpJournalEntries = filtered + + self._ErpJournal = value + if self._ErpJournal is not None: + if self not in self._ErpJournal._ErpJournalEntries: + self._ErpJournal._ErpJournalEntries.append(self) + + ErpJournal = property(getErpJournal, setErpJournal) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpLedBudLineItem.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpLedBudLineItem.py new file mode 100755 index 00000000..19683686 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpLedBudLineItem.py @@ -0,0 +1,83 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpLedBudLineItem(IdentifiedObject): + """Individual entry of a given Ledger Budget, typically containing information such as amount, accounting date, accounting period, and is associated with the applicable general ledger account.Individual entry of a given Ledger Budget, typically containing information such as amount, accounting date, accounting period, and is associated with the applicable general ledger account. + """ + + def __init__(self, ErpLedBudLineItem=None, ErpLedgerBudget=None, status=None, *args, **kw_args): + """Initialises a new 'ErpLedBudLineItem' instance. + + @param ErpLedBudLineItem: + @param ErpLedgerBudget: + @param status: + """ + self._ErpLedBudLineItem = None + self.ErpLedBudLineItem = ErpLedBudLineItem + + self._ErpLedgerBudget = None + self.ErpLedgerBudget = ErpLedgerBudget + + self.status = status + + super(ErpLedBudLineItem, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpLedBudLineItem", "ErpLedgerBudget", "status"] + _many_refs = [] + + def getErpLedBudLineItem(self): + + return self._ErpLedBudLineItem + + def setErpLedBudLineItem(self, value): + if self._ErpLedBudLineItem is not None: + self._ErpLedBudLineItem._ErpLedgerEntry = None + + self._ErpLedBudLineItem = value + if self._ErpLedBudLineItem is not None: + self._ErpLedBudLineItem.ErpLedgerEntry = None + self._ErpLedBudLineItem._ErpLedgerEntry = self + + ErpLedBudLineItem = property(getErpLedBudLineItem, setErpLedBudLineItem) + + def getErpLedgerBudget(self): + + return self._ErpLedgerBudget + + def setErpLedgerBudget(self, value): + if self._ErpLedgerBudget is not None: + filtered = [x for x in self.ErpLedgerBudget.ErpLedBudLineItems if x != self] + self._ErpLedgerBudget._ErpLedBudLineItems = filtered + + self._ErpLedgerBudget = value + if self._ErpLedgerBudget is not None: + if self not in self._ErpLedgerBudget._ErpLedBudLineItems: + self._ErpLedgerBudget._ErpLedBudLineItems.append(self) + + ErpLedgerBudget = property(getErpLedgerBudget, setErpLedgerBudget) + + status = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpLedger.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpLedger.py new file mode 100755 index 00000000..df49d7ff --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpLedger.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpLedger(Document): + """In accounting transactions, a ledger is a book containing accounts to which debits and credits are posted from journals, where transactions are initially recorded. Journal entries are periodically posted to the ledger. Ledger Actual represents actual amounts by account within ledger within company or business area. Actual amounts may be generated in a source application and then loaded to a specific ledger within the enterprise general ledger or budget application.In accounting transactions, a ledger is a book containing accounts to which debits and credits are posted from journals, where transactions are initially recorded. Journal entries are periodically posted to the ledger. Ledger Actual represents actual amounts by account within ledger within company or business area. Actual amounts may be generated in a source application and then loaded to a specific ledger within the enterprise general ledger or budget application. + """ + + def __init__(self, ErpLedgerEntries=None, *args, **kw_args): + """Initialises a new 'ErpLedger' instance. + + @param ErpLedgerEntries: + """ + self._ErpLedgerEntries = [] + self.ErpLedgerEntries = [] if ErpLedgerEntries is None else ErpLedgerEntries + + super(ErpLedger, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpLedgerEntries"] + _many_refs = ["ErpLedgerEntries"] + + def getErpLedgerEntries(self): + + return self._ErpLedgerEntries + + def setErpLedgerEntries(self, value): + for x in self._ErpLedgerEntries: + x.ErpLedger = None + for y in value: + y._ErpLedger = self + self._ErpLedgerEntries = value + + ErpLedgerEntries = property(getErpLedgerEntries, setErpLedgerEntries) + + def addErpLedgerEntries(self, *ErpLedgerEntries): + for obj in ErpLedgerEntries: + obj.ErpLedger = self + + def removeErpLedgerEntries(self, *ErpLedgerEntries): + for obj in ErpLedgerEntries: + obj.ErpLedger = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpLedgerBudget.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpLedgerBudget.py new file mode 100755 index 00000000..9d843fd9 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpLedgerBudget.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpLedgerBudget(Document): + """Information for utility Ledger Budgets. They support the transfer budget amounts between all possible source applications throughout an enterprise and a general ledger or budget application.Information for utility Ledger Budgets. They support the transfer budget amounts between all possible source applications throughout an enterprise and a general ledger or budget application. + """ + + def __init__(self, ErpLedBudLineItems=None, *args, **kw_args): + """Initialises a new 'ErpLedgerBudget' instance. + + @param ErpLedBudLineItems: + """ + self._ErpLedBudLineItems = [] + self.ErpLedBudLineItems = [] if ErpLedBudLineItems is None else ErpLedBudLineItems + + super(ErpLedgerBudget, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpLedBudLineItems"] + _many_refs = ["ErpLedBudLineItems"] + + def getErpLedBudLineItems(self): + + return self._ErpLedBudLineItems + + def setErpLedBudLineItems(self, value): + for x in self._ErpLedBudLineItems: + x.ErpLedgerBudget = None + for y in value: + y._ErpLedgerBudget = self + self._ErpLedBudLineItems = value + + ErpLedBudLineItems = property(getErpLedBudLineItems, setErpLedBudLineItems) + + def addErpLedBudLineItems(self, *ErpLedBudLineItems): + for obj in ErpLedBudLineItems: + obj.ErpLedgerBudget = self + + def removeErpLedBudLineItems(self, *ErpLedBudLineItems): + for obj in ErpLedBudLineItems: + obj.ErpLedgerBudget = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpLedgerEntry.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpLedgerEntry.py new file mode 100755 index 00000000..632c14c6 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpLedgerEntry.py @@ -0,0 +1,153 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpLedgerEntry(IdentifiedObject): + """Details of an individual entry in a ledger, which was posted from a journal on the posted date.Details of an individual entry in a ledger, which was posted from a journal on the posted date. + """ + + def __init__(self, transactionDateTime='', accountKind="normal", amount=0.0, postedDateTime='', accountID='', ErpLedger=None, status=None, ErpLedgerEntry=None, UserAttributes=None, ErpJounalEntry=None, *args, **kw_args): + """Initialises a new 'ErpLedgerEntry' instance. + + @param transactionDateTime: Date and time journal entry was recorded. + @param accountKind: Kind of account for this entry. Values are: "normal", "estimate", "statistical", "reversal" + @param amount: The amount of the debit or credit for this account. + @param postedDateTime: Date and time this entry was posted to the ledger. + @param accountID: Account identifier for this entry. + @param ErpLedger: + @param status: + @param ErpLedgerEntry: + @param UserAttributes: + @param ErpJounalEntry: + """ + #: Date and time journal entry was recorded. + self.transactionDateTime = transactionDateTime + + #: Kind of account for this entry. Values are: "normal", "estimate", "statistical", "reversal" + self.accountKind = accountKind + + #: The amount of the debit or credit for this account. + self.amount = amount + + #: Date and time this entry was posted to the ledger. + self.postedDateTime = postedDateTime + + #: Account identifier for this entry. + self.accountID = accountID + + self._ErpLedger = None + self.ErpLedger = ErpLedger + + self.status = status + + self._ErpLedgerEntry = None + self.ErpLedgerEntry = ErpLedgerEntry + + self._UserAttributes = [] + self.UserAttributes = [] if UserAttributes is None else UserAttributes + + self._ErpJounalEntry = None + self.ErpJounalEntry = ErpJounalEntry + + super(ErpLedgerEntry, self).__init__(*args, **kw_args) + + _attrs = ["transactionDateTime", "accountKind", "amount", "postedDateTime", "accountID"] + _attr_types = {"transactionDateTime": str, "accountKind": str, "amount": float, "postedDateTime": str, "accountID": str} + _defaults = {"transactionDateTime": '', "accountKind": "normal", "amount": 0.0, "postedDateTime": '', "accountID": ''} + _enums = {"accountKind": "ErpAccountKind"} + _refs = ["ErpLedger", "status", "ErpLedgerEntry", "UserAttributes", "ErpJounalEntry"] + _many_refs = ["UserAttributes"] + + def getErpLedger(self): + + return self._ErpLedger + + def setErpLedger(self, value): + if self._ErpLedger is not None: + filtered = [x for x in self.ErpLedger.ErpLedgerEntries if x != self] + self._ErpLedger._ErpLedgerEntries = filtered + + self._ErpLedger = value + if self._ErpLedger is not None: + if self not in self._ErpLedger._ErpLedgerEntries: + self._ErpLedger._ErpLedgerEntries.append(self) + + ErpLedger = property(getErpLedger, setErpLedger) + + status = None + + def getErpLedgerEntry(self): + + return self._ErpLedgerEntry + + def setErpLedgerEntry(self, value): + if self._ErpLedgerEntry is not None: + self._ErpLedgerEntry._ErpLedBudLineItem = None + + self._ErpLedgerEntry = value + if self._ErpLedgerEntry is not None: + self._ErpLedgerEntry.ErpLedBudLineItem = None + self._ErpLedgerEntry._ErpLedBudLineItem = self + + ErpLedgerEntry = property(getErpLedgerEntry, setErpLedgerEntry) + + def getUserAttributes(self): + + return self._UserAttributes + + def setUserAttributes(self, value): + for p in self._UserAttributes: + filtered = [q for q in p.ErpLedgerEntries if q != self] + self._UserAttributes._ErpLedgerEntries = filtered + for r in value: + if self not in r._ErpLedgerEntries: + r._ErpLedgerEntries.append(self) + self._UserAttributes = value + + UserAttributes = property(getUserAttributes, setUserAttributes) + + def addUserAttributes(self, *UserAttributes): + for obj in UserAttributes: + if self not in obj._ErpLedgerEntries: + obj._ErpLedgerEntries.append(self) + self._UserAttributes.append(obj) + + def removeUserAttributes(self, *UserAttributes): + for obj in UserAttributes: + if self in obj._ErpLedgerEntries: + obj._ErpLedgerEntries.remove(self) + self._UserAttributes.remove(obj) + + def getErpJounalEntry(self): + + return self._ErpJounalEntry + + def setErpJounalEntry(self, value): + if self._ErpJounalEntry is not None: + self._ErpJounalEntry._ErpLedgerEntry = None + + self._ErpJounalEntry = value + if self._ErpJounalEntry is not None: + self._ErpJounalEntry.ErpLedgerEntry = None + self._ErpJounalEntry._ErpLedgerEntry = self + + ErpJounalEntry = property(getErpJounalEntry, setErpJounalEntry) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpOrganisation.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpOrganisation.py new file mode 100755 index 00000000..bf7b891f --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpOrganisation.py @@ -0,0 +1,389 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Organisation import Organisation + +class ErpOrganisation(Organisation): + """Identifies organisations that might have roles as utilities, contractors, suppliers, manufacturers, customers, etc. Organisations may also have parent-child relationships to identify departments within an organisation, or parent company relationships. The organization may be internal (e.g., departments) or external to the utility. There may be multiple organizations of a given 'category', each with a unique 'code'.Identifies organisations that might have roles as utilities, contractors, suppliers, manufacturers, customers, etc. Organisations may also have parent-child relationships to identify departments within an organisation, or parent company relationships. The organization may be internal (e.g., departments) or external to the utility. There may be multiple organizations of a given 'category', each with a unique 'code'. + """ + + def __init__(self, category='', code='', industryID='', governmentID='', optOut=False, isCostCenter=False, isProfitCenter=False, mode='', AssetRoles=None, Requests=None, Crews=None, ChangeItems=None, ErpPersonRoles=None, ActivityRecords=None, ParentOrganisationRoles=None, Locations=None, ChildOrganisationRoles=None, PowerSystemResourceRoles=None, LandPropertyRoles=None, DocumentRoles=None, *args, **kw_args): + """Initialises a new 'ErpOrganisation' instance. + + @param category: Category by utility's corporate standards and practices. + @param code: Designated code for organisation. + @param industryID: Unique identifier for a given organisation (business). In the USA, this is a 'Dunns' or D&B number. This identifier is typically in addition to the identifiers that organizations assign (on an internal basis) to each of their locations. Note that a unique identifier can be set up for each location of an organisation. This requirement is supported through the recursive Organisation-Organisation relationship, where each child Organisation can have a specified physical location. + @param governmentID: Unique identifier for organisation relative to its governing authority, for example a federal tax identifier. + @param optOut: True if organisation 'opted out', i.e., has requested that their contact information not be shared with other organisations for purposes of solicitation. + @param isCostCenter: True if organisation is cost center. + @param isProfitCenter: True if organisation is profit center. + @param mode: Operational mode of the organisation, often required for outage reporting purposes. Some utilities use text to describe various modes (like nominal, emergency, storm, other), while others use severity ratings (for example, 0 is a nominal condition and 5 is the most severe condition). + @param AssetRoles: + @param Requests: + @param Crews: + @param ChangeItems: + @param ErpPersonRoles: + @param ActivityRecords: + @param ParentOrganisationRoles: + @param Locations: + @param ChildOrganisationRoles: + @param PowerSystemResourceRoles: + @param LandPropertyRoles: + @param DocumentRoles: + """ + #: Category by utility's corporate standards and practices. + self.category = category + + #: Designated code for organisation. + self.code = code + + #: Unique identifier for a given organisation (business). In the USA, this is a 'Dunns' or D&B number. This identifier is typically in addition to the identifiers that organizations assign (on an internal basis) to each of their locations. Note that a unique identifier can be set up for each location of an organisation. This requirement is supported through the recursive Organisation-Organisation relationship, where each child Organisation can have a specified physical location. + self.industryID = industryID + + #: Unique identifier for organisation relative to its governing authority, for example a federal tax identifier. + self.governmentID = governmentID + + #: True if organisation 'opted out', i.e., has requested that their contact information not be shared with other organisations for purposes of solicitation. + self.optOut = optOut + + #: True if organisation is cost center. + self.isCostCenter = isCostCenter + + #: True if organisation is profit center. + self.isProfitCenter = isProfitCenter + + #: Operational mode of the organisation, often required for outage reporting purposes. Some utilities use text to describe various modes (like nominal, emergency, storm, other), while others use severity ratings (for example, 0 is a nominal condition and 5 is the most severe condition). + self.mode = mode + + self._AssetRoles = [] + self.AssetRoles = [] if AssetRoles is None else AssetRoles + + self._Requests = [] + self.Requests = [] if Requests is None else Requests + + self._Crews = [] + self.Crews = [] if Crews is None else Crews + + self._ChangeItems = [] + self.ChangeItems = [] if ChangeItems is None else ChangeItems + + self._ErpPersonRoles = [] + self.ErpPersonRoles = [] if ErpPersonRoles is None else ErpPersonRoles + + self._ActivityRecords = [] + self.ActivityRecords = [] if ActivityRecords is None else ActivityRecords + + self._ParentOrganisationRoles = [] + self.ParentOrganisationRoles = [] if ParentOrganisationRoles is None else ParentOrganisationRoles + + self._Locations = [] + self.Locations = [] if Locations is None else Locations + + self._ChildOrganisationRoles = [] + self.ChildOrganisationRoles = [] if ChildOrganisationRoles is None else ChildOrganisationRoles + + self._PowerSystemResourceRoles = [] + self.PowerSystemResourceRoles = [] if PowerSystemResourceRoles is None else PowerSystemResourceRoles + + self._LandPropertyRoles = [] + self.LandPropertyRoles = [] if LandPropertyRoles is None else LandPropertyRoles + + self._DocumentRoles = [] + self.DocumentRoles = [] if DocumentRoles is None else DocumentRoles + + super(ErpOrganisation, self).__init__(*args, **kw_args) + + _attrs = ["category", "code", "industryID", "governmentID", "optOut", "isCostCenter", "isProfitCenter", "mode"] + _attr_types = {"category": str, "code": str, "industryID": str, "governmentID": str, "optOut": bool, "isCostCenter": bool, "isProfitCenter": bool, "mode": str} + _defaults = {"category": '', "code": '', "industryID": '', "governmentID": '', "optOut": False, "isCostCenter": False, "isProfitCenter": False, "mode": ''} + _enums = {} + _refs = ["AssetRoles", "Requests", "Crews", "ChangeItems", "ErpPersonRoles", "ActivityRecords", "ParentOrganisationRoles", "Locations", "ChildOrganisationRoles", "PowerSystemResourceRoles", "LandPropertyRoles", "DocumentRoles"] + _many_refs = ["AssetRoles", "Requests", "Crews", "ChangeItems", "ErpPersonRoles", "ActivityRecords", "ParentOrganisationRoles", "Locations", "ChildOrganisationRoles", "PowerSystemResourceRoles", "LandPropertyRoles", "DocumentRoles"] + + def getAssetRoles(self): + + return self._AssetRoles + + def setAssetRoles(self, value): + for x in self._AssetRoles: + x.ErpOrganisation = None + for y in value: + y._ErpOrganisation = self + self._AssetRoles = value + + AssetRoles = property(getAssetRoles, setAssetRoles) + + def addAssetRoles(self, *AssetRoles): + for obj in AssetRoles: + obj.ErpOrganisation = self + + def removeAssetRoles(self, *AssetRoles): + for obj in AssetRoles: + obj.ErpOrganisation = None + + def getRequests(self): + + return self._Requests + + def setRequests(self, value): + for x in self._Requests: + x.Organisation = None + for y in value: + y._Organisation = self + self._Requests = value + + Requests = property(getRequests, setRequests) + + def addRequests(self, *Requests): + for obj in Requests: + obj.Organisation = self + + def removeRequests(self, *Requests): + for obj in Requests: + obj.Organisation = None + + def getCrews(self): + + return self._Crews + + def setCrews(self, value): + for p in self._Crews: + filtered = [q for q in p.Organisations if q != self] + self._Crews._Organisations = filtered + for r in value: + if self not in r._Organisations: + r._Organisations.append(self) + self._Crews = value + + Crews = property(getCrews, setCrews) + + def addCrews(self, *Crews): + for obj in Crews: + if self not in obj._Organisations: + obj._Organisations.append(self) + self._Crews.append(obj) + + def removeCrews(self, *Crews): + for obj in Crews: + if self in obj._Organisations: + obj._Organisations.remove(self) + self._Crews.remove(obj) + + def getChangeItems(self): + + return self._ChangeItems + + def setChangeItems(self, value): + for x in self._ChangeItems: + x.Organisation = None + for y in value: + y._Organisation = self + self._ChangeItems = value + + ChangeItems = property(getChangeItems, setChangeItems) + + def addChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.Organisation = self + + def removeChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.Organisation = None + + def getErpPersonRoles(self): + + return self._ErpPersonRoles + + def setErpPersonRoles(self, value): + for x in self._ErpPersonRoles: + x.ErpOrganisation = None + for y in value: + y._ErpOrganisation = self + self._ErpPersonRoles = value + + ErpPersonRoles = property(getErpPersonRoles, setErpPersonRoles) + + def addErpPersonRoles(self, *ErpPersonRoles): + for obj in ErpPersonRoles: + obj.ErpOrganisation = self + + def removeErpPersonRoles(self, *ErpPersonRoles): + for obj in ErpPersonRoles: + obj.ErpOrganisation = None + + def getActivityRecords(self): + + return self._ActivityRecords + + def setActivityRecords(self, value): + for p in self._ActivityRecords: + filtered = [q for q in p.Organisations if q != self] + self._ActivityRecords._Organisations = filtered + for r in value: + if self not in r._Organisations: + r._Organisations.append(self) + self._ActivityRecords = value + + ActivityRecords = property(getActivityRecords, setActivityRecords) + + def addActivityRecords(self, *ActivityRecords): + for obj in ActivityRecords: + if self not in obj._Organisations: + obj._Organisations.append(self) + self._ActivityRecords.append(obj) + + def removeActivityRecords(self, *ActivityRecords): + for obj in ActivityRecords: + if self in obj._Organisations: + obj._Organisations.remove(self) + self._ActivityRecords.remove(obj) + + def getParentOrganisationRoles(self): + + return self._ParentOrganisationRoles + + def setParentOrganisationRoles(self, value): + for x in self._ParentOrganisationRoles: + x.ChildOrganisation = None + for y in value: + y._ChildOrganisation = self + self._ParentOrganisationRoles = value + + ParentOrganisationRoles = property(getParentOrganisationRoles, setParentOrganisationRoles) + + def addParentOrganisationRoles(self, *ParentOrganisationRoles): + for obj in ParentOrganisationRoles: + obj.ChildOrganisation = self + + def removeParentOrganisationRoles(self, *ParentOrganisationRoles): + for obj in ParentOrganisationRoles: + obj.ChildOrganisation = None + + def getLocations(self): + + return self._Locations + + def setLocations(self, value): + for p in self._Locations: + filtered = [q for q in p.ErpOrganisations if q != self] + self._Locations._ErpOrganisations = filtered + for r in value: + if self not in r._ErpOrganisations: + r._ErpOrganisations.append(self) + self._Locations = value + + Locations = property(getLocations, setLocations) + + def addLocations(self, *Locations): + for obj in Locations: + if self not in obj._ErpOrganisations: + obj._ErpOrganisations.append(self) + self._Locations.append(obj) + + def removeLocations(self, *Locations): + for obj in Locations: + if self in obj._ErpOrganisations: + obj._ErpOrganisations.remove(self) + self._Locations.remove(obj) + + def getChildOrganisationRoles(self): + + return self._ChildOrganisationRoles + + def setChildOrganisationRoles(self, value): + for x in self._ChildOrganisationRoles: + x.ParentOrganisation = None + for y in value: + y._ParentOrganisation = self + self._ChildOrganisationRoles = value + + ChildOrganisationRoles = property(getChildOrganisationRoles, setChildOrganisationRoles) + + def addChildOrganisationRoles(self, *ChildOrganisationRoles): + for obj in ChildOrganisationRoles: + obj.ParentOrganisation = self + + def removeChildOrganisationRoles(self, *ChildOrganisationRoles): + for obj in ChildOrganisationRoles: + obj.ParentOrganisation = None + + def getPowerSystemResourceRoles(self): + + return self._PowerSystemResourceRoles + + def setPowerSystemResourceRoles(self, value): + for x in self._PowerSystemResourceRoles: + x.ErpOrganisation = None + for y in value: + y._ErpOrganisation = self + self._PowerSystemResourceRoles = value + + PowerSystemResourceRoles = property(getPowerSystemResourceRoles, setPowerSystemResourceRoles) + + def addPowerSystemResourceRoles(self, *PowerSystemResourceRoles): + for obj in PowerSystemResourceRoles: + obj.ErpOrganisation = self + + def removePowerSystemResourceRoles(self, *PowerSystemResourceRoles): + for obj in PowerSystemResourceRoles: + obj.ErpOrganisation = None + + def getLandPropertyRoles(self): + + return self._LandPropertyRoles + + def setLandPropertyRoles(self, value): + for x in self._LandPropertyRoles: + x.ErpOrganisation = None + for y in value: + y._ErpOrganisation = self + self._LandPropertyRoles = value + + LandPropertyRoles = property(getLandPropertyRoles, setLandPropertyRoles) + + def addLandPropertyRoles(self, *LandPropertyRoles): + for obj in LandPropertyRoles: + obj.ErpOrganisation = self + + def removeLandPropertyRoles(self, *LandPropertyRoles): + for obj in LandPropertyRoles: + obj.ErpOrganisation = None + + def getDocumentRoles(self): + + return self._DocumentRoles + + def setDocumentRoles(self, value): + for x in self._DocumentRoles: + x.ErpOrganisation = None + for y in value: + y._ErpOrganisation = self + self._DocumentRoles = value + + DocumentRoles = property(getDocumentRoles, setDocumentRoles) + + def addDocumentRoles(self, *DocumentRoles): + for obj in DocumentRoles: + obj.ErpOrganisation = self + + def removeDocumentRoles(self, *DocumentRoles): + for obj in DocumentRoles: + obj.ErpOrganisation = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpPOLineItem.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpPOLineItem.py new file mode 100755 index 00000000..6676cfb2 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpPOLineItem.py @@ -0,0 +1,137 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpPOLineItem(Document): + """Of an ErpPurchaseOrder, this is an individually ordered item or product along with the quantity, price and other descriptive information.Of an ErpPurchaseOrder, this is an individually ordered item or product along with the quantity, price and other descriptive information. + """ + + def __init__(self, ErpPurchaseOrder=None, ErpRecDelLineItem=None, AssetModelCatalogueItem=None, MaterialItem=None, ErpReqLineItem=None, *args, **kw_args): + """Initialises a new 'ErpPOLineItem' instance. + + @param ErpPurchaseOrder: + @param ErpRecDelLineItem: + @param AssetModelCatalogueItem: + @param MaterialItem: + @param ErpReqLineItem: + """ + self._ErpPurchaseOrder = None + self.ErpPurchaseOrder = ErpPurchaseOrder + + self._ErpRecDelLineItem = None + self.ErpRecDelLineItem = ErpRecDelLineItem + + self._AssetModelCatalogueItem = None + self.AssetModelCatalogueItem = AssetModelCatalogueItem + + self._MaterialItem = None + self.MaterialItem = MaterialItem + + self._ErpReqLineItem = None + self.ErpReqLineItem = ErpReqLineItem + + super(ErpPOLineItem, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpPurchaseOrder", "ErpRecDelLineItem", "AssetModelCatalogueItem", "MaterialItem", "ErpReqLineItem"] + _many_refs = [] + + def getErpPurchaseOrder(self): + + return self._ErpPurchaseOrder + + def setErpPurchaseOrder(self, value): + if self._ErpPurchaseOrder is not None: + filtered = [x for x in self.ErpPurchaseOrder.ErpPOLineItems if x != self] + self._ErpPurchaseOrder._ErpPOLineItems = filtered + + self._ErpPurchaseOrder = value + if self._ErpPurchaseOrder is not None: + if self not in self._ErpPurchaseOrder._ErpPOLineItems: + self._ErpPurchaseOrder._ErpPOLineItems.append(self) + + ErpPurchaseOrder = property(getErpPurchaseOrder, setErpPurchaseOrder) + + def getErpRecDelLineItem(self): + + return self._ErpRecDelLineItem + + def setErpRecDelLineItem(self, value): + if self._ErpRecDelLineItem is not None: + self._ErpRecDelLineItem._ErpPOLineItem = None + + self._ErpRecDelLineItem = value + if self._ErpRecDelLineItem is not None: + self._ErpRecDelLineItem.ErpPOLineItem = None + self._ErpRecDelLineItem._ErpPOLineItem = self + + ErpRecDelLineItem = property(getErpRecDelLineItem, setErpRecDelLineItem) + + def getAssetModelCatalogueItem(self): + + return self._AssetModelCatalogueItem + + def setAssetModelCatalogueItem(self, value): + if self._AssetModelCatalogueItem is not None: + filtered = [x for x in self.AssetModelCatalogueItem.ErpPOLineItems if x != self] + self._AssetModelCatalogueItem._ErpPOLineItems = filtered + + self._AssetModelCatalogueItem = value + if self._AssetModelCatalogueItem is not None: + if self not in self._AssetModelCatalogueItem._ErpPOLineItems: + self._AssetModelCatalogueItem._ErpPOLineItems.append(self) + + AssetModelCatalogueItem = property(getAssetModelCatalogueItem, setAssetModelCatalogueItem) + + def getMaterialItem(self): + + return self._MaterialItem + + def setMaterialItem(self, value): + if self._MaterialItem is not None: + filtered = [x for x in self.MaterialItem.ErpPOLineItems if x != self] + self._MaterialItem._ErpPOLineItems = filtered + + self._MaterialItem = value + if self._MaterialItem is not None: + if self not in self._MaterialItem._ErpPOLineItems: + self._MaterialItem._ErpPOLineItems.append(self) + + MaterialItem = property(getMaterialItem, setMaterialItem) + + def getErpReqLineItem(self): + + return self._ErpReqLineItem + + def setErpReqLineItem(self, value): + if self._ErpReqLineItem is not None: + self._ErpReqLineItem._ErpPOLineItem = None + + self._ErpReqLineItem = value + if self._ErpReqLineItem is not None: + self._ErpReqLineItem.ErpPOLineItem = None + self._ErpReqLineItem._ErpPOLineItem = self + + ErpReqLineItem = property(getErpReqLineItem, setErpReqLineItem) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpPayable.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpPayable.py new file mode 100755 index 00000000..b7a47108 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpPayable.py @@ -0,0 +1,95 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpPayable(Document): + """A transaction that represents an invoice from a supplier. A payable (or voucher) is an open item, approved and ready for payment, in the Accounts Payable ledger.A transaction that represents an invoice from a supplier. A payable (or voucher) is an open item, approved and ready for payment, in the Accounts Payable ledger. + """ + + def __init__(self, ContractorItems=None, ErpPayableLineItems=None, *args, **kw_args): + """Initialises a new 'ErpPayable' instance. + + @param ContractorItems: + @param ErpPayableLineItems: + """ + self._ContractorItems = [] + self.ContractorItems = [] if ContractorItems is None else ContractorItems + + self._ErpPayableLineItems = [] + self.ErpPayableLineItems = [] if ErpPayableLineItems is None else ErpPayableLineItems + + super(ErpPayable, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ContractorItems", "ErpPayableLineItems"] + _many_refs = ["ContractorItems", "ErpPayableLineItems"] + + def getContractorItems(self): + + return self._ContractorItems + + def setContractorItems(self, value): + for p in self._ContractorItems: + filtered = [q for q in p.ErpPayables if q != self] + self._ContractorItems._ErpPayables = filtered + for r in value: + if self not in r._ErpPayables: + r._ErpPayables.append(self) + self._ContractorItems = value + + ContractorItems = property(getContractorItems, setContractorItems) + + def addContractorItems(self, *ContractorItems): + for obj in ContractorItems: + if self not in obj._ErpPayables: + obj._ErpPayables.append(self) + self._ContractorItems.append(obj) + + def removeContractorItems(self, *ContractorItems): + for obj in ContractorItems: + if self in obj._ErpPayables: + obj._ErpPayables.remove(self) + self._ContractorItems.remove(obj) + + def getErpPayableLineItems(self): + + return self._ErpPayableLineItems + + def setErpPayableLineItems(self, value): + for x in self._ErpPayableLineItems: + x.ErpPayable = None + for y in value: + y._ErpPayable = self + self._ErpPayableLineItems = value + + ErpPayableLineItems = property(getErpPayableLineItems, setErpPayableLineItems) + + def addErpPayableLineItems(self, *ErpPayableLineItems): + for obj in ErpPayableLineItems: + obj.ErpPayable = self + + def removeErpPayableLineItems(self, *ErpPayableLineItems): + for obj in ErpPayableLineItems: + obj.ErpPayable = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpPayableLineItem.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpPayableLineItem.py new file mode 100755 index 00000000..0f3de41d --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpPayableLineItem.py @@ -0,0 +1,145 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpPayableLineItem(IdentifiedObject): + """Of an ErpPayable, a line item references an ErpInvoiceLineitem or other source such as credit memos.Of an ErpPayable, a line item references an ErpInvoiceLineitem or other source such as credit memos. + """ + + def __init__(self, ErpPayments=None, ErpJournalEntries=None, ErpInvoiceLineItem=None, ErpPayable=None, status=None, *args, **kw_args): + """Initialises a new 'ErpPayableLineItem' instance. + + @param ErpPayments: + @param ErpJournalEntries: + @param ErpInvoiceLineItem: + @param ErpPayable: + @param status: + """ + self._ErpPayments = [] + self.ErpPayments = [] if ErpPayments is None else ErpPayments + + self._ErpJournalEntries = [] + self.ErpJournalEntries = [] if ErpJournalEntries is None else ErpJournalEntries + + self._ErpInvoiceLineItem = None + self.ErpInvoiceLineItem = ErpInvoiceLineItem + + self._ErpPayable = None + self.ErpPayable = ErpPayable + + self.status = status + + super(ErpPayableLineItem, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpPayments", "ErpJournalEntries", "ErpInvoiceLineItem", "ErpPayable", "status"] + _many_refs = ["ErpPayments", "ErpJournalEntries"] + + def getErpPayments(self): + + return self._ErpPayments + + def setErpPayments(self, value): + for p in self._ErpPayments: + filtered = [q for q in p.ErpPayableLineItems if q != self] + self._ErpPayments._ErpPayableLineItems = filtered + for r in value: + if self not in r._ErpPayableLineItems: + r._ErpPayableLineItems.append(self) + self._ErpPayments = value + + ErpPayments = property(getErpPayments, setErpPayments) + + def addErpPayments(self, *ErpPayments): + for obj in ErpPayments: + if self not in obj._ErpPayableLineItems: + obj._ErpPayableLineItems.append(self) + self._ErpPayments.append(obj) + + def removeErpPayments(self, *ErpPayments): + for obj in ErpPayments: + if self in obj._ErpPayableLineItems: + obj._ErpPayableLineItems.remove(self) + self._ErpPayments.remove(obj) + + def getErpJournalEntries(self): + + return self._ErpJournalEntries + + def setErpJournalEntries(self, value): + for p in self._ErpJournalEntries: + filtered = [q for q in p.ErpPayableLineItems if q != self] + self._ErpJournalEntries._ErpPayableLineItems = filtered + for r in value: + if self not in r._ErpPayableLineItems: + r._ErpPayableLineItems.append(self) + self._ErpJournalEntries = value + + ErpJournalEntries = property(getErpJournalEntries, setErpJournalEntries) + + def addErpJournalEntries(self, *ErpJournalEntries): + for obj in ErpJournalEntries: + if self not in obj._ErpPayableLineItems: + obj._ErpPayableLineItems.append(self) + self._ErpJournalEntries.append(obj) + + def removeErpJournalEntries(self, *ErpJournalEntries): + for obj in ErpJournalEntries: + if self in obj._ErpPayableLineItems: + obj._ErpPayableLineItems.remove(self) + self._ErpJournalEntries.remove(obj) + + def getErpInvoiceLineItem(self): + + return self._ErpInvoiceLineItem + + def setErpInvoiceLineItem(self, value): + if self._ErpInvoiceLineItem is not None: + self._ErpInvoiceLineItem._ErpPayableLineItem = None + + self._ErpInvoiceLineItem = value + if self._ErpInvoiceLineItem is not None: + self._ErpInvoiceLineItem.ErpPayableLineItem = None + self._ErpInvoiceLineItem._ErpPayableLineItem = self + + ErpInvoiceLineItem = property(getErpInvoiceLineItem, setErpInvoiceLineItem) + + def getErpPayable(self): + + return self._ErpPayable + + def setErpPayable(self, value): + if self._ErpPayable is not None: + filtered = [x for x in self.ErpPayable.ErpPayableLineItems if x != self] + self._ErpPayable._ErpPayableLineItems = filtered + + self._ErpPayable = value + if self._ErpPayable is not None: + if self not in self._ErpPayable._ErpPayableLineItems: + self._ErpPayable._ErpPayableLineItems.append(self) + + ErpPayable = property(getErpPayable, setErpPayable) + + status = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpPayment.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpPayment.py new file mode 100755 index 00000000..60024629 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpPayment.py @@ -0,0 +1,136 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpPayment(Document): + """Payment infromation and status for any individual line item of an ErpInvoice (e.g., when payment is from a customer). ErpPayable is also updated when payment is to a supplier and ErpReceivable is updated when payment is from a customer. Multiple payments can be made against a single line item and an individual payment can apply to more that one line item.Payment infromation and status for any individual line item of an ErpInvoice (e.g., when payment is from a customer). ErpPayable is also updated when payment is to a supplier and ErpReceivable is updated when payment is from a customer. Multiple payments can be made against a single line item and an individual payment can apply to more that one line item. + """ + + def __init__(self, termsPayment='', ErpRecLineItems=None, ErpPayableLineItems=None, ErpInvoiceLineItems=None, *args, **kw_args): + """Initialises a new 'ErpPayment' instance. + + @param termsPayment: Payment terms (e.g., net 30). + @param ErpRecLineItems: + @param ErpPayableLineItems: + @param ErpInvoiceLineItems: + """ + #: Payment terms (e.g., net 30). + self.termsPayment = termsPayment + + self._ErpRecLineItems = [] + self.ErpRecLineItems = [] if ErpRecLineItems is None else ErpRecLineItems + + self._ErpPayableLineItems = [] + self.ErpPayableLineItems = [] if ErpPayableLineItems is None else ErpPayableLineItems + + self._ErpInvoiceLineItems = [] + self.ErpInvoiceLineItems = [] if ErpInvoiceLineItems is None else ErpInvoiceLineItems + + super(ErpPayment, self).__init__(*args, **kw_args) + + _attrs = ["termsPayment"] + _attr_types = {"termsPayment": str} + _defaults = {"termsPayment": ''} + _enums = {} + _refs = ["ErpRecLineItems", "ErpPayableLineItems", "ErpInvoiceLineItems"] + _many_refs = ["ErpRecLineItems", "ErpPayableLineItems", "ErpInvoiceLineItems"] + + def getErpRecLineItems(self): + + return self._ErpRecLineItems + + def setErpRecLineItems(self, value): + for p in self._ErpRecLineItems: + filtered = [q for q in p.ErpPayments if q != self] + self._ErpRecLineItems._ErpPayments = filtered + for r in value: + if self not in r._ErpPayments: + r._ErpPayments.append(self) + self._ErpRecLineItems = value + + ErpRecLineItems = property(getErpRecLineItems, setErpRecLineItems) + + def addErpRecLineItems(self, *ErpRecLineItems): + for obj in ErpRecLineItems: + if self not in obj._ErpPayments: + obj._ErpPayments.append(self) + self._ErpRecLineItems.append(obj) + + def removeErpRecLineItems(self, *ErpRecLineItems): + for obj in ErpRecLineItems: + if self in obj._ErpPayments: + obj._ErpPayments.remove(self) + self._ErpRecLineItems.remove(obj) + + def getErpPayableLineItems(self): + + return self._ErpPayableLineItems + + def setErpPayableLineItems(self, value): + for p in self._ErpPayableLineItems: + filtered = [q for q in p.ErpPayments if q != self] + self._ErpPayableLineItems._ErpPayments = filtered + for r in value: + if self not in r._ErpPayments: + r._ErpPayments.append(self) + self._ErpPayableLineItems = value + + ErpPayableLineItems = property(getErpPayableLineItems, setErpPayableLineItems) + + def addErpPayableLineItems(self, *ErpPayableLineItems): + for obj in ErpPayableLineItems: + if self not in obj._ErpPayments: + obj._ErpPayments.append(self) + self._ErpPayableLineItems.append(obj) + + def removeErpPayableLineItems(self, *ErpPayableLineItems): + for obj in ErpPayableLineItems: + if self in obj._ErpPayments: + obj._ErpPayments.remove(self) + self._ErpPayableLineItems.remove(obj) + + def getErpInvoiceLineItems(self): + + return self._ErpInvoiceLineItems + + def setErpInvoiceLineItems(self, value): + for p in self._ErpInvoiceLineItems: + filtered = [q for q in p.ErpPayments if q != self] + self._ErpInvoiceLineItems._ErpPayments = filtered + for r in value: + if self not in r._ErpPayments: + r._ErpPayments.append(self) + self._ErpInvoiceLineItems = value + + ErpInvoiceLineItems = property(getErpInvoiceLineItems, setErpInvoiceLineItems) + + def addErpInvoiceLineItems(self, *ErpInvoiceLineItems): + for obj in ErpInvoiceLineItems: + if self not in obj._ErpPayments: + obj._ErpPayments.append(self) + self._ErpInvoiceLineItems.append(obj) + + def removeErpInvoiceLineItems(self, *ErpInvoiceLineItems): + for obj in ErpInvoiceLineItems: + if self in obj._ErpPayments: + obj._ErpPayments.remove(self) + self._ErpInvoiceLineItems.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpPerson.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpPerson.py new file mode 100755 index 00000000..be868c18 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpPerson.py @@ -0,0 +1,536 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpPerson(IdentifiedObject): + """General purpose information for name and other information to contact people.General purpose information for name and other information to contact people. + """ + + def __init__(self, category='', lastName='', firstName='', governmentID='', mName='', suffix='', specialNeed='', prefix='', ServiceLocation=None, ErpOrganisationRoles=None, Appointments=None, Crews=None, LaborItems=None, LandPropertyRoles=None, ActivityRecords=None, MeasurementValues=None, Skills=None, landlinePhone=None, mobilePhone=None, ChangeItems=None, status=None, DocumentRoles=None, ErpPersonnel=None, Crafts=None, CustomerData=None, CallBacks=None, SwitchingStepRoles=None, electronicAddress=None, ErpCompetency=None, *args, **kw_args): + """Initialises a new 'ErpPerson' instance. + + @param category: Category of this person relative to utility operations, classified according to the utility's corporate standards and practices. Examples include employee, contractor, agent, not affiliated, etc. Note that this field is not used to indicate whether this person is a customer of the utility. Often an employee or contractor is also a customer. Customer information is gained with relationship to Organisation and CustomerData. In similar fashion, this field does not indicate the various roles this person may fill as part of utility operations. + @param lastName: Person's last (family, sir) name. + @param firstName: Person's first name. + @param governmentID: Unique identifier for person relative to its governing authority, for example a federal tax identifier (such as a Social Security number in the United States). + @param mName: Middle name(s) or initial(s). + @param suffix: A suffix for the person's name, such as II, III, etc. + @param specialNeed: Special service needs for the person (contact) are described; examples include life support, etc. + @param prefix: A prefix or title for the person's name, such as Miss, Mister, Doctor, etc. + @param ServiceLocation: + @param ErpOrganisationRoles: + @param Appointments: + @param Crews: All Crews to which this ErpPerson belongs. + @param LaborItems: + @param LandPropertyRoles: + @param ActivityRecords: + @param MeasurementValues: + @param Skills: + @param landlinePhone: Landline phone number. + @param mobilePhone: Mobile phone number. + @param ChangeItems: + @param status: + @param DocumentRoles: + @param ErpPersonnel: + @param Crafts: + @param CustomerData: + @param CallBacks: + @param SwitchingStepRoles: + @param electronicAddress: Electronic address. + @param ErpCompetency: + """ + #: Category of this person relative to utility operations, classified according to the utility's corporate standards and practices. Examples include employee, contractor, agent, not affiliated, etc. Note that this field is not used to indicate whether this person is a customer of the utility. Often an employee or contractor is also a customer. Customer information is gained with relationship to Organisation and CustomerData. In similar fashion, this field does not indicate the various roles this person may fill as part of utility operations. + self.category = category + + #: Person's last (family, sir) name. + self.lastName = lastName + + #: Person's first name. + self.firstName = firstName + + #: Unique identifier for person relative to its governing authority, for example a federal tax identifier (such as a Social Security number in the United States). + self.governmentID = governmentID + + #: Middle name(s) or initial(s). + self.mName = mName + + #: A suffix for the person's name, such as II, III, etc. + self.suffix = suffix + + #: Special service needs for the person (contact) are described; examples include life support, etc. + self.specialNeed = specialNeed + + #: A prefix or title for the person's name, such as Miss, Mister, Doctor, etc. + self.prefix = prefix + + self._ServiceLocation = None + self.ServiceLocation = ServiceLocation + + self._ErpOrganisationRoles = [] + self.ErpOrganisationRoles = [] if ErpOrganisationRoles is None else ErpOrganisationRoles + + self._Appointments = [] + self.Appointments = [] if Appointments is None else Appointments + + self._Crews = [] + self.Crews = [] if Crews is None else Crews + + self._LaborItems = [] + self.LaborItems = [] if LaborItems is None else LaborItems + + self._LandPropertyRoles = [] + self.LandPropertyRoles = [] if LandPropertyRoles is None else LandPropertyRoles + + self._ActivityRecords = [] + self.ActivityRecords = [] if ActivityRecords is None else ActivityRecords + + self._MeasurementValues = [] + self.MeasurementValues = [] if MeasurementValues is None else MeasurementValues + + self._Skills = [] + self.Skills = [] if Skills is None else Skills + + self.landlinePhone = landlinePhone + + self.mobilePhone = mobilePhone + + self._ChangeItems = [] + self.ChangeItems = [] if ChangeItems is None else ChangeItems + + self.status = status + + self._DocumentRoles = [] + self.DocumentRoles = [] if DocumentRoles is None else DocumentRoles + + self._ErpPersonnel = None + self.ErpPersonnel = ErpPersonnel + + self._Crafts = [] + self.Crafts = [] if Crafts is None else Crafts + + self._CustomerData = None + self.CustomerData = CustomerData + + self._CallBacks = [] + self.CallBacks = [] if CallBacks is None else CallBacks + + self._SwitchingStepRoles = [] + self.SwitchingStepRoles = [] if SwitchingStepRoles is None else SwitchingStepRoles + + self.electronicAddress = electronicAddress + + self._ErpCompetency = None + self.ErpCompetency = ErpCompetency + + super(ErpPerson, self).__init__(*args, **kw_args) + + _attrs = ["category", "lastName", "firstName", "governmentID", "mName", "suffix", "specialNeed", "prefix"] + _attr_types = {"category": str, "lastName": str, "firstName": str, "governmentID": str, "mName": str, "suffix": str, "specialNeed": str, "prefix": str} + _defaults = {"category": '', "lastName": '', "firstName": '', "governmentID": '', "mName": '', "suffix": '', "specialNeed": '', "prefix": ''} + _enums = {} + _refs = ["ServiceLocation", "ErpOrganisationRoles", "Appointments", "Crews", "LaborItems", "LandPropertyRoles", "ActivityRecords", "MeasurementValues", "Skills", "landlinePhone", "mobilePhone", "ChangeItems", "status", "DocumentRoles", "ErpPersonnel", "Crafts", "CustomerData", "CallBacks", "SwitchingStepRoles", "electronicAddress", "ErpCompetency"] + _many_refs = ["ErpOrganisationRoles", "Appointments", "Crews", "LaborItems", "LandPropertyRoles", "ActivityRecords", "MeasurementValues", "Skills", "ChangeItems", "DocumentRoles", "Crafts", "CallBacks", "SwitchingStepRoles"] + + def getServiceLocation(self): + + return self._ServiceLocation + + def setServiceLocation(self, value): + if self._ServiceLocation is not None: + filtered = [x for x in self.ServiceLocation.ErpPersons if x != self] + self._ServiceLocation._ErpPersons = filtered + + self._ServiceLocation = value + if self._ServiceLocation is not None: + if self not in self._ServiceLocation._ErpPersons: + self._ServiceLocation._ErpPersons.append(self) + + ServiceLocation = property(getServiceLocation, setServiceLocation) + + def getErpOrganisationRoles(self): + + return self._ErpOrganisationRoles + + def setErpOrganisationRoles(self, value): + for x in self._ErpOrganisationRoles: + x.ErpPerson = None + for y in value: + y._ErpPerson = self + self._ErpOrganisationRoles = value + + ErpOrganisationRoles = property(getErpOrganisationRoles, setErpOrganisationRoles) + + def addErpOrganisationRoles(self, *ErpOrganisationRoles): + for obj in ErpOrganisationRoles: + obj.ErpPerson = self + + def removeErpOrganisationRoles(self, *ErpOrganisationRoles): + for obj in ErpOrganisationRoles: + obj.ErpPerson = None + + def getAppointments(self): + + return self._Appointments + + def setAppointments(self, value): + for p in self._Appointments: + filtered = [q for q in p.ErpPersons if q != self] + self._Appointments._ErpPersons = filtered + for r in value: + if self not in r._ErpPersons: + r._ErpPersons.append(self) + self._Appointments = value + + Appointments = property(getAppointments, setAppointments) + + def addAppointments(self, *Appointments): + for obj in Appointments: + if self not in obj._ErpPersons: + obj._ErpPersons.append(self) + self._Appointments.append(obj) + + def removeAppointments(self, *Appointments): + for obj in Appointments: + if self in obj._ErpPersons: + obj._ErpPersons.remove(self) + self._Appointments.remove(obj) + + def getCrews(self): + """All Crews to which this ErpPerson belongs. + """ + return self._Crews + + def setCrews(self, value): + for p in self._Crews: + filtered = [q for q in p.CrewMembers if q != self] + self._Crews._CrewMembers = filtered + for r in value: + if self not in r._CrewMembers: + r._CrewMembers.append(self) + self._Crews = value + + Crews = property(getCrews, setCrews) + + def addCrews(self, *Crews): + for obj in Crews: + if self not in obj._CrewMembers: + obj._CrewMembers.append(self) + self._Crews.append(obj) + + def removeCrews(self, *Crews): + for obj in Crews: + if self in obj._CrewMembers: + obj._CrewMembers.remove(self) + self._Crews.remove(obj) + + def getLaborItems(self): + + return self._LaborItems + + def setLaborItems(self, value): + for p in self._LaborItems: + filtered = [q for q in p.ErpPersons if q != self] + self._LaborItems._ErpPersons = filtered + for r in value: + if self not in r._ErpPersons: + r._ErpPersons.append(self) + self._LaborItems = value + + LaborItems = property(getLaborItems, setLaborItems) + + def addLaborItems(self, *LaborItems): + for obj in LaborItems: + if self not in obj._ErpPersons: + obj._ErpPersons.append(self) + self._LaborItems.append(obj) + + def removeLaborItems(self, *LaborItems): + for obj in LaborItems: + if self in obj._ErpPersons: + obj._ErpPersons.remove(self) + self._LaborItems.remove(obj) + + def getLandPropertyRoles(self): + + return self._LandPropertyRoles + + def setLandPropertyRoles(self, value): + for x in self._LandPropertyRoles: + x.ErpPerson = None + for y in value: + y._ErpPerson = self + self._LandPropertyRoles = value + + LandPropertyRoles = property(getLandPropertyRoles, setLandPropertyRoles) + + def addLandPropertyRoles(self, *LandPropertyRoles): + for obj in LandPropertyRoles: + obj.ErpPerson = self + + def removeLandPropertyRoles(self, *LandPropertyRoles): + for obj in LandPropertyRoles: + obj.ErpPerson = None + + def getActivityRecords(self): + + return self._ActivityRecords + + def setActivityRecords(self, value): + for p in self._ActivityRecords: + filtered = [q for q in p.ErpPersons if q != self] + self._ActivityRecords._ErpPersons = filtered + for r in value: + if self not in r._ErpPersons: + r._ErpPersons.append(self) + self._ActivityRecords = value + + ActivityRecords = property(getActivityRecords, setActivityRecords) + + def addActivityRecords(self, *ActivityRecords): + for obj in ActivityRecords: + if self not in obj._ErpPersons: + obj._ErpPersons.append(self) + self._ActivityRecords.append(obj) + + def removeActivityRecords(self, *ActivityRecords): + for obj in ActivityRecords: + if self in obj._ErpPersons: + obj._ErpPersons.remove(self) + self._ActivityRecords.remove(obj) + + def getMeasurementValues(self): + + return self._MeasurementValues + + def setMeasurementValues(self, value): + for x in self._MeasurementValues: + x.ErpPerson = None + for y in value: + y._ErpPerson = self + self._MeasurementValues = value + + MeasurementValues = property(getMeasurementValues, setMeasurementValues) + + def addMeasurementValues(self, *MeasurementValues): + for obj in MeasurementValues: + obj.ErpPerson = self + + def removeMeasurementValues(self, *MeasurementValues): + for obj in MeasurementValues: + obj.ErpPerson = None + + def getSkills(self): + + return self._Skills + + def setSkills(self, value): + for x in self._Skills: + x.ErpPerson = None + for y in value: + y._ErpPerson = self + self._Skills = value + + Skills = property(getSkills, setSkills) + + def addSkills(self, *Skills): + for obj in Skills: + obj.ErpPerson = self + + def removeSkills(self, *Skills): + for obj in Skills: + obj.ErpPerson = None + + # Landline phone number. + landlinePhone = None + + # Mobile phone number. + mobilePhone = None + + def getChangeItems(self): + + return self._ChangeItems + + def setChangeItems(self, value): + for x in self._ChangeItems: + x.ErpPerson = None + for y in value: + y._ErpPerson = self + self._ChangeItems = value + + ChangeItems = property(getChangeItems, setChangeItems) + + def addChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.ErpPerson = self + + def removeChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.ErpPerson = None + + status = None + + def getDocumentRoles(self): + + return self._DocumentRoles + + def setDocumentRoles(self, value): + for x in self._DocumentRoles: + x.ErpPerson = None + for y in value: + y._ErpPerson = self + self._DocumentRoles = value + + DocumentRoles = property(getDocumentRoles, setDocumentRoles) + + def addDocumentRoles(self, *DocumentRoles): + for obj in DocumentRoles: + obj.ErpPerson = self + + def removeDocumentRoles(self, *DocumentRoles): + for obj in DocumentRoles: + obj.ErpPerson = None + + def getErpPersonnel(self): + + return self._ErpPersonnel + + def setErpPersonnel(self, value): + if self._ErpPersonnel is not None: + filtered = [x for x in self.ErpPersonnel.ErpPersons if x != self] + self._ErpPersonnel._ErpPersons = filtered + + self._ErpPersonnel = value + if self._ErpPersonnel is not None: + if self not in self._ErpPersonnel._ErpPersons: + self._ErpPersonnel._ErpPersons.append(self) + + ErpPersonnel = property(getErpPersonnel, setErpPersonnel) + + def getCrafts(self): + + return self._Crafts + + def setCrafts(self, value): + for p in self._Crafts: + filtered = [q for q in p.ErpPersons if q != self] + self._Crafts._ErpPersons = filtered + for r in value: + if self not in r._ErpPersons: + r._ErpPersons.append(self) + self._Crafts = value + + Crafts = property(getCrafts, setCrafts) + + def addCrafts(self, *Crafts): + for obj in Crafts: + if self not in obj._ErpPersons: + obj._ErpPersons.append(self) + self._Crafts.append(obj) + + def removeCrafts(self, *Crafts): + for obj in Crafts: + if self in obj._ErpPersons: + obj._ErpPersons.remove(self) + self._Crafts.remove(obj) + + def getCustomerData(self): + + return self._CustomerData + + def setCustomerData(self, value): + if self._CustomerData is not None: + filtered = [x for x in self.CustomerData.ErpPersons if x != self] + self._CustomerData._ErpPersons = filtered + + self._CustomerData = value + if self._CustomerData is not None: + if self not in self._CustomerData._ErpPersons: + self._CustomerData._ErpPersons.append(self) + + CustomerData = property(getCustomerData, setCustomerData) + + def getCallBacks(self): + + return self._CallBacks + + def setCallBacks(self, value): + for p in self._CallBacks: + filtered = [q for q in p.ErpPersons if q != self] + self._CallBacks._ErpPersons = filtered + for r in value: + if self not in r._ErpPersons: + r._ErpPersons.append(self) + self._CallBacks = value + + CallBacks = property(getCallBacks, setCallBacks) + + def addCallBacks(self, *CallBacks): + for obj in CallBacks: + if self not in obj._ErpPersons: + obj._ErpPersons.append(self) + self._CallBacks.append(obj) + + def removeCallBacks(self, *CallBacks): + for obj in CallBacks: + if self in obj._ErpPersons: + obj._ErpPersons.remove(self) + self._CallBacks.remove(obj) + + def getSwitchingStepRoles(self): + + return self._SwitchingStepRoles + + def setSwitchingStepRoles(self, value): + for x in self._SwitchingStepRoles: + x.ErpPerson = None + for y in value: + y._ErpPerson = self + self._SwitchingStepRoles = value + + SwitchingStepRoles = property(getSwitchingStepRoles, setSwitchingStepRoles) + + def addSwitchingStepRoles(self, *SwitchingStepRoles): + for obj in SwitchingStepRoles: + obj.ErpPerson = self + + def removeSwitchingStepRoles(self, *SwitchingStepRoles): + for obj in SwitchingStepRoles: + obj.ErpPerson = None + + # Electronic address. + electronicAddress = None + + def getErpCompetency(self): + + return self._ErpCompetency + + def setErpCompetency(self, value): + if self._ErpCompetency is not None: + filtered = [x for x in self.ErpCompetency.ErpPersons if x != self] + self._ErpCompetency._ErpPersons = filtered + + self._ErpCompetency = value + if self._ErpCompetency is not None: + if self not in self._ErpCompetency._ErpPersons: + self._ErpCompetency._ErpPersons.append(self) + + ErpCompetency = property(getErpCompetency, setErpCompetency) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpPersonnel.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpPersonnel.py new file mode 100755 index 00000000..900b2db9 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpPersonnel.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpPersonnel(IdentifiedObject): + """Information that applies to the basic data about a utility person, used by ERP applications to transfer Personnel data for a worker.Information that applies to the basic data about a utility person, used by ERP applications to transfer Personnel data for a worker. + """ + + def __init__(self, status=None, ErpPersons=None, *args, **kw_args): + """Initialises a new 'ErpPersonnel' instance. + + @param status: + @param ErpPersons: + """ + self.status = status + + self._ErpPersons = [] + self.ErpPersons = [] if ErpPersons is None else ErpPersons + + super(ErpPersonnel, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["status", "ErpPersons"] + _many_refs = ["ErpPersons"] + + status = None + + def getErpPersons(self): + + return self._ErpPersons + + def setErpPersons(self, value): + for x in self._ErpPersons: + x.ErpPersonnel = None + for y in value: + y._ErpPersonnel = self + self._ErpPersons = value + + ErpPersons = property(getErpPersons, setErpPersons) + + def addErpPersons(self, *ErpPersons): + for obj in ErpPersons: + obj.ErpPersonnel = self + + def removeErpPersons(self, *ErpPersons): + for obj in ErpPersons: + obj.ErpPersonnel = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpProjectAccounting.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpProjectAccounting.py new file mode 100755 index 00000000..14f07200 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpProjectAccounting.py @@ -0,0 +1,139 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpProjectAccounting(Document): + """Utility Project Accounting information, used by ERP applications to enable all relevant sub-systems that submit single sided transactions to transfer information with a Project Accounting Application. This would include, but not necessarily be limited to: Accounts Payable, Accounts Receivable, Budget, Order Management, Purchasing, Time and Labor, Travel and Expense.Utility Project Accounting information, used by ERP applications to enable all relevant sub-systems that submit single sided transactions to transfer information with a Project Accounting Application. This would include, but not necessarily be limited to: Accounts Payable, Accounts Receivable, Budget, Order Management, Purchasing, Time and Labor, Travel and Expense. + """ + + def __init__(self, Works=None, Projects=None, ErpTimeEntries=None, WorkCostDetails=None, *args, **kw_args): + """Initialises a new 'ErpProjectAccounting' instance. + + @param Works: + @param Projects: + @param ErpTimeEntries: + @param WorkCostDetails: + """ + self._Works = [] + self.Works = [] if Works is None else Works + + self._Projects = [] + self.Projects = [] if Projects is None else Projects + + self._ErpTimeEntries = [] + self.ErpTimeEntries = [] if ErpTimeEntries is None else ErpTimeEntries + + self._WorkCostDetails = [] + self.WorkCostDetails = [] if WorkCostDetails is None else WorkCostDetails + + super(ErpProjectAccounting, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Works", "Projects", "ErpTimeEntries", "WorkCostDetails"] + _many_refs = ["Works", "Projects", "ErpTimeEntries", "WorkCostDetails"] + + def getWorks(self): + + return self._Works + + def setWorks(self, value): + for x in self._Works: + x.ErpProjectAccounting = None + for y in value: + y._ErpProjectAccounting = self + self._Works = value + + Works = property(getWorks, setWorks) + + def addWorks(self, *Works): + for obj in Works: + obj.ErpProjectAccounting = self + + def removeWorks(self, *Works): + for obj in Works: + obj.ErpProjectAccounting = None + + def getProjects(self): + + return self._Projects + + def setProjects(self, value): + for x in self._Projects: + x.ErpProjectAccounting = None + for y in value: + y._ErpProjectAccounting = self + self._Projects = value + + Projects = property(getProjects, setProjects) + + def addProjects(self, *Projects): + for obj in Projects: + obj.ErpProjectAccounting = self + + def removeProjects(self, *Projects): + for obj in Projects: + obj.ErpProjectAccounting = None + + def getErpTimeEntries(self): + + return self._ErpTimeEntries + + def setErpTimeEntries(self, value): + for x in self._ErpTimeEntries: + x.ErpProjectAccounting = None + for y in value: + y._ErpProjectAccounting = self + self._ErpTimeEntries = value + + ErpTimeEntries = property(getErpTimeEntries, setErpTimeEntries) + + def addErpTimeEntries(self, *ErpTimeEntries): + for obj in ErpTimeEntries: + obj.ErpProjectAccounting = self + + def removeErpTimeEntries(self, *ErpTimeEntries): + for obj in ErpTimeEntries: + obj.ErpProjectAccounting = None + + def getWorkCostDetails(self): + + return self._WorkCostDetails + + def setWorkCostDetails(self, value): + for x in self._WorkCostDetails: + x.ErpProjectAccounting = None + for y in value: + y._ErpProjectAccounting = self + self._WorkCostDetails = value + + WorkCostDetails = property(getWorkCostDetails, setWorkCostDetails) + + def addWorkCostDetails(self, *WorkCostDetails): + for obj in WorkCostDetails: + obj.ErpProjectAccounting = self + + def removeWorkCostDetails(self, *WorkCostDetails): + for obj in WorkCostDetails: + obj.ErpProjectAccounting = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpPurchaseOrder.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpPurchaseOrder.py new file mode 100755 index 00000000..e129cd91 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpPurchaseOrder.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpPurchaseOrder(Document): + """A document that communicates an order to purchase goods from a buyer to a supplier. The PurchaseOrder carries information to and from the buyer and supplier. It is a legally binding document once both Parties agree to the contents and the specified terms and conditions of the order.A document that communicates an order to purchase goods from a buyer to a supplier. The PurchaseOrder carries information to and from the buyer and supplier. It is a legally binding document once both Parties agree to the contents and the specified terms and conditions of the order. + """ + + def __init__(self, ErpPOLineItems=None, *args, **kw_args): + """Initialises a new 'ErpPurchaseOrder' instance. + + @param ErpPOLineItems: + """ + self._ErpPOLineItems = [] + self.ErpPOLineItems = [] if ErpPOLineItems is None else ErpPOLineItems + + super(ErpPurchaseOrder, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpPOLineItems"] + _many_refs = ["ErpPOLineItems"] + + def getErpPOLineItems(self): + + return self._ErpPOLineItems + + def setErpPOLineItems(self, value): + for x in self._ErpPOLineItems: + x.ErpPurchaseOrder = None + for y in value: + y._ErpPurchaseOrder = self + self._ErpPOLineItems = value + + ErpPOLineItems = property(getErpPOLineItems, setErpPOLineItems) + + def addErpPOLineItems(self, *ErpPOLineItems): + for obj in ErpPOLineItems: + obj.ErpPurchaseOrder = self + + def removeErpPOLineItems(self, *ErpPOLineItems): + for obj in ErpPOLineItems: + obj.ErpPurchaseOrder = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpQuote.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpQuote.py new file mode 100755 index 00000000..32cb5f56 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpQuote.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpQuote(Document): + """Document describing the prices of goods or services provided by a supplier. It includes the terms of the purchase, delivery proposals, identification of goods or services ordered, as well as their quantities.Document describing the prices of goods or services provided by a supplier. It includes the terms of the purchase, delivery proposals, identification of goods or services ordered, as well as their quantities. + """ + + def __init__(self, ErpQuoteLineItems=None, *args, **kw_args): + """Initialises a new 'ErpQuote' instance. + + @param ErpQuoteLineItems: + """ + self._ErpQuoteLineItems = [] + self.ErpQuoteLineItems = [] if ErpQuoteLineItems is None else ErpQuoteLineItems + + super(ErpQuote, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpQuoteLineItems"] + _many_refs = ["ErpQuoteLineItems"] + + def getErpQuoteLineItems(self): + + return self._ErpQuoteLineItems + + def setErpQuoteLineItems(self, value): + for x in self._ErpQuoteLineItems: + x.ErpQuote = None + for y in value: + y._ErpQuote = self + self._ErpQuoteLineItems = value + + ErpQuoteLineItems = property(getErpQuoteLineItems, setErpQuoteLineItems) + + def addErpQuoteLineItems(self, *ErpQuoteLineItems): + for obj in ErpQuoteLineItems: + obj.ErpQuote = self + + def removeErpQuoteLineItems(self, *ErpQuoteLineItems): + for obj in ErpQuoteLineItems: + obj.ErpQuote = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpQuoteLineItem.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpQuoteLineItem.py new file mode 100755 index 00000000..397b7572 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpQuoteLineItem.py @@ -0,0 +1,161 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpQuoteLineItem(IdentifiedObject): + """Of an ErpQuote, the item or product quoted along with quantity, price and other descriptive information.Of an ErpQuote, the item or product quoted along with quantity, price and other descriptive information. + """ + + def __init__(self, ErpQuote=None, AssetModelCatalogueItem=None, status=None, Design=None, ErpInvoiceLineItem=None, ErpReqLineItem=None, Request=None, *args, **kw_args): + """Initialises a new 'ErpQuoteLineItem' instance. + + @param ErpQuote: + @param AssetModelCatalogueItem: + @param status: + @param Design: + @param ErpInvoiceLineItem: Some utilities provide quotes to customer for services, where the customer accepts the quote by making a payment. An invoice is required for this to occur. + @param ErpReqLineItem: + @param Request: + """ + self._ErpQuote = None + self.ErpQuote = ErpQuote + + self._AssetModelCatalogueItem = None + self.AssetModelCatalogueItem = AssetModelCatalogueItem + + self.status = status + + self._Design = None + self.Design = Design + + self._ErpInvoiceLineItem = None + self.ErpInvoiceLineItem = ErpInvoiceLineItem + + self._ErpReqLineItem = None + self.ErpReqLineItem = ErpReqLineItem + + self._Request = None + self.Request = Request + + super(ErpQuoteLineItem, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpQuote", "AssetModelCatalogueItem", "status", "Design", "ErpInvoiceLineItem", "ErpReqLineItem", "Request"] + _many_refs = [] + + def getErpQuote(self): + + return self._ErpQuote + + def setErpQuote(self, value): + if self._ErpQuote is not None: + filtered = [x for x in self.ErpQuote.ErpQuoteLineItems if x != self] + self._ErpQuote._ErpQuoteLineItems = filtered + + self._ErpQuote = value + if self._ErpQuote is not None: + if self not in self._ErpQuote._ErpQuoteLineItems: + self._ErpQuote._ErpQuoteLineItems.append(self) + + ErpQuote = property(getErpQuote, setErpQuote) + + def getAssetModelCatalogueItem(self): + + return self._AssetModelCatalogueItem + + def setAssetModelCatalogueItem(self, value): + if self._AssetModelCatalogueItem is not None: + filtered = [x for x in self.AssetModelCatalogueItem.ErpQuoteLineItems if x != self] + self._AssetModelCatalogueItem._ErpQuoteLineItems = filtered + + self._AssetModelCatalogueItem = value + if self._AssetModelCatalogueItem is not None: + if self not in self._AssetModelCatalogueItem._ErpQuoteLineItems: + self._AssetModelCatalogueItem._ErpQuoteLineItems.append(self) + + AssetModelCatalogueItem = property(getAssetModelCatalogueItem, setAssetModelCatalogueItem) + + status = None + + def getDesign(self): + + return self._Design + + def setDesign(self, value): + if self._Design is not None: + self._Design._ErpQuoteLineItem = None + + self._Design = value + if self._Design is not None: + self._Design.ErpQuoteLineItem = None + self._Design._ErpQuoteLineItem = self + + Design = property(getDesign, setDesign) + + def getErpInvoiceLineItem(self): + """Some utilities provide quotes to customer for services, where the customer accepts the quote by making a payment. An invoice is required for this to occur. + """ + return self._ErpInvoiceLineItem + + def setErpInvoiceLineItem(self, value): + if self._ErpInvoiceLineItem is not None: + self._ErpInvoiceLineItem._ErpQuoteLineItem = None + + self._ErpInvoiceLineItem = value + if self._ErpInvoiceLineItem is not None: + self._ErpInvoiceLineItem.ErpQuoteLineItem = None + self._ErpInvoiceLineItem._ErpQuoteLineItem = self + + ErpInvoiceLineItem = property(getErpInvoiceLineItem, setErpInvoiceLineItem) + + def getErpReqLineItem(self): + + return self._ErpReqLineItem + + def setErpReqLineItem(self, value): + if self._ErpReqLineItem is not None: + self._ErpReqLineItem._ErpQuoteLineItem = None + + self._ErpReqLineItem = value + if self._ErpReqLineItem is not None: + self._ErpReqLineItem.ErpQuoteLineItem = None + self._ErpReqLineItem._ErpQuoteLineItem = self + + ErpReqLineItem = property(getErpReqLineItem, setErpReqLineItem) + + def getRequest(self): + + return self._Request + + def setRequest(self, value): + if self._Request is not None: + self._Request._ErpQuoteLineItem = None + + self._Request = value + if self._Request is not None: + self._Request.ErpQuoteLineItem = None + self._Request._ErpQuoteLineItem = self + + Request = property(getRequest, setRequest) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpRecDelvLineItem.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpRecDelvLineItem.py new file mode 100755 index 00000000..c4bf1779 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpRecDelvLineItem.py @@ -0,0 +1,164 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpRecDelvLineItem(IdentifiedObject): + """Of an ErpReceiveDelivery, this is an individually received good or service by the Organisation receiving goods or services. It may be used to indicate receipt of goods in conjunction with a purchase order line item.Of an ErpReceiveDelivery, this is an individually received good or service by the Organisation receiving goods or services. It may be used to indicate receipt of goods in conjunction with a purchase order line item. + """ + + def __init__(self, Assets=None, ErpInvoiceLineItem=None, status=None, ErpReceiveDelivery=None, MaterialItems=None, ErpPOLineItem=None, *args, **kw_args): + """Initialises a new 'ErpRecDelvLineItem' instance. + + @param Assets: + @param ErpInvoiceLineItem: + @param status: + @param ErpReceiveDelivery: + @param MaterialItems: + @param ErpPOLineItem: + """ + self._Assets = [] + self.Assets = [] if Assets is None else Assets + + self._ErpInvoiceLineItem = None + self.ErpInvoiceLineItem = ErpInvoiceLineItem + + self.status = status + + self._ErpReceiveDelivery = None + self.ErpReceiveDelivery = ErpReceiveDelivery + + self._MaterialItems = [] + self.MaterialItems = [] if MaterialItems is None else MaterialItems + + self._ErpPOLineItem = None + self.ErpPOLineItem = ErpPOLineItem + + super(ErpRecDelvLineItem, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Assets", "ErpInvoiceLineItem", "status", "ErpReceiveDelivery", "MaterialItems", "ErpPOLineItem"] + _many_refs = ["Assets", "MaterialItems"] + + def getAssets(self): + + return self._Assets + + def setAssets(self, value): + for p in self._Assets: + filtered = [q for q in p.ErpRecDeliveryItems if q != self] + self._Assets._ErpRecDeliveryItems = filtered + for r in value: + if self not in r._ErpRecDeliveryItems: + r._ErpRecDeliveryItems.append(self) + self._Assets = value + + Assets = property(getAssets, setAssets) + + def addAssets(self, *Assets): + for obj in Assets: + if self not in obj._ErpRecDeliveryItems: + obj._ErpRecDeliveryItems.append(self) + self._Assets.append(obj) + + def removeAssets(self, *Assets): + for obj in Assets: + if self in obj._ErpRecDeliveryItems: + obj._ErpRecDeliveryItems.remove(self) + self._Assets.remove(obj) + + def getErpInvoiceLineItem(self): + + return self._ErpInvoiceLineItem + + def setErpInvoiceLineItem(self, value): + if self._ErpInvoiceLineItem is not None: + self._ErpInvoiceLineItem._ErpRecDelvLineItem = None + + self._ErpInvoiceLineItem = value + if self._ErpInvoiceLineItem is not None: + self._ErpInvoiceLineItem.ErpRecDelvLineItem = None + self._ErpInvoiceLineItem._ErpRecDelvLineItem = self + + ErpInvoiceLineItem = property(getErpInvoiceLineItem, setErpInvoiceLineItem) + + status = None + + def getErpReceiveDelivery(self): + + return self._ErpReceiveDelivery + + def setErpReceiveDelivery(self, value): + if self._ErpReceiveDelivery is not None: + filtered = [x for x in self.ErpReceiveDelivery.ErpRecDelvLineItems if x != self] + self._ErpReceiveDelivery._ErpRecDelvLineItems = filtered + + self._ErpReceiveDelivery = value + if self._ErpReceiveDelivery is not None: + if self not in self._ErpReceiveDelivery._ErpRecDelvLineItems: + self._ErpReceiveDelivery._ErpRecDelvLineItems.append(self) + + ErpReceiveDelivery = property(getErpReceiveDelivery, setErpReceiveDelivery) + + def getMaterialItems(self): + + return self._MaterialItems + + def setMaterialItems(self, value): + for p in self._MaterialItems: + filtered = [q for q in p.ErpRecDelvLineItems if q != self] + self._MaterialItems._ErpRecDelvLineItems = filtered + for r in value: + if self not in r._ErpRecDelvLineItems: + r._ErpRecDelvLineItems.append(self) + self._MaterialItems = value + + MaterialItems = property(getMaterialItems, setMaterialItems) + + def addMaterialItems(self, *MaterialItems): + for obj in MaterialItems: + if self not in obj._ErpRecDelvLineItems: + obj._ErpRecDelvLineItems.append(self) + self._MaterialItems.append(obj) + + def removeMaterialItems(self, *MaterialItems): + for obj in MaterialItems: + if self in obj._ErpRecDelvLineItems: + obj._ErpRecDelvLineItems.remove(self) + self._MaterialItems.remove(obj) + + def getErpPOLineItem(self): + + return self._ErpPOLineItem + + def setErpPOLineItem(self, value): + if self._ErpPOLineItem is not None: + self._ErpPOLineItem._ErpRecDelLineItem = None + + self._ErpPOLineItem = value + if self._ErpPOLineItem is not None: + self._ErpPOLineItem.ErpRecDelLineItem = None + self._ErpPOLineItem._ErpRecDelLineItem = self + + ErpPOLineItem = property(getErpPOLineItem, setErpPOLineItem) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpRecLineItem.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpRecLineItem.py new file mode 100755 index 00000000..e07c5353 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpRecLineItem.py @@ -0,0 +1,145 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpRecLineItem(IdentifiedObject): + """Individual entry of an ErpReceivable, it is a particular transaction representing an invoice, credit memo or debit memo to a customer.Individual entry of an ErpReceivable, it is a particular transaction representing an invoice, credit memo or debit memo to a customer. + """ + + def __init__(self, ErpReceivable=None, status=None, ErpInvoiceLineItem=None, ErpPayments=None, ErpJournalEntries=None, *args, **kw_args): + """Initialises a new 'ErpRecLineItem' instance. + + @param ErpReceivable: + @param status: + @param ErpInvoiceLineItem: + @param ErpPayments: + @param ErpJournalEntries: + """ + self._ErpReceivable = None + self.ErpReceivable = ErpReceivable + + self.status = status + + self._ErpInvoiceLineItem = None + self.ErpInvoiceLineItem = ErpInvoiceLineItem + + self._ErpPayments = [] + self.ErpPayments = [] if ErpPayments is None else ErpPayments + + self._ErpJournalEntries = [] + self.ErpJournalEntries = [] if ErpJournalEntries is None else ErpJournalEntries + + super(ErpRecLineItem, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpReceivable", "status", "ErpInvoiceLineItem", "ErpPayments", "ErpJournalEntries"] + _many_refs = ["ErpPayments", "ErpJournalEntries"] + + def getErpReceivable(self): + + return self._ErpReceivable + + def setErpReceivable(self, value): + if self._ErpReceivable is not None: + filtered = [x for x in self.ErpReceivable.ErpRecLineItems if x != self] + self._ErpReceivable._ErpRecLineItems = filtered + + self._ErpReceivable = value + if self._ErpReceivable is not None: + if self not in self._ErpReceivable._ErpRecLineItems: + self._ErpReceivable._ErpRecLineItems.append(self) + + ErpReceivable = property(getErpReceivable, setErpReceivable) + + status = None + + def getErpInvoiceLineItem(self): + + return self._ErpInvoiceLineItem + + def setErpInvoiceLineItem(self, value): + if self._ErpInvoiceLineItem is not None: + self._ErpInvoiceLineItem._ErpRecLineItem = None + + self._ErpInvoiceLineItem = value + if self._ErpInvoiceLineItem is not None: + self._ErpInvoiceLineItem.ErpRecLineItem = None + self._ErpInvoiceLineItem._ErpRecLineItem = self + + ErpInvoiceLineItem = property(getErpInvoiceLineItem, setErpInvoiceLineItem) + + def getErpPayments(self): + + return self._ErpPayments + + def setErpPayments(self, value): + for p in self._ErpPayments: + filtered = [q for q in p.ErpRecLineItems if q != self] + self._ErpPayments._ErpRecLineItems = filtered + for r in value: + if self not in r._ErpRecLineItems: + r._ErpRecLineItems.append(self) + self._ErpPayments = value + + ErpPayments = property(getErpPayments, setErpPayments) + + def addErpPayments(self, *ErpPayments): + for obj in ErpPayments: + if self not in obj._ErpRecLineItems: + obj._ErpRecLineItems.append(self) + self._ErpPayments.append(obj) + + def removeErpPayments(self, *ErpPayments): + for obj in ErpPayments: + if self in obj._ErpRecLineItems: + obj._ErpRecLineItems.remove(self) + self._ErpPayments.remove(obj) + + def getErpJournalEntries(self): + + return self._ErpJournalEntries + + def setErpJournalEntries(self, value): + for p in self._ErpJournalEntries: + filtered = [q for q in p.ErpRecLineItems if q != self] + self._ErpJournalEntries._ErpRecLineItems = filtered + for r in value: + if self not in r._ErpRecLineItems: + r._ErpRecLineItems.append(self) + self._ErpJournalEntries = value + + ErpJournalEntries = property(getErpJournalEntries, setErpJournalEntries) + + def addErpJournalEntries(self, *ErpJournalEntries): + for obj in ErpJournalEntries: + if self not in obj._ErpRecLineItems: + obj._ErpRecLineItems.append(self) + self._ErpJournalEntries.append(obj) + + def removeErpJournalEntries(self, *ErpJournalEntries): + for obj in ErpJournalEntries: + if self in obj._ErpRecLineItems: + obj._ErpRecLineItems.remove(self) + self._ErpJournalEntries.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpReceivable.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpReceivable.py new file mode 100755 index 00000000..cb8dc89c --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpReceivable.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpReceivable(Document): + """Transaction representing an invoice, credit memo or debit memo to a customer. It is an open (unpaid) item in the Accounts Receivable ledger.Transaction representing an invoice, credit memo or debit memo to a customer. It is an open (unpaid) item in the Accounts Receivable ledger. + """ + + def __init__(self, ErpRecLineItems=None, *args, **kw_args): + """Initialises a new 'ErpReceivable' instance. + + @param ErpRecLineItems: + """ + self._ErpRecLineItems = [] + self.ErpRecLineItems = [] if ErpRecLineItems is None else ErpRecLineItems + + super(ErpReceivable, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpRecLineItems"] + _many_refs = ["ErpRecLineItems"] + + def getErpRecLineItems(self): + + return self._ErpRecLineItems + + def setErpRecLineItems(self, value): + for x in self._ErpRecLineItems: + x.ErpReceivable = None + for y in value: + y._ErpReceivable = self + self._ErpRecLineItems = value + + ErpRecLineItems = property(getErpRecLineItems, setErpRecLineItems) + + def addErpRecLineItems(self, *ErpRecLineItems): + for obj in ErpRecLineItems: + obj.ErpReceivable = self + + def removeErpRecLineItems(self, *ErpRecLineItems): + for obj in ErpRecLineItems: + obj.ErpReceivable = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpReceiveDelivery.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpReceiveDelivery.py new file mode 100755 index 00000000..8caf3e0e --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpReceiveDelivery.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpReceiveDelivery(Document): + """Transaction for an Organisation receiving goods or services that may be used to indicate receipt of goods in conjunction with a purchase order. A receivable is an open (unpaid) item in the Accounts Receivable ledger.Transaction for an Organisation receiving goods or services that may be used to indicate receipt of goods in conjunction with a purchase order. A receivable is an open (unpaid) item in the Accounts Receivable ledger. + """ + + def __init__(self, ErpRecDelvLineItems=None, *args, **kw_args): + """Initialises a new 'ErpReceiveDelivery' instance. + + @param ErpRecDelvLineItems: + """ + self._ErpRecDelvLineItems = [] + self.ErpRecDelvLineItems = [] if ErpRecDelvLineItems is None else ErpRecDelvLineItems + + super(ErpReceiveDelivery, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpRecDelvLineItems"] + _many_refs = ["ErpRecDelvLineItems"] + + def getErpRecDelvLineItems(self): + + return self._ErpRecDelvLineItems + + def setErpRecDelvLineItems(self, value): + for x in self._ErpRecDelvLineItems: + x.ErpReceiveDelivery = None + for y in value: + y._ErpReceiveDelivery = self + self._ErpRecDelvLineItems = value + + ErpRecDelvLineItems = property(getErpRecDelvLineItems, setErpRecDelvLineItems) + + def addErpRecDelvLineItems(self, *ErpRecDelvLineItems): + for obj in ErpRecDelvLineItems: + obj.ErpReceiveDelivery = self + + def removeErpRecDelvLineItems(self, *ErpRecDelvLineItems): + for obj in ErpRecDelvLineItems: + obj.ErpReceiveDelivery = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpReqLineItem.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpReqLineItem.py new file mode 100755 index 00000000..c5eb7154 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpReqLineItem.py @@ -0,0 +1,158 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpReqLineItem(IdentifiedObject): + """Information that describes a requested item and its attributes.Information that describes a requested item and its attributes. + """ + + def __init__(self, cost=0.0, quantity=0, deliveryDate='', code='', ErpQuoteLineItem=None, status=None, ErpRequisition=None, TypeMaterial=None, ErpPOLineItem=None, TypeAsset=None, *args, **kw_args): + """Initialises a new 'ErpReqLineItem' instance. + + @param cost: Cost of material + @param quantity: Quantity of item requisitioned. + @param deliveryDate: + @param code: + @param ErpQuoteLineItem: + @param status: + @param ErpRequisition: + @param TypeMaterial: + @param ErpPOLineItem: + @param TypeAsset: + """ + #: Cost of material + self.cost = cost + + #: Quantity of item requisitioned. + self.quantity = quantity + + + self.deliveryDate = deliveryDate + + + self.code = code + + self._ErpQuoteLineItem = None + self.ErpQuoteLineItem = ErpQuoteLineItem + + self.status = status + + self._ErpRequisition = None + self.ErpRequisition = ErpRequisition + + self._TypeMaterial = None + self.TypeMaterial = TypeMaterial + + self._ErpPOLineItem = None + self.ErpPOLineItem = ErpPOLineItem + + self._TypeAsset = None + self.TypeAsset = TypeAsset + + super(ErpReqLineItem, self).__init__(*args, **kw_args) + + _attrs = ["cost", "quantity", "deliveryDate", "code"] + _attr_types = {"cost": float, "quantity": int, "deliveryDate": str, "code": str} + _defaults = {"cost": 0.0, "quantity": 0, "deliveryDate": '', "code": ''} + _enums = {} + _refs = ["ErpQuoteLineItem", "status", "ErpRequisition", "TypeMaterial", "ErpPOLineItem", "TypeAsset"] + _many_refs = [] + + def getErpQuoteLineItem(self): + + return self._ErpQuoteLineItem + + def setErpQuoteLineItem(self, value): + if self._ErpQuoteLineItem is not None: + self._ErpQuoteLineItem._ErpReqLineItem = None + + self._ErpQuoteLineItem = value + if self._ErpQuoteLineItem is not None: + self._ErpQuoteLineItem.ErpReqLineItem = None + self._ErpQuoteLineItem._ErpReqLineItem = self + + ErpQuoteLineItem = property(getErpQuoteLineItem, setErpQuoteLineItem) + + status = None + + def getErpRequisition(self): + + return self._ErpRequisition + + def setErpRequisition(self, value): + if self._ErpRequisition is not None: + filtered = [x for x in self.ErpRequisition.ErpReqLineItems if x != self] + self._ErpRequisition._ErpReqLineItems = filtered + + self._ErpRequisition = value + if self._ErpRequisition is not None: + if self not in self._ErpRequisition._ErpReqLineItems: + self._ErpRequisition._ErpReqLineItems.append(self) + + ErpRequisition = property(getErpRequisition, setErpRequisition) + + def getTypeMaterial(self): + + return self._TypeMaterial + + def setTypeMaterial(self, value): + if self._TypeMaterial is not None: + filtered = [x for x in self.TypeMaterial.ErpReqLineItems if x != self] + self._TypeMaterial._ErpReqLineItems = filtered + + self._TypeMaterial = value + if self._TypeMaterial is not None: + if self not in self._TypeMaterial._ErpReqLineItems: + self._TypeMaterial._ErpReqLineItems.append(self) + + TypeMaterial = property(getTypeMaterial, setTypeMaterial) + + def getErpPOLineItem(self): + + return self._ErpPOLineItem + + def setErpPOLineItem(self, value): + if self._ErpPOLineItem is not None: + self._ErpPOLineItem._ErpReqLineItem = None + + self._ErpPOLineItem = value + if self._ErpPOLineItem is not None: + self._ErpPOLineItem.ErpReqLineItem = None + self._ErpPOLineItem._ErpReqLineItem = self + + ErpPOLineItem = property(getErpPOLineItem, setErpPOLineItem) + + def getTypeAsset(self): + + return self._TypeAsset + + def setTypeAsset(self, value): + if self._TypeAsset is not None: + filtered = [x for x in self.TypeAsset.ErpReqLineItems if x != self] + self._TypeAsset._ErpReqLineItems = filtered + + self._TypeAsset = value + if self._TypeAsset is not None: + if self not in self._TypeAsset._ErpReqLineItems: + self._TypeAsset._ErpReqLineItems.append(self) + + TypeAsset = property(getTypeAsset, setTypeAsset) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpRequisition.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpRequisition.py new file mode 100755 index 00000000..fa32983c --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpRequisition.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpRequisition(Document): + """General information that applies to a utility requisition that is a request for the purchase of goods or services. Typically, a requisition leads to the creation of a purchase order to a specific supplier.General information that applies to a utility requisition that is a request for the purchase of goods or services. Typically, a requisition leads to the creation of a purchase order to a specific supplier. + """ + + def __init__(self, ErpReqLineItems=None, *args, **kw_args): + """Initialises a new 'ErpRequisition' instance. + + @param ErpReqLineItems: + """ + self._ErpReqLineItems = [] + self.ErpReqLineItems = [] if ErpReqLineItems is None else ErpReqLineItems + + super(ErpRequisition, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpReqLineItems"] + _many_refs = ["ErpReqLineItems"] + + def getErpReqLineItems(self): + + return self._ErpReqLineItems + + def setErpReqLineItems(self, value): + for x in self._ErpReqLineItems: + x.ErpRequisition = None + for y in value: + y._ErpRequisition = self + self._ErpReqLineItems = value + + ErpReqLineItems = property(getErpReqLineItems, setErpReqLineItems) + + def addErpReqLineItems(self, *ErpReqLineItems): + for obj in ErpReqLineItems: + obj.ErpRequisition = self + + def removeErpReqLineItems(self, *ErpReqLineItems): + for obj in ErpReqLineItems: + obj.ErpRequisition = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpSalesOrder.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpSalesOrder.py new file mode 100755 index 00000000..d4336933 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpSalesOrder.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpSalesOrder(Document): + """General purpose Sales Order is used for utility service orders, etc. As used by the OAG, the SalesOrder is a step beyond a PurchaseOrder in that the receiving entity of the order also communicates SalesInformoration about the Order along with the Order itself.General purpose Sales Order is used for utility service orders, etc. As used by the OAG, the SalesOrder is a step beyond a PurchaseOrder in that the receiving entity of the order also communicates SalesInformoration about the Order along with the Order itself. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'ErpSalesOrder' instance. + + """ + super(ErpSalesOrder, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpSiteLevelData.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpSiteLevelData.py new file mode 100755 index 00000000..6412584a --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpSiteLevelData.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpSiteLevelData(IdentifiedObject): + """For a utility, general information that describes physical locations of organizations or the location codes and their meanings. This enables ERP applications to ensure that the physical location identifiers are synchronized between the business applications.For a utility, general information that describes physical locations of organizations or the location codes and their meanings. This enables ERP applications to ensure that the physical location identifiers are synchronized between the business applications. + """ + + def __init__(self, status=None, LandProperty=None, *args, **kw_args): + """Initialises a new 'ErpSiteLevelData' instance. + + @param status: + @param LandProperty: + """ + self.status = status + + self._LandProperty = None + self.LandProperty = LandProperty + + super(ErpSiteLevelData, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["status", "LandProperty"] + _many_refs = [] + + status = None + + def getLandProperty(self): + + return self._LandProperty + + def setLandProperty(self, value): + if self._LandProperty is not None: + filtered = [x for x in self.LandProperty.ErpSiteLevelDatas if x != self] + self._LandProperty._ErpSiteLevelDatas = filtered + + self._LandProperty = value + if self._LandProperty is not None: + if self not in self._LandProperty._ErpSiteLevelDatas: + self._LandProperty._ErpSiteLevelDatas.append(self) + + LandProperty = property(getLandProperty, setLandProperty) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpTimeEntry.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpTimeEntry.py new file mode 100755 index 00000000..0beee648 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpTimeEntry.py @@ -0,0 +1,84 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ErpTimeEntry(IdentifiedObject): + """An individual entry on an ErpTimeSheet.An individual entry on an ErpTimeSheet. + """ + + def __init__(self, ErpProjectAccounting=None, status=None, ErpTimeSheet=None, *args, **kw_args): + """Initialises a new 'ErpTimeEntry' instance. + + @param ErpProjectAccounting: + @param status: + @param ErpTimeSheet: + """ + self._ErpProjectAccounting = None + self.ErpProjectAccounting = ErpProjectAccounting + + self.status = status + + self._ErpTimeSheet = None + self.ErpTimeSheet = ErpTimeSheet + + super(ErpTimeEntry, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpProjectAccounting", "status", "ErpTimeSheet"] + _many_refs = [] + + def getErpProjectAccounting(self): + + return self._ErpProjectAccounting + + def setErpProjectAccounting(self, value): + if self._ErpProjectAccounting is not None: + filtered = [x for x in self.ErpProjectAccounting.ErpTimeEntries if x != self] + self._ErpProjectAccounting._ErpTimeEntries = filtered + + self._ErpProjectAccounting = value + if self._ErpProjectAccounting is not None: + if self not in self._ErpProjectAccounting._ErpTimeEntries: + self._ErpProjectAccounting._ErpTimeEntries.append(self) + + ErpProjectAccounting = property(getErpProjectAccounting, setErpProjectAccounting) + + status = None + + def getErpTimeSheet(self): + + return self._ErpTimeSheet + + def setErpTimeSheet(self, value): + if self._ErpTimeSheet is not None: + filtered = [x for x in self.ErpTimeSheet.ErpTimeEntries if x != self] + self._ErpTimeSheet._ErpTimeEntries = filtered + + self._ErpTimeSheet = value + if self._ErpTimeSheet is not None: + if self not in self._ErpTimeSheet._ErpTimeEntries: + self._ErpTimeSheet._ErpTimeEntries.append(self) + + ErpTimeSheet = property(getErpTimeSheet, setErpTimeSheet) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/ErpTimeSheet.py b/CIM16/IEC61970/Informative/InfERPSupport/ErpTimeSheet.py new file mode 100755 index 00000000..4248f2be --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/ErpTimeSheet.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class ErpTimeSheet(Document): + """Time sheet for employees and contractors. Note that ErpTimeSheet inherits the relationship to ErpPerson from Document.Time sheet for employees and contractors. Note that ErpTimeSheet inherits the relationship to ErpPerson from Document. + """ + + def __init__(self, ErpTimeEntries=None, *args, **kw_args): + """Initialises a new 'ErpTimeSheet' instance. + + @param ErpTimeEntries: + """ + self._ErpTimeEntries = [] + self.ErpTimeEntries = [] if ErpTimeEntries is None else ErpTimeEntries + + super(ErpTimeSheet, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpTimeEntries"] + _many_refs = ["ErpTimeEntries"] + + def getErpTimeEntries(self): + + return self._ErpTimeEntries + + def setErpTimeEntries(self, value): + for x in self._ErpTimeEntries: + x.ErpTimeSheet = None + for y in value: + y._ErpTimeSheet = self + self._ErpTimeEntries = value + + ErpTimeEntries = property(getErpTimeEntries, setErpTimeEntries) + + def addErpTimeEntries(self, *ErpTimeEntries): + for obj in ErpTimeEntries: + obj.ErpTimeSheet = self + + def removeErpTimeEntries(self, *ErpTimeEntries): + for obj in ErpTimeEntries: + obj.ErpTimeSheet = None + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/OrgErpPersonRole.py b/CIM16/IEC61970/Informative/InfERPSupport/OrgErpPersonRole.py new file mode 100755 index 00000000..a9783f1b --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/OrgErpPersonRole.py @@ -0,0 +1,83 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.Role import Role + +class OrgErpPersonRole(Role): + """Roles played between Persons and Organisations.Roles played between Persons and Organisations. + """ + + def __init__(self, clientID='', ErpPerson=None, ErpOrganisation=None, *args, **kw_args): + """Initialises a new 'OrgErpPersonRole' instance. + + @param clientID: Identifiers of the person held by an organisation, such as a government agency (federal, state, province, city, county), financial institutions, etc. + @param ErpPerson: + @param ErpOrganisation: + """ + #: Identifiers of the person held by an organisation, such as a government agency (federal, state, province, city, county), financial institutions, etc. + self.clientID = clientID + + self._ErpPerson = None + self.ErpPerson = ErpPerson + + self._ErpOrganisation = None + self.ErpOrganisation = ErpOrganisation + + super(OrgErpPersonRole, self).__init__(*args, **kw_args) + + _attrs = ["clientID"] + _attr_types = {"clientID": str} + _defaults = {"clientID": ''} + _enums = {} + _refs = ["ErpPerson", "ErpOrganisation"] + _many_refs = [] + + def getErpPerson(self): + + return self._ErpPerson + + def setErpPerson(self, value): + if self._ErpPerson is not None: + filtered = [x for x in self.ErpPerson.ErpOrganisationRoles if x != self] + self._ErpPerson._ErpOrganisationRoles = filtered + + self._ErpPerson = value + if self._ErpPerson is not None: + if self not in self._ErpPerson._ErpOrganisationRoles: + self._ErpPerson._ErpOrganisationRoles.append(self) + + ErpPerson = property(getErpPerson, setErpPerson) + + def getErpOrganisation(self): + + return self._ErpOrganisation + + def setErpOrganisation(self, value): + if self._ErpOrganisation is not None: + filtered = [x for x in self.ErpOrganisation.ErpPersonRoles if x != self] + self._ErpOrganisation._ErpPersonRoles = filtered + + self._ErpOrganisation = value + if self._ErpOrganisation is not None: + if self not in self._ErpOrganisation._ErpPersonRoles: + self._ErpOrganisation._ErpPersonRoles.append(self) + + ErpOrganisation = property(getErpOrganisation, setErpOrganisation) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/OrgOrgRole.py b/CIM16/IEC61970/Informative/InfERPSupport/OrgOrgRole.py new file mode 100755 index 00000000..48c4d7b1 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/OrgOrgRole.py @@ -0,0 +1,83 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.Role import Role + +class OrgOrgRole(Role): + """Roles played between Organisations and other Organisations. This includes role ups for ogranisations, cost centers, profit centers, regulatory reporting, etc. Note that the parent and child relationship is indicated by the name on each end of the association.Roles played between Organisations and other Organisations. This includes role ups for ogranisations, cost centers, profit centers, regulatory reporting, etc. Note that the parent and child relationship is indicated by the name on each end of the association. + """ + + def __init__(self, clientID='', ParentOrganisation=None, ChildOrganisation=None, *args, **kw_args): + """Initialises a new 'OrgOrgRole' instance. + + @param clientID: Identifiers of the organisation held by another organisation, such as a government agency (federal, state, province, city, county), financial institution (Dun and Bradstreet), etc. + @param ParentOrganisation: + @param ChildOrganisation: + """ + #: Identifiers of the organisation held by another organisation, such as a government agency (federal, state, province, city, county), financial institution (Dun and Bradstreet), etc. + self.clientID = clientID + + self._ParentOrganisation = None + self.ParentOrganisation = ParentOrganisation + + self._ChildOrganisation = None + self.ChildOrganisation = ChildOrganisation + + super(OrgOrgRole, self).__init__(*args, **kw_args) + + _attrs = ["clientID"] + _attr_types = {"clientID": str} + _defaults = {"clientID": ''} + _enums = {} + _refs = ["ParentOrganisation", "ChildOrganisation"] + _many_refs = [] + + def getParentOrganisation(self): + + return self._ParentOrganisation + + def setParentOrganisation(self, value): + if self._ParentOrganisation is not None: + filtered = [x for x in self.ParentOrganisation.ChildOrganisationRoles if x != self] + self._ParentOrganisation._ChildOrganisationRoles = filtered + + self._ParentOrganisation = value + if self._ParentOrganisation is not None: + if self not in self._ParentOrganisation._ChildOrganisationRoles: + self._ParentOrganisation._ChildOrganisationRoles.append(self) + + ParentOrganisation = property(getParentOrganisation, setParentOrganisation) + + def getChildOrganisation(self): + + return self._ChildOrganisation + + def setChildOrganisation(self, value): + if self._ChildOrganisation is not None: + filtered = [x for x in self.ChildOrganisation.ParentOrganisationRoles if x != self] + self._ChildOrganisation._ParentOrganisationRoles = filtered + + self._ChildOrganisation = value + if self._ChildOrganisation is not None: + if self not in self._ChildOrganisation._ParentOrganisationRoles: + self._ChildOrganisation._ParentOrganisationRoles.append(self) + + ChildOrganisation = property(getChildOrganisation, setChildOrganisation) + diff --git a/CIM16/IEC61970/Informative/InfERPSupport/__init__.py b/CIM16/IEC61970/Informative/InfERPSupport/__init__.py new file mode 100755 index 00000000..b83e06eb --- /dev/null +++ b/CIM16/IEC61970/Informative/InfERPSupport/__init__.py @@ -0,0 +1,90 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The package contains portions of the model defined byEnterprise Resource Planning (ERP) standards like those proposed by the Open Applications Group (OAG). It is provided to facilitate integration among electric utility applications (CIM) and enterprise resource planning (ERP) applications (as defined by OAG). Rather than inventing new CIM classes that accomplish similar functionality as in existing ERP models, the preferred approach is to use and extend ERP classes as appropriate in other packages. If a model other that the OAG standard is used as a basis for ERP integration, the utility classes labeld 'Erp...' should be associated with the appropriate classes of that standard. In fact, definitions of 'Erp...' classes are based on OAG Nouns to facilitate this process. TODO: The following has been copied from a very old version of draft Part 11, so the references are wrong, but we store the knowledge here to reuse later: 'The Enterprise Resource Planning (ERP) Support Package contains portions of the model defined by ERP standards like those proposed by the Open Applications Group (OAG). This package is provided to facilitate integration among electric utility applications (CIM) and enterprise resource planning (ERP) applications (OAG). Rather than inventing new CIM classes that accomplish similar functionality as in existing ERP models, the preferred approach is to use and extend ERP classes as appropriate in other packages. If a model other that the OAG standard is used as a basis for ERP integration, the utility classes labeled 'Erp...' should be associated with the appropriate classes of that standard.' +""" + +from CIM16.IEC61970.Informative.InfERPSupport.ErpRecDelvLineItem import ErpRecDelvLineItem +from CIM16.IEC61970.Informative.InfERPSupport.ErpLedgerBudget import ErpLedgerBudget +from CIM16.IEC61970.Informative.InfERPSupport.ErpTimeEntry import ErpTimeEntry +from CIM16.IEC61970.Informative.InfERPSupport.ErpCompetency import ErpCompetency +from CIM16.IEC61970.Informative.InfERPSupport.ErpPurchaseOrder import ErpPurchaseOrder +from CIM16.IEC61970.Informative.InfERPSupport.ErpEngChangeOrder import ErpEngChangeOrder +from CIM16.IEC61970.Informative.InfERPSupport.ErpProjectAccounting import ErpProjectAccounting +from CIM16.IEC61970.Informative.InfERPSupport.ErpRecLineItem import ErpRecLineItem +from CIM16.IEC61970.Informative.InfERPSupport.ErpPayableLineItem import ErpPayableLineItem +from CIM16.IEC61970.Informative.InfERPSupport.ErpLedBudLineItem import ErpLedBudLineItem +from CIM16.IEC61970.Informative.InfERPSupport.ErpRequisition import ErpRequisition +from CIM16.IEC61970.Informative.InfERPSupport.ErpOrganisation import ErpOrganisation +from CIM16.IEC61970.Informative.InfERPSupport.ErpInvoice import ErpInvoice +from CIM16.IEC61970.Informative.InfERPSupport.DocErpPersonRole import DocErpPersonRole +from CIM16.IEC61970.Informative.InfERPSupport.ErpBankAccount import ErpBankAccount +from CIM16.IEC61970.Informative.InfERPSupport.ErpQuote import ErpQuote +from CIM16.IEC61970.Informative.InfERPSupport.ErpPerson import ErpPerson +from CIM16.IEC61970.Informative.InfERPSupport.ErpItemMaster import ErpItemMaster +from CIM16.IEC61970.Informative.InfERPSupport.ErpBOM import ErpBOM +from CIM16.IEC61970.Informative.InfERPSupport.ErpInventoryCount import ErpInventoryCount +from CIM16.IEC61970.Informative.InfERPSupport.ErpIssueInventory import ErpIssueInventory +from CIM16.IEC61970.Informative.InfERPSupport.ErpPayable import ErpPayable +from CIM16.IEC61970.Informative.InfERPSupport.ErpLedger import ErpLedger +from CIM16.IEC61970.Informative.InfERPSupport.ErpPOLineItem import ErpPOLineItem +from CIM16.IEC61970.Informative.InfERPSupport.ErpLedgerEntry import ErpLedgerEntry +from CIM16.IEC61970.Informative.InfERPSupport.ErpPayment import ErpPayment +from CIM16.IEC61970.Informative.InfERPSupport.ErpReceivable import ErpReceivable +from CIM16.IEC61970.Informative.InfERPSupport.DocOrgRole import DocOrgRole +from CIM16.IEC61970.Informative.InfERPSupport.ErpReqLineItem import ErpReqLineItem +from CIM16.IEC61970.Informative.InfERPSupport.ErpTimeSheet import ErpTimeSheet +from CIM16.IEC61970.Informative.InfERPSupport.ErpInventory import ErpInventory +from CIM16.IEC61970.Informative.InfERPSupport.ErpChartOfAccounts import ErpChartOfAccounts +from CIM16.IEC61970.Informative.InfERPSupport.ErpSiteLevelData import ErpSiteLevelData +from CIM16.IEC61970.Informative.InfERPSupport.OrgErpPersonRole import OrgErpPersonRole +from CIM16.IEC61970.Informative.InfERPSupport.ErpReceiveDelivery import ErpReceiveDelivery +from CIM16.IEC61970.Informative.InfERPSupport.ErpSalesOrder import ErpSalesOrder +from CIM16.IEC61970.Informative.InfERPSupport.ErpJournalEntry import ErpJournalEntry +from CIM16.IEC61970.Informative.InfERPSupport.ErpInvoiceLineItem import ErpInvoiceLineItem +from CIM16.IEC61970.Informative.InfERPSupport.OrgOrgRole import OrgOrgRole +from CIM16.IEC61970.Informative.InfERPSupport.ErpJournal import ErpJournal +from CIM16.IEC61970.Informative.InfERPSupport.ErpPersonnel import ErpPersonnel +from CIM16.IEC61970.Informative.InfERPSupport.ErpQuoteLineItem import ErpQuoteLineItem +from CIM16.IEC61970.Informative.InfERPSupport.ErpBomItemData import ErpBomItemData + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#InfERPSupport" +nsPrefix = "cimInfERPSupport" + + +class ErpInvoiceLineItemKind(str): + """Values are: other, recalculation, initial + """ + pass + +class ErpInvoiceKind(str): + """Values are: sales, purchase + """ + pass + +class ErpAccountKind(str): + """Values are: normal, estimate, statistical, reversal + """ + pass + +class BillMediaKind(str): + """Values are: other, paper, electronic + """ + pass diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/Diagram.py b/CIM16/IEC61970/Informative/InfGMLSupport/Diagram.py new file mode 100755 index 00000000..867eb2a6 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/Diagram.py @@ -0,0 +1,171 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class Diagram(Document): + """The Diagram represents the diagram being exchanged. The initialView attributes can be used to specify an initial view with the x,y coordinates of the diagonal points. The coordinate system is a standard Cartesian coordinate system and the orientation attribute defines a positive or negative orientation. A positive orientation gives standard ‘right-hand’ orientation, with negative orientation indicating a ‘left-hand’ orientation. For 2D diagrams, a positive orientation will result in X values increasing from left to right and Y values increasing from bottom to top. A negative orientation gives the ‘left-hand’ orientation (favoured by computer graphics displays) with X values increasing from left to right and Y values increasing from top to bottom.The Diagram represents the diagram being exchanged. The initialView attributes can be used to specify an initial view with the x,y coordinates of the diagonal points. The coordinate system is a standard Cartesian coordinate system and the orientation attribute defines a positive or negative orientation. A positive orientation gives standard ‘right-hand’ orientation, with negative orientation indicating a ‘left-hand’ orientation. For 2D diagrams, a positive orientation will result in X values increasing from left to right and Y values increasing from bottom to top. A negative orientation gives the ‘left-hand’ orientation (favoured by computer graphics displays) with X values increasing from left to right and Y values increasing from top to bottom. + """ + + def __init__(self, y1InitialView=0.0, kind="other", x2InitialView=0.0, x1InitialView=0.0, orientation="negative", y2InitialView=0.0, DiagramObjects=None, CoordinateSystem=None, GmlDiagramObjects=None, DesignLocations=None, *args, **kw_args): + """Initialises a new 'Diagram' instance. + + @param y1InitialView: Y coordinate of the first corner of the initial view + @param kind: Kind of this diagram. Values are: "other", "geographic", "internalView", "designSketch", "schematic" + @param x2InitialView: X coordinate of the second corner of the initial view + @param x1InitialView: X coordinate of the first corner of the initial view + @param orientation: The Diagram represents the diagram being exchanged. The initialView attributes can be used to specify an initial view with the x,y coordinates of the diagonal points. The coordinate system is a standard Cartesian coordinate system and the orientation attribute defines a positive or negative orientation. Values are: "negative", "positive" + @param y2InitialView: Y coordinate of the second corner of the initial view + @param DiagramObjects: A diagram is made up of multiple DiagramObjects + @param CoordinateSystem: + @param GmlDiagramObjects: + @param DesignLocations: + """ + #: Y coordinate of the first corner of the initial view + self.y1InitialView = y1InitialView + + #: Kind of this diagram. Values are: "other", "geographic", "internalView", "designSketch", "schematic" + self.kind = kind + + #: X coordinate of the second corner of the initial view + self.x2InitialView = x2InitialView + + #: X coordinate of the first corner of the initial view + self.x1InitialView = x1InitialView + + #: The Diagram represents the diagram being exchanged. The initialView attributes can be used to specify an initial view with the x,y coordinates of the diagonal points. The coordinate system is a standard Cartesian coordinate system and the orientation attribute defines a positive or negative orientation. Values are: "negative", "positive" + self.orientation = orientation + + #: Y coordinate of the second corner of the initial view + self.y2InitialView = y2InitialView + + self._DiagramObjects = [] + self.DiagramObjects = [] if DiagramObjects is None else DiagramObjects + + self._CoordinateSystem = None + self.CoordinateSystem = CoordinateSystem + + self._GmlDiagramObjects = [] + self.GmlDiagramObjects = [] if GmlDiagramObjects is None else GmlDiagramObjects + + self._DesignLocations = [] + self.DesignLocations = [] if DesignLocations is None else DesignLocations + + super(Diagram, self).__init__(*args, **kw_args) + + _attrs = ["y1InitialView", "kind", "x2InitialView", "x1InitialView", "orientation", "y2InitialView"] + _attr_types = {"y1InitialView": float, "kind": str, "x2InitialView": float, "x1InitialView": float, "orientation": str, "y2InitialView": float} + _defaults = {"y1InitialView": 0.0, "kind": "other", "x2InitialView": 0.0, "x1InitialView": 0.0, "orientation": "negative", "y2InitialView": 0.0} + _enums = {"kind": "DiagramKind", "orientation": "OrientationKind"} + _refs = ["DiagramObjects", "CoordinateSystem", "GmlDiagramObjects", "DesignLocations"] + _many_refs = ["DiagramObjects", "GmlDiagramObjects", "DesignLocations"] + + def getDiagramObjects(self): + """A diagram is made up of multiple DiagramObjects + """ + return self._DiagramObjects + + def setDiagramObjects(self, value): + for x in self._DiagramObjects: + x.Diagram = None + for y in value: + y._Diagram = self + self._DiagramObjects = value + + DiagramObjects = property(getDiagramObjects, setDiagramObjects) + + def addDiagramObjects(self, *DiagramObjects): + for obj in DiagramObjects: + obj.Diagram = self + + def removeDiagramObjects(self, *DiagramObjects): + for obj in DiagramObjects: + obj.Diagram = None + + def getCoordinateSystem(self): + + return self._CoordinateSystem + + def setCoordinateSystem(self, value): + if self._CoordinateSystem is not None: + filtered = [x for x in self.CoordinateSystem.Diagrams if x != self] + self._CoordinateSystem._Diagrams = filtered + + self._CoordinateSystem = value + if self._CoordinateSystem is not None: + if self not in self._CoordinateSystem._Diagrams: + self._CoordinateSystem._Diagrams.append(self) + + CoordinateSystem = property(getCoordinateSystem, setCoordinateSystem) + + def getGmlDiagramObjects(self): + + return self._GmlDiagramObjects + + def setGmlDiagramObjects(self, value): + for p in self._GmlDiagramObjects: + filtered = [q for q in p.Diagrams if q != self] + self._GmlDiagramObjects._Diagrams = filtered + for r in value: + if self not in r._Diagrams: + r._Diagrams.append(self) + self._GmlDiagramObjects = value + + GmlDiagramObjects = property(getGmlDiagramObjects, setGmlDiagramObjects) + + def addGmlDiagramObjects(self, *GmlDiagramObjects): + for obj in GmlDiagramObjects: + if self not in obj._Diagrams: + obj._Diagrams.append(self) + self._GmlDiagramObjects.append(obj) + + def removeGmlDiagramObjects(self, *GmlDiagramObjects): + for obj in GmlDiagramObjects: + if self in obj._Diagrams: + obj._Diagrams.remove(self) + self._GmlDiagramObjects.remove(obj) + + def getDesignLocations(self): + + return self._DesignLocations + + def setDesignLocations(self, value): + for p in self._DesignLocations: + filtered = [q for q in p.Diagrams if q != self] + self._DesignLocations._Diagrams = filtered + for r in value: + if self not in r._Diagrams: + r._Diagrams.append(self) + self._DesignLocations = value + + DesignLocations = property(getDesignLocations, setDesignLocations) + + def addDesignLocations(self, *DesignLocations): + for obj in DesignLocations: + if self not in obj._Diagrams: + obj._Diagrams.append(self) + self._DesignLocations.append(obj) + + def removeDesignLocations(self, *DesignLocations): + for obj in DesignLocations: + if self in obj._Diagrams: + obj._Diagrams.remove(self) + self._DesignLocations.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlBaseSymbol.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlBaseSymbol.py new file mode 100755 index 00000000..5aa80d9c --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlBaseSymbol.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlBaseSymbol(IdentifiedObject): + """Allows referencing and extension of external symbols, which may be stored in a symbol repository. The graphical properties from a referenced external symbol override the ones read in from the base symbol.Allows referencing and extension of external symbols, which may be stored in a symbol repository. The graphical properties from a referenced external symbol override the ones read in from the base symbol. + """ + + def __init__(self, GmlSymbols=None, *args, **kw_args): + """Initialises a new 'GmlBaseSymbol' instance. + + @param GmlSymbols: + """ + self._GmlSymbols = [] + self.GmlSymbols = [] if GmlSymbols is None else GmlSymbols + + super(GmlBaseSymbol, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["GmlSymbols"] + _many_refs = ["GmlSymbols"] + + def getGmlSymbols(self): + + return self._GmlSymbols + + def setGmlSymbols(self, value): + for x in self._GmlSymbols: + x.GmlBaseSymbol = None + for y in value: + y._GmlBaseSymbol = self + self._GmlSymbols = value + + GmlSymbols = property(getGmlSymbols, setGmlSymbols) + + def addGmlSymbols(self, *GmlSymbols): + for obj in GmlSymbols: + obj.GmlBaseSymbol = self + + def removeGmlSymbols(self, *GmlSymbols): + for obj in GmlSymbols: + obj.GmlBaseSymbol = None + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlColour.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlColour.py new file mode 100755 index 00000000..d92fb430 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlColour.py @@ -0,0 +1,126 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlColour(IdentifiedObject): + """The solid color that will be used. The color value is RGB-encoded using two hexadecimal digits per primary-color component, in the order Red, Green, Blue, prefixed with a hash (#) sign. The hexadecimal digits between A and F may be in either uppercase or lowercase. For example, full red is encoded as '#ff0000' (with no quotation marks). If the Stroke cssParameter element is absent, the default color is defined to be black ('#000000').The solid color that will be used. The color value is RGB-encoded using two hexadecimal digits per primary-color component, in the order Red, Green, Blue, prefixed with a hash (#) sign. The hexadecimal digits between A and F may be in either uppercase or lowercase. For example, full red is encoded as '#ff0000' (with no quotation marks). If the Stroke cssParameter element is absent, the default color is defined to be black ('#000000'). + """ + + def __init__(self, red='', green='', blue='', GmlFills=None, GmlFonts=None, GmlStrokes=None, *args, **kw_args): + """Initialises a new 'GmlColour' instance. + + @param red: The color value for RED (RGB-encoded using two hexadecimal digits per primary-color component, in the order Red, Green, Blue, prefixed with a hash (#) sign.) + @param green: The color value for GREEN (RGB-encoded using two hexadecimal digits per primary-color component, in the order Red, Green, Blue, prefixed with a hash (#) sign.) + @param blue: The color value for BLUE (RGB-encoded using two hexadecimal digits per primary-color component, in the order Red, Green, Blue, prefixed with a hash (#) sign.). + @param GmlFills: + @param GmlFonts: + @param GmlStrokes: + """ + #: The color value for RED (RGB-encoded using two hexadecimal digits per primary-color component, in the order Red, Green, Blue, prefixed with a hash (#) sign.) + self.red = red + + #: The color value for GREEN (RGB-encoded using two hexadecimal digits per primary-color component, in the order Red, Green, Blue, prefixed with a hash (#) sign.) + self.green = green + + #: The color value for BLUE (RGB-encoded using two hexadecimal digits per primary-color component, in the order Red, Green, Blue, prefixed with a hash (#) sign.). + self.blue = blue + + self._GmlFills = [] + self.GmlFills = [] if GmlFills is None else GmlFills + + self._GmlFonts = [] + self.GmlFonts = [] if GmlFonts is None else GmlFonts + + self._GmlStrokes = [] + self.GmlStrokes = [] if GmlStrokes is None else GmlStrokes + + super(GmlColour, self).__init__(*args, **kw_args) + + _attrs = ["red", "green", "blue"] + _attr_types = {"red": str, "green": str, "blue": str} + _defaults = {"red": '', "green": '', "blue": ''} + _enums = {} + _refs = ["GmlFills", "GmlFonts", "GmlStrokes"] + _many_refs = ["GmlFills", "GmlFonts", "GmlStrokes"] + + def getGmlFills(self): + + return self._GmlFills + + def setGmlFills(self, value): + for x in self._GmlFills: + x.GmlColour = None + for y in value: + y._GmlColour = self + self._GmlFills = value + + GmlFills = property(getGmlFills, setGmlFills) + + def addGmlFills(self, *GmlFills): + for obj in GmlFills: + obj.GmlColour = self + + def removeGmlFills(self, *GmlFills): + for obj in GmlFills: + obj.GmlColour = None + + def getGmlFonts(self): + + return self._GmlFonts + + def setGmlFonts(self, value): + for x in self._GmlFonts: + x.GmlColour = None + for y in value: + y._GmlColour = self + self._GmlFonts = value + + GmlFonts = property(getGmlFonts, setGmlFonts) + + def addGmlFonts(self, *GmlFonts): + for obj in GmlFonts: + obj.GmlColour = self + + def removeGmlFonts(self, *GmlFonts): + for obj in GmlFonts: + obj.GmlColour = None + + def getGmlStrokes(self): + + return self._GmlStrokes + + def setGmlStrokes(self, value): + for x in self._GmlStrokes: + x.GmlColour = None + for y in value: + y._GmlColour = self + self._GmlStrokes = value + + GmlStrokes = property(getGmlStrokes, setGmlStrokes) + + def addGmlStrokes(self, *GmlStrokes): + for obj in GmlStrokes: + obj.GmlColour = self + + def removeGmlStrokes(self, *GmlStrokes): + for obj in GmlStrokes: + obj.GmlColour = None + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlDiagramObject.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlDiagramObject.py new file mode 100755 index 00000000..accfadd5 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlDiagramObject.py @@ -0,0 +1,288 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlDiagramObject(IdentifiedObject): + """Any of the magnitudes that serve to define the position of a point by reference to a fixed figure, system of lines, etc.Any of the magnitudes that serve to define the position of a point by reference to a fixed figure, system of lines, etc. + """ + + def __init__(self, GmlSelectors=None, Diagrams=None, CoordinateSystems=None, GmlPointSymbols=None, GmlLineSymbols=None, GmlRasterSymbols=None, GmlObservatins=None, GmlTextSymbols=None, GmlPolygonSymbols=None, *args, **kw_args): + """Initialises a new 'GmlDiagramObject' instance. + + @param GmlSelectors: + @param Diagrams: + @param CoordinateSystems: + @param GmlPointSymbols: + @param GmlLineSymbols: + @param GmlRasterSymbols: + @param GmlObservatins: + @param GmlTextSymbols: + @param GmlPolygonSymbols: + """ + self._GmlSelectors = [] + self.GmlSelectors = [] if GmlSelectors is None else GmlSelectors + + self._Diagrams = [] + self.Diagrams = [] if Diagrams is None else Diagrams + + self._CoordinateSystems = [] + self.CoordinateSystems = [] if CoordinateSystems is None else CoordinateSystems + + self._GmlPointSymbols = [] + self.GmlPointSymbols = [] if GmlPointSymbols is None else GmlPointSymbols + + self._GmlLineSymbols = [] + self.GmlLineSymbols = [] if GmlLineSymbols is None else GmlLineSymbols + + self._GmlRasterSymbols = [] + self.GmlRasterSymbols = [] if GmlRasterSymbols is None else GmlRasterSymbols + + self._GmlObservatins = [] + self.GmlObservatins = [] if GmlObservatins is None else GmlObservatins + + self._GmlTextSymbols = [] + self.GmlTextSymbols = [] if GmlTextSymbols is None else GmlTextSymbols + + self._GmlPolygonSymbols = [] + self.GmlPolygonSymbols = [] if GmlPolygonSymbols is None else GmlPolygonSymbols + + super(GmlDiagramObject, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["GmlSelectors", "Diagrams", "CoordinateSystems", "GmlPointSymbols", "GmlLineSymbols", "GmlRasterSymbols", "GmlObservatins", "GmlTextSymbols", "GmlPolygonSymbols"] + _many_refs = ["GmlSelectors", "Diagrams", "CoordinateSystems", "GmlPointSymbols", "GmlLineSymbols", "GmlRasterSymbols", "GmlObservatins", "GmlTextSymbols", "GmlPolygonSymbols"] + + def getGmlSelectors(self): + + return self._GmlSelectors + + def setGmlSelectors(self, value): + for p in self._GmlSelectors: + filtered = [q for q in p.GmlDiagramObjects if q != self] + self._GmlSelectors._GmlDiagramObjects = filtered + for r in value: + if self not in r._GmlDiagramObjects: + r._GmlDiagramObjects.append(self) + self._GmlSelectors = value + + GmlSelectors = property(getGmlSelectors, setGmlSelectors) + + def addGmlSelectors(self, *GmlSelectors): + for obj in GmlSelectors: + if self not in obj._GmlDiagramObjects: + obj._GmlDiagramObjects.append(self) + self._GmlSelectors.append(obj) + + def removeGmlSelectors(self, *GmlSelectors): + for obj in GmlSelectors: + if self in obj._GmlDiagramObjects: + obj._GmlDiagramObjects.remove(self) + self._GmlSelectors.remove(obj) + + def getDiagrams(self): + + return self._Diagrams + + def setDiagrams(self, value): + for p in self._Diagrams: + filtered = [q for q in p.GmlDiagramObjects if q != self] + self._Diagrams._GmlDiagramObjects = filtered + for r in value: + if self not in r._GmlDiagramObjects: + r._GmlDiagramObjects.append(self) + self._Diagrams = value + + Diagrams = property(getDiagrams, setDiagrams) + + def addDiagrams(self, *Diagrams): + for obj in Diagrams: + if self not in obj._GmlDiagramObjects: + obj._GmlDiagramObjects.append(self) + self._Diagrams.append(obj) + + def removeDiagrams(self, *Diagrams): + for obj in Diagrams: + if self in obj._GmlDiagramObjects: + obj._GmlDiagramObjects.remove(self) + self._Diagrams.remove(obj) + + def getCoordinateSystems(self): + + return self._CoordinateSystems + + def setCoordinateSystems(self, value): + for p in self._CoordinateSystems: + filtered = [q for q in p.GmlDiagramObjects if q != self] + self._CoordinateSystems._GmlDiagramObjects = filtered + for r in value: + if self not in r._GmlDiagramObjects: + r._GmlDiagramObjects.append(self) + self._CoordinateSystems = value + + CoordinateSystems = property(getCoordinateSystems, setCoordinateSystems) + + def addCoordinateSystems(self, *CoordinateSystems): + for obj in CoordinateSystems: + if self not in obj._GmlDiagramObjects: + obj._GmlDiagramObjects.append(self) + self._CoordinateSystems.append(obj) + + def removeCoordinateSystems(self, *CoordinateSystems): + for obj in CoordinateSystems: + if self in obj._GmlDiagramObjects: + obj._GmlDiagramObjects.remove(self) + self._CoordinateSystems.remove(obj) + + def getGmlPointSymbols(self): + + return self._GmlPointSymbols + + def setGmlPointSymbols(self, value): + for x in self._GmlPointSymbols: + x.GmlDiagramObject = None + for y in value: + y._GmlDiagramObject = self + self._GmlPointSymbols = value + + GmlPointSymbols = property(getGmlPointSymbols, setGmlPointSymbols) + + def addGmlPointSymbols(self, *GmlPointSymbols): + for obj in GmlPointSymbols: + obj.GmlDiagramObject = self + + def removeGmlPointSymbols(self, *GmlPointSymbols): + for obj in GmlPointSymbols: + obj.GmlDiagramObject = None + + def getGmlLineSymbols(self): + + return self._GmlLineSymbols + + def setGmlLineSymbols(self, value): + for x in self._GmlLineSymbols: + x.GmlDiagramObject = None + for y in value: + y._GmlDiagramObject = self + self._GmlLineSymbols = value + + GmlLineSymbols = property(getGmlLineSymbols, setGmlLineSymbols) + + def addGmlLineSymbols(self, *GmlLineSymbols): + for obj in GmlLineSymbols: + obj.GmlDiagramObject = self + + def removeGmlLineSymbols(self, *GmlLineSymbols): + for obj in GmlLineSymbols: + obj.GmlDiagramObject = None + + def getGmlRasterSymbols(self): + + return self._GmlRasterSymbols + + def setGmlRasterSymbols(self, value): + for x in self._GmlRasterSymbols: + x.GmlDiagramObject = None + for y in value: + y._GmlDiagramObject = self + self._GmlRasterSymbols = value + + GmlRasterSymbols = property(getGmlRasterSymbols, setGmlRasterSymbols) + + def addGmlRasterSymbols(self, *GmlRasterSymbols): + for obj in GmlRasterSymbols: + obj.GmlDiagramObject = self + + def removeGmlRasterSymbols(self, *GmlRasterSymbols): + for obj in GmlRasterSymbols: + obj.GmlDiagramObject = None + + def getGmlObservatins(self): + + return self._GmlObservatins + + def setGmlObservatins(self, value): + for p in self._GmlObservatins: + filtered = [q for q in p.GmlDiagramObjects if q != self] + self._GmlObservatins._GmlDiagramObjects = filtered + for r in value: + if self not in r._GmlDiagramObjects: + r._GmlDiagramObjects.append(self) + self._GmlObservatins = value + + GmlObservatins = property(getGmlObservatins, setGmlObservatins) + + def addGmlObservatins(self, *GmlObservatins): + for obj in GmlObservatins: + if self not in obj._GmlDiagramObjects: + obj._GmlDiagramObjects.append(self) + self._GmlObservatins.append(obj) + + def removeGmlObservatins(self, *GmlObservatins): + for obj in GmlObservatins: + if self in obj._GmlDiagramObjects: + obj._GmlDiagramObjects.remove(self) + self._GmlObservatins.remove(obj) + + def getGmlTextSymbols(self): + + return self._GmlTextSymbols + + def setGmlTextSymbols(self, value): + for x in self._GmlTextSymbols: + x.GmlDiagramObject = None + for y in value: + y._GmlDiagramObject = self + self._GmlTextSymbols = value + + GmlTextSymbols = property(getGmlTextSymbols, setGmlTextSymbols) + + def addGmlTextSymbols(self, *GmlTextSymbols): + for obj in GmlTextSymbols: + obj.GmlDiagramObject = self + + def removeGmlTextSymbols(self, *GmlTextSymbols): + for obj in GmlTextSymbols: + obj.GmlDiagramObject = None + + def getGmlPolygonSymbols(self): + + return self._GmlPolygonSymbols + + def setGmlPolygonSymbols(self, value): + for x in self._GmlPolygonSymbols: + x.GmlDiagramObject = None + for y in value: + y._GmlDiagramObject = self + self._GmlPolygonSymbols = value + + GmlPolygonSymbols = property(getGmlPolygonSymbols, setGmlPolygonSymbols) + + def addGmlPolygonSymbols(self, *GmlPolygonSymbols): + for obj in GmlPolygonSymbols: + obj.GmlDiagramObject = self + + def removeGmlPolygonSymbols(self, *GmlPolygonSymbols): + for obj in GmlPolygonSymbols: + obj.GmlDiagramObject = None + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlFeatureStyle.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlFeatureStyle.py new file mode 100755 index 00000000..9c4b1398 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlFeatureStyle.py @@ -0,0 +1,204 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlFeatureStyle(IdentifiedObject): + """Used for styling a particular aspect or aspects of a feature, such as geometry, topology or arbitrary text string.Used for styling a particular aspect or aspects of a feature, such as geometry, topology or arbitrary text string. + """ + + def __init__(self, semanticTypeIdentifier='', featureType='', version='', featureTypeName='', featureConstraint='', baseType='', queryGrammar="other", GmlGeometryStyles=None, GmlSymbols=None, GmlTobologyStyles=None, GmlLabelStyles=None, GmlFeatureTypes=None, *args, **kw_args): + """Initialises a new 'GmlFeatureStyle' instance. + + @param semanticTypeIdentifier: The SemanticTypeIdentifier is experimental in GML and is intended to be used to identify what the feature style is suitable to be used for using community-controlled name(s). For example, a single style may be suitable to use with many different feature types. + @param featureType: The simplest and most common way of relating features and styles is by using this attribute. Its value will be the declared name of a feature, instances of which we want to style. For example, if the featureType = Switch, this FeatureStyle object will simply apply to all Switch features. + @param version: Allows version numbers to be identified when the SLD pieces are used independently. + @param featureTypeName: Identifies the specific feature type that the feature-type style is for. + @param featureConstraint: This property is used to further constrain the feature instance set to which the style applies. It is optional and its value is an XPath expression. If the property does not exist, the style applies to all feature instances selected by 'featureType' or 'baseType'. + @param baseType: Another way of selecting the feature instances to which the style applies is to specify, as the value of this attribute, the name of the base type from which feature or features derive. + @param queryGrammar: Grammar used in the content of the gml:featureConstraint element. Values are: "other", "xpath", "xquery" + @param GmlGeometryStyles: + @param GmlSymbols: + @param GmlTobologyStyles: + @param GmlLabelStyles: + @param GmlFeatureTypes: + """ + #: The SemanticTypeIdentifier is experimental in GML and is intended to be used to identify what the feature style is suitable to be used for using community-controlled name(s). For example, a single style may be suitable to use with many different feature types. + self.semanticTypeIdentifier = semanticTypeIdentifier + + #: The simplest and most common way of relating features and styles is by using this attribute. Its value will be the declared name of a feature, instances of which we want to style. For example, if the featureType = Switch, this FeatureStyle object will simply apply to all Switch features. + self.featureType = featureType + + #: Allows version numbers to be identified when the SLD pieces are used independently. + self.version = version + + #: Identifies the specific feature type that the feature-type style is for. + self.featureTypeName = featureTypeName + + #: This property is used to further constrain the feature instance set to which the style applies. It is optional and its value is an XPath expression. If the property does not exist, the style applies to all feature instances selected by 'featureType' or 'baseType'. + self.featureConstraint = featureConstraint + + #: Another way of selecting the feature instances to which the style applies is to specify, as the value of this attribute, the name of the base type from which feature or features derive. + self.baseType = baseType + + #: Grammar used in the content of the gml:featureConstraint element. Values are: "other", "xpath", "xquery" + self.queryGrammar = queryGrammar + + self._GmlGeometryStyles = [] + self.GmlGeometryStyles = [] if GmlGeometryStyles is None else GmlGeometryStyles + + self._GmlSymbols = [] + self.GmlSymbols = [] if GmlSymbols is None else GmlSymbols + + self._GmlTobologyStyles = [] + self.GmlTobologyStyles = [] if GmlTobologyStyles is None else GmlTobologyStyles + + self._GmlLabelStyles = [] + self.GmlLabelStyles = [] if GmlLabelStyles is None else GmlLabelStyles + + self._GmlFeatureTypes = [] + self.GmlFeatureTypes = [] if GmlFeatureTypes is None else GmlFeatureTypes + + super(GmlFeatureStyle, self).__init__(*args, **kw_args) + + _attrs = ["semanticTypeIdentifier", "featureType", "version", "featureTypeName", "featureConstraint", "baseType", "queryGrammar"] + _attr_types = {"semanticTypeIdentifier": str, "featureType": str, "version": str, "featureTypeName": str, "featureConstraint": str, "baseType": str, "queryGrammar": str} + _defaults = {"semanticTypeIdentifier": '', "featureType": '', "version": '', "featureTypeName": '', "featureConstraint": '', "baseType": '', "queryGrammar": "other"} + _enums = {"queryGrammar": "QueryGrammarKind"} + _refs = ["GmlGeometryStyles", "GmlSymbols", "GmlTobologyStyles", "GmlLabelStyles", "GmlFeatureTypes"] + _many_refs = ["GmlGeometryStyles", "GmlSymbols", "GmlTobologyStyles", "GmlLabelStyles", "GmlFeatureTypes"] + + def getGmlGeometryStyles(self): + + return self._GmlGeometryStyles + + def setGmlGeometryStyles(self, value): + for x in self._GmlGeometryStyles: + x.GmlFeatureStyle = None + for y in value: + y._GmlFeatureStyle = self + self._GmlGeometryStyles = value + + GmlGeometryStyles = property(getGmlGeometryStyles, setGmlGeometryStyles) + + def addGmlGeometryStyles(self, *GmlGeometryStyles): + for obj in GmlGeometryStyles: + obj.GmlFeatureStyle = self + + def removeGmlGeometryStyles(self, *GmlGeometryStyles): + for obj in GmlGeometryStyles: + obj.GmlFeatureStyle = None + + def getGmlSymbols(self): + + return self._GmlSymbols + + def setGmlSymbols(self, value): + for p in self._GmlSymbols: + filtered = [q for q in p.GmlFeatureStyles if q != self] + self._GmlSymbols._GmlFeatureStyles = filtered + for r in value: + if self not in r._GmlFeatureStyles: + r._GmlFeatureStyles.append(self) + self._GmlSymbols = value + + GmlSymbols = property(getGmlSymbols, setGmlSymbols) + + def addGmlSymbols(self, *GmlSymbols): + for obj in GmlSymbols: + if self not in obj._GmlFeatureStyles: + obj._GmlFeatureStyles.append(self) + self._GmlSymbols.append(obj) + + def removeGmlSymbols(self, *GmlSymbols): + for obj in GmlSymbols: + if self in obj._GmlFeatureStyles: + obj._GmlFeatureStyles.remove(self) + self._GmlSymbols.remove(obj) + + def getGmlTobologyStyles(self): + + return self._GmlTobologyStyles + + def setGmlTobologyStyles(self, value): + for x in self._GmlTobologyStyles: + x.GmlFeatureStyle = None + for y in value: + y._GmlFeatureStyle = self + self._GmlTobologyStyles = value + + GmlTobologyStyles = property(getGmlTobologyStyles, setGmlTobologyStyles) + + def addGmlTobologyStyles(self, *GmlTobologyStyles): + for obj in GmlTobologyStyles: + obj.GmlFeatureStyle = self + + def removeGmlTobologyStyles(self, *GmlTobologyStyles): + for obj in GmlTobologyStyles: + obj.GmlFeatureStyle = None + + def getGmlLabelStyles(self): + + return self._GmlLabelStyles + + def setGmlLabelStyles(self, value): + for x in self._GmlLabelStyles: + x.GmlFeatureStyle = None + for y in value: + y._GmlFeatureStyle = self + self._GmlLabelStyles = value + + GmlLabelStyles = property(getGmlLabelStyles, setGmlLabelStyles) + + def addGmlLabelStyles(self, *GmlLabelStyles): + for obj in GmlLabelStyles: + obj.GmlFeatureStyle = self + + def removeGmlLabelStyles(self, *GmlLabelStyles): + for obj in GmlLabelStyles: + obj.GmlFeatureStyle = None + + def getGmlFeatureTypes(self): + + return self._GmlFeatureTypes + + def setGmlFeatureTypes(self, value): + for p in self._GmlFeatureTypes: + filtered = [q for q in p.GmlFeatureStyles if q != self] + self._GmlFeatureTypes._GmlFeatureStyles = filtered + for r in value: + if self not in r._GmlFeatureStyles: + r._GmlFeatureStyles.append(self) + self._GmlFeatureTypes = value + + GmlFeatureTypes = property(getGmlFeatureTypes, setGmlFeatureTypes) + + def addGmlFeatureTypes(self, *GmlFeatureTypes): + for obj in GmlFeatureTypes: + if self not in obj._GmlFeatureStyles: + obj._GmlFeatureStyles.append(self) + self._GmlFeatureTypes.append(obj) + + def removeGmlFeatureTypes(self, *GmlFeatureTypes): + for obj in GmlFeatureTypes: + if self in obj._GmlFeatureStyles: + obj._GmlFeatureStyles.remove(self) + self._GmlFeatureTypes.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlFeatureType.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlFeatureType.py new file mode 100755 index 00000000..35be05e7 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlFeatureType.py @@ -0,0 +1,70 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlFeatureType(IdentifiedObject): + """Type classification of feature.Type classification of feature. + """ + + def __init__(self, GmlFeatureStyles=None, *args, **kw_args): + """Initialises a new 'GmlFeatureType' instance. + + @param GmlFeatureStyles: + """ + self._GmlFeatureStyles = [] + self.GmlFeatureStyles = [] if GmlFeatureStyles is None else GmlFeatureStyles + + super(GmlFeatureType, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["GmlFeatureStyles"] + _many_refs = ["GmlFeatureStyles"] + + def getGmlFeatureStyles(self): + + return self._GmlFeatureStyles + + def setGmlFeatureStyles(self, value): + for p in self._GmlFeatureStyles: + filtered = [q for q in p.GmlFeatureTypes if q != self] + self._GmlFeatureStyles._GmlFeatureTypes = filtered + for r in value: + if self not in r._GmlFeatureTypes: + r._GmlFeatureTypes.append(self) + self._GmlFeatureStyles = value + + GmlFeatureStyles = property(getGmlFeatureStyles, setGmlFeatureStyles) + + def addGmlFeatureStyles(self, *GmlFeatureStyles): + for obj in GmlFeatureStyles: + if self not in obj._GmlFeatureTypes: + obj._GmlFeatureTypes.append(self) + self._GmlFeatureStyles.append(obj) + + def removeGmlFeatureStyles(self, *GmlFeatureStyles): + for obj in GmlFeatureStyles: + if self in obj._GmlFeatureTypes: + obj._GmlFeatureTypes.remove(self) + self._GmlFeatureStyles.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlFill.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlFill.py new file mode 100755 index 00000000..64f9d890 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlFill.py @@ -0,0 +1,175 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlFill(IdentifiedObject): + """Specifies how the area of the geometry will be filled.Specifies how the area of the geometry will be filled. + """ + + def __init__(self, opacity=0.0, GmlColour=None, GmlMarks=None, GmlTextSymbols=None, GmlSvgParameters=None, GmlPolygonSymbols=None, *args, **kw_args): + """Initialises a new 'GmlFill' instance. + + @param opacity: Specifies the level of translucency to use when rendering the Fill. The value is encoded as a floating-point value between 0.0 and 1.0 with 0.0 representing completely transparent and 1.0 representing completely opaque, with a linear scale of translucency for intermediate values. The default value is 1.0 + @param GmlColour: + @param GmlMarks: + @param GmlTextSymbols: + @param GmlSvgParameters: + @param GmlPolygonSymbols: + """ + #: Specifies the level of translucency to use when rendering the Fill. The value is encoded as a floating-point value between 0.0 and 1.0 with 0.0 representing completely transparent and 1.0 representing completely opaque, with a linear scale of translucency for intermediate values. The default value is 1.0 + self.opacity = opacity + + self._GmlColour = None + self.GmlColour = GmlColour + + self._GmlMarks = [] + self.GmlMarks = [] if GmlMarks is None else GmlMarks + + self._GmlTextSymbols = [] + self.GmlTextSymbols = [] if GmlTextSymbols is None else GmlTextSymbols + + self._GmlSvgParameters = [] + self.GmlSvgParameters = [] if GmlSvgParameters is None else GmlSvgParameters + + self._GmlPolygonSymbols = [] + self.GmlPolygonSymbols = [] if GmlPolygonSymbols is None else GmlPolygonSymbols + + super(GmlFill, self).__init__(*args, **kw_args) + + _attrs = ["opacity"] + _attr_types = {"opacity": float} + _defaults = {"opacity": 0.0} + _enums = {} + _refs = ["GmlColour", "GmlMarks", "GmlTextSymbols", "GmlSvgParameters", "GmlPolygonSymbols"] + _many_refs = ["GmlMarks", "GmlTextSymbols", "GmlSvgParameters", "GmlPolygonSymbols"] + + def getGmlColour(self): + + return self._GmlColour + + def setGmlColour(self, value): + if self._GmlColour is not None: + filtered = [x for x in self.GmlColour.GmlFills if x != self] + self._GmlColour._GmlFills = filtered + + self._GmlColour = value + if self._GmlColour is not None: + if self not in self._GmlColour._GmlFills: + self._GmlColour._GmlFills.append(self) + + GmlColour = property(getGmlColour, setGmlColour) + + def getGmlMarks(self): + + return self._GmlMarks + + def setGmlMarks(self, value): + for p in self._GmlMarks: + filtered = [q for q in p.GmlFIlls if q != self] + self._GmlMarks._GmlFIlls = filtered + for r in value: + if self not in r._GmlFIlls: + r._GmlFIlls.append(self) + self._GmlMarks = value + + GmlMarks = property(getGmlMarks, setGmlMarks) + + def addGmlMarks(self, *GmlMarks): + for obj in GmlMarks: + if self not in obj._GmlFIlls: + obj._GmlFIlls.append(self) + self._GmlMarks.append(obj) + + def removeGmlMarks(self, *GmlMarks): + for obj in GmlMarks: + if self in obj._GmlFIlls: + obj._GmlFIlls.remove(self) + self._GmlMarks.remove(obj) + + def getGmlTextSymbols(self): + + return self._GmlTextSymbols + + def setGmlTextSymbols(self, value): + for x in self._GmlTextSymbols: + x.GmlFill = None + for y in value: + y._GmlFill = self + self._GmlTextSymbols = value + + GmlTextSymbols = property(getGmlTextSymbols, setGmlTextSymbols) + + def addGmlTextSymbols(self, *GmlTextSymbols): + for obj in GmlTextSymbols: + obj.GmlFill = self + + def removeGmlTextSymbols(self, *GmlTextSymbols): + for obj in GmlTextSymbols: + obj.GmlFill = None + + def getGmlSvgParameters(self): + + return self._GmlSvgParameters + + def setGmlSvgParameters(self, value): + for p in self._GmlSvgParameters: + filtered = [q for q in p.GmlFills if q != self] + self._GmlSvgParameters._GmlFills = filtered + for r in value: + if self not in r._GmlFills: + r._GmlFills.append(self) + self._GmlSvgParameters = value + + GmlSvgParameters = property(getGmlSvgParameters, setGmlSvgParameters) + + def addGmlSvgParameters(self, *GmlSvgParameters): + for obj in GmlSvgParameters: + if self not in obj._GmlFills: + obj._GmlFills.append(self) + self._GmlSvgParameters.append(obj) + + def removeGmlSvgParameters(self, *GmlSvgParameters): + for obj in GmlSvgParameters: + if self in obj._GmlFills: + obj._GmlFills.remove(self) + self._GmlSvgParameters.remove(obj) + + def getGmlPolygonSymbols(self): + + return self._GmlPolygonSymbols + + def setGmlPolygonSymbols(self, value): + for x in self._GmlPolygonSymbols: + x.GmlFill = None + for y in value: + y._GmlFill = self + self._GmlPolygonSymbols = value + + GmlPolygonSymbols = property(getGmlPolygonSymbols, setGmlPolygonSymbols) + + def addGmlPolygonSymbols(self, *GmlPolygonSymbols): + for obj in GmlPolygonSymbols: + obj.GmlFill = self + + def removeGmlPolygonSymbols(self, *GmlPolygonSymbols): + for obj in GmlPolygonSymbols: + obj.GmlFill = None + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlFont.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlFont.py new file mode 100755 index 00000000..93986741 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlFont.py @@ -0,0 +1,135 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlFont(IdentifiedObject): + """Identifies a font of a certain family, style, and size.Identifies a font of a certain family, style, and size. + """ + + def __init__(self, absoluteSize=False, size='', style='', family='', weight='', GmlTextSymbols=None, GmlSvgParameters=None, GmlColour=None, *args, **kw_args): + """Initialises a new 'GmlFont' instance. + + @param absoluteSize: True if 'size' is expressed in absolute values. Default is false. + @param size: The size to use for the font in pixels. The default is defined to be 10 pixels, though various systems may have restrictions on what sizes are available. + @param style: The style to use for a font. The allowed values are 'normal', 'italic', and 'oblique'. + @param family: Family name of a font to use. Allowed values are system-dependent. Any number of font-family attributes may be given and they are assumed to be in preferred order. + @param weight: The amount of weight or boldness to use for a font. Allowed values are 'normal' and 'bold'. + @param GmlTextSymbols: + @param GmlSvgParameters: + @param GmlColour: + """ + #: True if 'size' is expressed in absolute values. Default is false. + self.absoluteSize = absoluteSize + + #: The size to use for the font in pixels. The default is defined to be 10 pixels, though various systems may have restrictions on what sizes are available. + self.size = size + + #: The style to use for a font. The allowed values are 'normal', 'italic', and 'oblique'. + self.style = style + + #: Family name of a font to use. Allowed values are system-dependent. Any number of font-family attributes may be given and they are assumed to be in preferred order. + self.family = family + + #: The amount of weight or boldness to use for a font. Allowed values are 'normal' and 'bold'. + self.weight = weight + + self._GmlTextSymbols = [] + self.GmlTextSymbols = [] if GmlTextSymbols is None else GmlTextSymbols + + self._GmlSvgParameters = [] + self.GmlSvgParameters = [] if GmlSvgParameters is None else GmlSvgParameters + + self._GmlColour = None + self.GmlColour = GmlColour + + super(GmlFont, self).__init__(*args, **kw_args) + + _attrs = ["absoluteSize", "size", "style", "family", "weight"] + _attr_types = {"absoluteSize": bool, "size": str, "style": str, "family": str, "weight": str} + _defaults = {"absoluteSize": False, "size": '', "style": '', "family": '', "weight": ''} + _enums = {} + _refs = ["GmlTextSymbols", "GmlSvgParameters", "GmlColour"] + _many_refs = ["GmlTextSymbols", "GmlSvgParameters"] + + def getGmlTextSymbols(self): + + return self._GmlTextSymbols + + def setGmlTextSymbols(self, value): + for x in self._GmlTextSymbols: + x.GmlFont = None + for y in value: + y._GmlFont = self + self._GmlTextSymbols = value + + GmlTextSymbols = property(getGmlTextSymbols, setGmlTextSymbols) + + def addGmlTextSymbols(self, *GmlTextSymbols): + for obj in GmlTextSymbols: + obj.GmlFont = self + + def removeGmlTextSymbols(self, *GmlTextSymbols): + for obj in GmlTextSymbols: + obj.GmlFont = None + + def getGmlSvgParameters(self): + + return self._GmlSvgParameters + + def setGmlSvgParameters(self, value): + for p in self._GmlSvgParameters: + filtered = [q for q in p.GmlFonts if q != self] + self._GmlSvgParameters._GmlFonts = filtered + for r in value: + if self not in r._GmlFonts: + r._GmlFonts.append(self) + self._GmlSvgParameters = value + + GmlSvgParameters = property(getGmlSvgParameters, setGmlSvgParameters) + + def addGmlSvgParameters(self, *GmlSvgParameters): + for obj in GmlSvgParameters: + if self not in obj._GmlFonts: + obj._GmlFonts.append(self) + self._GmlSvgParameters.append(obj) + + def removeGmlSvgParameters(self, *GmlSvgParameters): + for obj in GmlSvgParameters: + if self in obj._GmlFonts: + obj._GmlFonts.remove(self) + self._GmlSvgParameters.remove(obj) + + def getGmlColour(self): + + return self._GmlColour + + def setGmlColour(self, value): + if self._GmlColour is not None: + filtered = [x for x in self.GmlColour.GmlFonts if x != self] + self._GmlColour._GmlFonts = filtered + + self._GmlColour = value + if self._GmlColour is not None: + if self not in self._GmlColour._GmlFonts: + self._GmlColour._GmlFonts.append(self) + + GmlColour = property(getGmlColour, setGmlColour) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlGeometryStyle.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlGeometryStyle.py new file mode 100755 index 00000000..7d6ca9e7 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlGeometryStyle.py @@ -0,0 +1,91 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlGeometryStyle(IdentifiedObject): + """The style for one geometry of a feature. Any number of geometry style descriptors can be assigned to one feature style. This is usually required for features with multiple geometry properties.The style for one geometry of a feature. Any number of geometry style descriptors can be assigned to one feature style. This is usually required for features with multiple geometry properties. + """ + + def __init__(self, geometryProperty='', geometryType='', symbol='', GmlFeatureStyle=None, GmlLabelStyle=None, *args, **kw_args): + """Initialises a new 'GmlGeometryStyle' instance. + + @param geometryProperty: The name of the geometry property of a feature to which this GeometryStyle applies. + @param geometryType: It is necessary to specify the geometry type using this attribute as well since the application schema of the geometry property may allow different geometries as its value. + @param symbol: Graphical symbol used to render a geometry or a topology. A symbol is a description of graphical attributes of a graphical object without a particular, implicit meaning. It can be a description of a line, circle, polygon or more complex drawing. + @param GmlFeatureStyle: + @param GmlLabelStyle: + """ + #: The name of the geometry property of a feature to which this GeometryStyle applies. + self.geometryProperty = geometryProperty + + #: It is necessary to specify the geometry type using this attribute as well since the application schema of the geometry property may allow different geometries as its value. + self.geometryType = geometryType + + #: Graphical symbol used to render a geometry or a topology. A symbol is a description of graphical attributes of a graphical object without a particular, implicit meaning. It can be a description of a line, circle, polygon or more complex drawing. + self.symbol = symbol + + self._GmlFeatureStyle = None + self.GmlFeatureStyle = GmlFeatureStyle + + self._GmlLabelStyle = None + self.GmlLabelStyle = GmlLabelStyle + + super(GmlGeometryStyle, self).__init__(*args, **kw_args) + + _attrs = ["geometryProperty", "geometryType", "symbol"] + _attr_types = {"geometryProperty": str, "geometryType": str, "symbol": str} + _defaults = {"geometryProperty": '', "geometryType": '', "symbol": ''} + _enums = {} + _refs = ["GmlFeatureStyle", "GmlLabelStyle"] + _many_refs = [] + + def getGmlFeatureStyle(self): + + return self._GmlFeatureStyle + + def setGmlFeatureStyle(self, value): + if self._GmlFeatureStyle is not None: + filtered = [x for x in self.GmlFeatureStyle.GmlGeometryStyles if x != self] + self._GmlFeatureStyle._GmlGeometryStyles = filtered + + self._GmlFeatureStyle = value + if self._GmlFeatureStyle is not None: + if self not in self._GmlFeatureStyle._GmlGeometryStyles: + self._GmlFeatureStyle._GmlGeometryStyles.append(self) + + GmlFeatureStyle = property(getGmlFeatureStyle, setGmlFeatureStyle) + + def getGmlLabelStyle(self): + + return self._GmlLabelStyle + + def setGmlLabelStyle(self, value): + if self._GmlLabelStyle is not None: + filtered = [x for x in self.GmlLabelStyle.GmlGeometryStyles if x != self] + self._GmlLabelStyle._GmlGeometryStyles = filtered + + self._GmlLabelStyle = value + if self._GmlLabelStyle is not None: + if self not in self._GmlLabelStyle._GmlGeometryStyles: + self._GmlLabelStyle._GmlGeometryStyles.append(self) + + GmlLabelStyle = property(getGmlLabelStyle, setGmlLabelStyle) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlGraphic.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlGraphic.py new file mode 100755 index 00000000..2fb29bbd --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlGraphic.py @@ -0,0 +1,123 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlGraphic(IdentifiedObject): + """A 'graphic symbol' with an inherent shape, color(s), and possibly size. A 'graphic' can be very informally defined as 'a little picture' and can be of either a raster or vector-graphic source type.A 'graphic symbol' with an inherent shape, color(s), and possibly size. A 'graphic' can be very informally defined as 'a little picture' and can be of either a raster or vector-graphic source type. + """ + + def __init__(self, rotation=0.0, size=0, symbolID='', minSize=0, opacity=0.0, xScale=0.0, yScale=0.0, GmlMarks=None, GmlPointSymbols=None, *args, **kw_args): + """Initialises a new 'GmlGraphic' instance. + + @param rotation: Gives the rotation of a graphic in the clockwise direction about its center point in decimal degrees, encoded as a floating-point number. Negative values mean counter-clockwise rotation. The default value is 0.0 (no rotation). Note that there is no connection between source geometry types and rotations; the point used for plotting has no inherent direction. Also, the point within the graphic about which it is rotated is format dependent. If a format does not include an inherent rotation point, then the point of rotation should be the centroid. + @param size: Gives the absolute size of the graphic in pixels encoded as a floatingpoint number. The default size for an object is context-dependent. Negative values are not allowed. + @param symbolID: The identifier of the symbol, if not derived from the type of CIM object (PSR, Asset, Organisation, Document, etc.) gmlSymbolPlacement is associated with. + @param minSize: The minimum symbol size allowed. + @param opacity: Specifies the level of translucency to use when rendering the Graphic.The value is encoded as a floating-point value between 0.0 and 1.0 with 0.0 representing completely transparent and 1.0 representing completely opaque, with a linear scale of translucency for intermediate values. The default value is 1.0 + @param xScale: Horizontal scaling factor of normal symbol - particularly applicable to busbars if not described through a sequence of gmlPositions (e.g., Busbar). + @param yScale: Vertical scaling factor of normal symbol - particularly applicable to busbars if not described through a sequence of gmlPositions (e.g., Busbars). + @param GmlMarks: + @param GmlPointSymbols: + """ + #: Gives the rotation of a graphic in the clockwise direction about its center point in decimal degrees, encoded as a floating-point number. Negative values mean counter-clockwise rotation. The default value is 0.0 (no rotation). Note that there is no connection between source geometry types and rotations; the point used for plotting has no inherent direction. Also, the point within the graphic about which it is rotated is format dependent. If a format does not include an inherent rotation point, then the point of rotation should be the centroid. + self.rotation = rotation + + #: Gives the absolute size of the graphic in pixels encoded as a floatingpoint number. The default size for an object is context-dependent. Negative values are not allowed. + self.size = size + + #: The identifier of the symbol, if not derived from the type of CIM object (PSR, Asset, Organisation, Document, etc.) gmlSymbolPlacement is associated with. + self.symbolID = symbolID + + #: The minimum symbol size allowed. + self.minSize = minSize + + #: Specifies the level of translucency to use when rendering the Graphic.The value is encoded as a floating-point value between 0.0 and 1.0 with 0.0 representing completely transparent and 1.0 representing completely opaque, with a linear scale of translucency for intermediate values. The default value is 1.0 + self.opacity = opacity + + #: Horizontal scaling factor of normal symbol - particularly applicable to busbars if not described through a sequence of gmlPositions (e.g., Busbar). + self.xScale = xScale + + #: Vertical scaling factor of normal symbol - particularly applicable to busbars if not described through a sequence of gmlPositions (e.g., Busbars). + self.yScale = yScale + + self._GmlMarks = [] + self.GmlMarks = [] if GmlMarks is None else GmlMarks + + self._GmlPointSymbols = [] + self.GmlPointSymbols = [] if GmlPointSymbols is None else GmlPointSymbols + + super(GmlGraphic, self).__init__(*args, **kw_args) + + _attrs = ["rotation", "size", "symbolID", "minSize", "opacity", "xScale", "yScale"] + _attr_types = {"rotation": float, "size": int, "symbolID": str, "minSize": int, "opacity": float, "xScale": float, "yScale": float} + _defaults = {"rotation": 0.0, "size": 0, "symbolID": '', "minSize": 0, "opacity": 0.0, "xScale": 0.0, "yScale": 0.0} + _enums = {} + _refs = ["GmlMarks", "GmlPointSymbols"] + _many_refs = ["GmlMarks", "GmlPointSymbols"] + + def getGmlMarks(self): + + return self._GmlMarks + + def setGmlMarks(self, value): + for p in self._GmlMarks: + filtered = [q for q in p.GmlGraphics if q != self] + self._GmlMarks._GmlGraphics = filtered + for r in value: + if self not in r._GmlGraphics: + r._GmlGraphics.append(self) + self._GmlMarks = value + + GmlMarks = property(getGmlMarks, setGmlMarks) + + def addGmlMarks(self, *GmlMarks): + for obj in GmlMarks: + if self not in obj._GmlGraphics: + obj._GmlGraphics.append(self) + self._GmlMarks.append(obj) + + def removeGmlMarks(self, *GmlMarks): + for obj in GmlMarks: + if self in obj._GmlGraphics: + obj._GmlGraphics.remove(self) + self._GmlMarks.remove(obj) + + def getGmlPointSymbols(self): + + return self._GmlPointSymbols + + def setGmlPointSymbols(self, value): + for x in self._GmlPointSymbols: + x.GmlGraphic = None + for y in value: + y._GmlGraphic = self + self._GmlPointSymbols = value + + GmlPointSymbols = property(getGmlPointSymbols, setGmlPointSymbols) + + def addGmlPointSymbols(self, *GmlPointSymbols): + for obj in GmlPointSymbols: + obj.GmlGraphic = self + + def removeGmlPointSymbols(self, *GmlPointSymbols): + for obj in GmlPointSymbols: + obj.GmlGraphic = None + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlHalo.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlHalo.py new file mode 100755 index 00000000..9bdca20a --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlHalo.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlHalo(IdentifiedObject): + """A type of Fill that is applied to the backgrounds of font glyphs. The use of halos greatly improves the readability of text labels.A type of Fill that is applied to the backgrounds of font glyphs. The use of halos greatly improves the readability of text labels. + """ + + def __init__(self, radius='', opacity=0.0, GmlTextSymbols=None, *args, **kw_args): + """Initialises a new 'GmlHalo' instance. + + @param radius: The Radius element gives the absolute size of a halo radius in pixels encoded as a floating-point number. The radius is taken from the outside edge of a font glyph to extend the area of coverage of the glyph (and the inside edge of ?holes? in the glyphs). The default radius is one pixel. Negative values are not allowed. + @param opacity: Specifies the level of translucency to use when rendering the Fill. The value is encoded as a floating-point value between 0.0 and 1.0 with 0.0 representing completely transparent and 1.0 representing completely opaque, with a linear scale of translucency for intermediate values. The default value is 1.0 + @param GmlTextSymbols: + """ + #: The Radius element gives the absolute size of a halo radius in pixels encoded as a floating-point number. The radius is taken from the outside edge of a font glyph to extend the area of coverage of the glyph (and the inside edge of ?holes? in the glyphs). The default radius is one pixel. Negative values are not allowed. + self.radius = radius + + #: Specifies the level of translucency to use when rendering the Fill. The value is encoded as a floating-point value between 0.0 and 1.0 with 0.0 representing completely transparent and 1.0 representing completely opaque, with a linear scale of translucency for intermediate values. The default value is 1.0 + self.opacity = opacity + + self._GmlTextSymbols = [] + self.GmlTextSymbols = [] if GmlTextSymbols is None else GmlTextSymbols + + super(GmlHalo, self).__init__(*args, **kw_args) + + _attrs = ["radius", "opacity"] + _attr_types = {"radius": str, "opacity": float} + _defaults = {"radius": '', "opacity": 0.0} + _enums = {} + _refs = ["GmlTextSymbols"] + _many_refs = ["GmlTextSymbols"] + + def getGmlTextSymbols(self): + + return self._GmlTextSymbols + + def setGmlTextSymbols(self, value): + for x in self._GmlTextSymbols: + x.GmlHalo = None + for y in value: + y._GmlHalo = self + self._GmlTextSymbols = value + + GmlTextSymbols = property(getGmlTextSymbols, setGmlTextSymbols) + + def addGmlTextSymbols(self, *GmlTextSymbols): + for obj in GmlTextSymbols: + obj.GmlHalo = self + + def removeGmlTextSymbols(self, *GmlTextSymbols): + for obj in GmlTextSymbols: + obj.GmlHalo = None + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlLabelPlacement.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlLabelPlacement.py new file mode 100755 index 00000000..2265ed91 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlLabelPlacement.py @@ -0,0 +1,92 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlLabelPlacement(IdentifiedObject): + """Used to position a label relative to a point or a line.Used to position a label relative to a point or a line. + """ + + def __init__(self, displacementX='', rotation='', displacementY='', type='', anchorX='', anchorY='', offset='', GmlTextSymbols=None, *args, **kw_args): + """Initialises a new 'GmlLabelPlacement' instance. + + @param displacementX: X displacement from the main-geometry point to render a text label. + @param rotation: Clockwise rotation of the label in degrees from the normal direction for a font. + @param displacementY: Y displacement from the main-geometry point to render a text label. + @param type: Type of 'LabelPlacement' which in turn specifies where and how a text label should be rendered relative to a geometry. + @param anchorX: X-coordinate location inside of a label to use for anchoring the label to the main-geometry point. + @param anchorY: Y-coordinate location inside of a label to use for anchoring the label to the main-geometry point. + @param offset: Perpendicular distance away from a line to draw a label. The distance is in pixels and is positive to the left-hand side of the line string. Negative numbers mean right. The default offset is 0. + @param GmlTextSymbols: + """ + #: X displacement from the main-geometry point to render a text label. + self.displacementX = displacementX + + #: Clockwise rotation of the label in degrees from the normal direction for a font. + self.rotation = rotation + + #: Y displacement from the main-geometry point to render a text label. + self.displacementY = displacementY + + #: Type of 'LabelPlacement' which in turn specifies where and how a text label should be rendered relative to a geometry. + self.type = type + + #: X-coordinate location inside of a label to use for anchoring the label to the main-geometry point. + self.anchorX = anchorX + + #: Y-coordinate location inside of a label to use for anchoring the label to the main-geometry point. + self.anchorY = anchorY + + #: Perpendicular distance away from a line to draw a label. The distance is in pixels and is positive to the left-hand side of the line string. Negative numbers mean right. The default offset is 0. + self.offset = offset + + self._GmlTextSymbols = [] + self.GmlTextSymbols = [] if GmlTextSymbols is None else GmlTextSymbols + + super(GmlLabelPlacement, self).__init__(*args, **kw_args) + + _attrs = ["displacementX", "rotation", "displacementY", "type", "anchorX", "anchorY", "offset"] + _attr_types = {"displacementX": str, "rotation": str, "displacementY": str, "type": str, "anchorX": str, "anchorY": str, "offset": str} + _defaults = {"displacementX": '', "rotation": '', "displacementY": '', "type": '', "anchorX": '', "anchorY": '', "offset": ''} + _enums = {} + _refs = ["GmlTextSymbols"] + _many_refs = ["GmlTextSymbols"] + + def getGmlTextSymbols(self): + + return self._GmlTextSymbols + + def setGmlTextSymbols(self, value): + for x in self._GmlTextSymbols: + x.GmlLabelPlacement = None + for y in value: + y._GmlLabelPlacement = self + self._GmlTextSymbols = value + + GmlTextSymbols = property(getGmlTextSymbols, setGmlTextSymbols) + + def addGmlTextSymbols(self, *GmlTextSymbols): + for obj in GmlTextSymbols: + obj.GmlLabelPlacement = self + + def removeGmlTextSymbols(self, *GmlTextSymbols): + for obj in GmlTextSymbols: + obj.GmlLabelPlacement = None + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlLabelStyle.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlLabelStyle.py new file mode 100755 index 00000000..2132482b --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlLabelStyle.py @@ -0,0 +1,121 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlLabelStyle(IdentifiedObject): + """The style for the text that is to be displayed along with the graphical representation of a feature. The content of the label is not necessarily defined in the GML data set. More precisely, the content can be static text specified in the style itself and the text from the GML data set. Label style has two elements: gml:style that specifies the style and gml:label that is used to compose the label content.The style for the text that is to be displayed along with the graphical representation of a feature. The content of the label is not necessarily defined in the GML data set. More precisely, the content can be static text specified in the style itself and the text from the GML data set. Label style has two elements: gml:style that specifies the style and gml:label that is used to compose the label content. + """ + + def __init__(self, transform='', labelExpression='', style='', GmlTopologyStyles=None, GmlGeometryStyles=None, GmlFeatureStyle=None, *args, **kw_args): + """Initialises a new 'GmlLabelStyle' instance. + + @param transform: Allows us to specify a transformation expression that will be applied to the symbol in the rendering phase. Its type is xsd:string and the value is specified in the SVG specification (transform attribute). + @param labelExpression: Allows both text content and unbounded number of gml:LabelExpression elements. The value of gml:LabelExpression element is an XPath expression that selects the value of some property of the feature. + @param style: Used to specify the style of the rendered text. The CSS2 styling expressions grammar should be used to express graphic properties. + @param GmlTopologyStyles: + @param GmlGeometryStyles: + @param GmlFeatureStyle: + """ + #: Allows us to specify a transformation expression that will be applied to the symbol in the rendering phase. Its type is xsd:string and the value is specified in the SVG specification (transform attribute). + self.transform = transform + + #: Allows both text content and unbounded number of gml:LabelExpression elements. The value of gml:LabelExpression element is an XPath expression that selects the value of some property of the feature. + self.labelExpression = labelExpression + + #: Used to specify the style of the rendered text. The CSS2 styling expressions grammar should be used to express graphic properties. + self.style = style + + self._GmlTopologyStyles = [] + self.GmlTopologyStyles = [] if GmlTopologyStyles is None else GmlTopologyStyles + + self._GmlGeometryStyles = [] + self.GmlGeometryStyles = [] if GmlGeometryStyles is None else GmlGeometryStyles + + self._GmlFeatureStyle = None + self.GmlFeatureStyle = GmlFeatureStyle + + super(GmlLabelStyle, self).__init__(*args, **kw_args) + + _attrs = ["transform", "labelExpression", "style"] + _attr_types = {"transform": str, "labelExpression": str, "style": str} + _defaults = {"transform": '', "labelExpression": '', "style": ''} + _enums = {} + _refs = ["GmlTopologyStyles", "GmlGeometryStyles", "GmlFeatureStyle"] + _many_refs = ["GmlTopologyStyles", "GmlGeometryStyles"] + + def getGmlTopologyStyles(self): + + return self._GmlTopologyStyles + + def setGmlTopologyStyles(self, value): + for x in self._GmlTopologyStyles: + x.GmlLableStyle = None + for y in value: + y._GmlLableStyle = self + self._GmlTopologyStyles = value + + GmlTopologyStyles = property(getGmlTopologyStyles, setGmlTopologyStyles) + + def addGmlTopologyStyles(self, *GmlTopologyStyles): + for obj in GmlTopologyStyles: + obj.GmlLableStyle = self + + def removeGmlTopologyStyles(self, *GmlTopologyStyles): + for obj in GmlTopologyStyles: + obj.GmlLableStyle = None + + def getGmlGeometryStyles(self): + + return self._GmlGeometryStyles + + def setGmlGeometryStyles(self, value): + for x in self._GmlGeometryStyles: + x.GmlLabelStyle = None + for y in value: + y._GmlLabelStyle = self + self._GmlGeometryStyles = value + + GmlGeometryStyles = property(getGmlGeometryStyles, setGmlGeometryStyles) + + def addGmlGeometryStyles(self, *GmlGeometryStyles): + for obj in GmlGeometryStyles: + obj.GmlLabelStyle = self + + def removeGmlGeometryStyles(self, *GmlGeometryStyles): + for obj in GmlGeometryStyles: + obj.GmlLabelStyle = None + + def getGmlFeatureStyle(self): + + return self._GmlFeatureStyle + + def setGmlFeatureStyle(self, value): + if self._GmlFeatureStyle is not None: + filtered = [x for x in self.GmlFeatureStyle.GmlLabelStyles if x != self] + self._GmlFeatureStyle._GmlLabelStyles = filtered + + self._GmlFeatureStyle = value + if self._GmlFeatureStyle is not None: + if self not in self._GmlFeatureStyle._GmlLabelStyles: + self._GmlFeatureStyle._GmlLabelStyles.append(self) + + GmlFeatureStyle = property(getGmlFeatureStyle, setGmlFeatureStyle) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlLineGeometry.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlLineGeometry.py new file mode 100755 index 00000000..4a69dbf8 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlLineGeometry.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfGMLSupport.GmlDiagramObject import GmlDiagramObject + +class GmlLineGeometry(GmlDiagramObject): + """Typically used for rendering linear assets and/or power system resources.Typically used for rendering linear assets and/or power system resources. + """ + + def __init__(self, sourceSide='', *args, **kw_args): + """Initialises a new 'GmlLineGeometry' instance. + + @param sourceSide: For dynamic network update (i.e. colouring) purposes + """ + #: For dynamic network update (i.e. colouring) purposes + self.sourceSide = sourceSide + + super(GmlLineGeometry, self).__init__(*args, **kw_args) + + _attrs = ["sourceSide"] + _attr_types = {"sourceSide": str} + _defaults = {"sourceSide": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlLineSymbol.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlLineSymbol.py new file mode 100755 index 00000000..b8989712 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlLineSymbol.py @@ -0,0 +1,83 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfGMLSupport.GmlSymbol import GmlSymbol + +class GmlLineSymbol(GmlSymbol): + """Used to style a 'stroke' along a linear geometry type, such as a string of line segments.Used to style a 'stroke' along a linear geometry type, such as a string of line segments. + """ + + def __init__(self, sourceSide='', GmlStroke=None, GmlDiagramObject=None, *args, **kw_args): + """Initialises a new 'GmlLineSymbol' instance. + + @param sourceSide: For dynamic network update (i.e. colouring) purposes + @param GmlStroke: + @param GmlDiagramObject: + """ + #: For dynamic network update (i.e. colouring) purposes + self.sourceSide = sourceSide + + self._GmlStroke = None + self.GmlStroke = GmlStroke + + self._GmlDiagramObject = None + self.GmlDiagramObject = GmlDiagramObject + + super(GmlLineSymbol, self).__init__(*args, **kw_args) + + _attrs = ["sourceSide"] + _attr_types = {"sourceSide": str} + _defaults = {"sourceSide": ''} + _enums = {} + _refs = ["GmlStroke", "GmlDiagramObject"] + _many_refs = [] + + def getGmlStroke(self): + + return self._GmlStroke + + def setGmlStroke(self, value): + if self._GmlStroke is not None: + filtered = [x for x in self.GmlStroke.GmlLineSymbols if x != self] + self._GmlStroke._GmlLineSymbols = filtered + + self._GmlStroke = value + if self._GmlStroke is not None: + if self not in self._GmlStroke._GmlLineSymbols: + self._GmlStroke._GmlLineSymbols.append(self) + + GmlStroke = property(getGmlStroke, setGmlStroke) + + def getGmlDiagramObject(self): + + return self._GmlDiagramObject + + def setGmlDiagramObject(self, value): + if self._GmlDiagramObject is not None: + filtered = [x for x in self.GmlDiagramObject.GmlLineSymbols if x != self] + self._GmlDiagramObject._GmlLineSymbols = filtered + + self._GmlDiagramObject = value + if self._GmlDiagramObject is not None: + if self not in self._GmlDiagramObject._GmlLineSymbols: + self._GmlDiagramObject._GmlLineSymbols.append(self) + + GmlDiagramObject = property(getGmlDiagramObject, setGmlDiagramObject) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlMark.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlMark.py new file mode 100755 index 00000000..da70b9c1 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlMark.py @@ -0,0 +1,136 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlMark(IdentifiedObject): + """Defines a 'shape' which has coloring applied to it (i.e. square, circle, triangle, star, ...).Defines a 'shape' which has coloring applied to it (i.e. square, circle, triangle, star, ...). + """ + + def __init__(self, wellKnownName='', GmlGraphics=None, GmlStrokes=None, GmlFIlls=None, *args, **kw_args): + """Initialises a new 'GmlMark' instance. + + @param wellKnownName: Gives the well-known name of the shape of the mark. Allowed values include at least square, circle, triangle, star, cross, and x. + @param GmlGraphics: + @param GmlStrokes: + @param GmlFIlls: + """ + #: Gives the well-known name of the shape of the mark. Allowed values include at least square, circle, triangle, star, cross, and x. + self.wellKnownName = wellKnownName + + self._GmlGraphics = [] + self.GmlGraphics = [] if GmlGraphics is None else GmlGraphics + + self._GmlStrokes = [] + self.GmlStrokes = [] if GmlStrokes is None else GmlStrokes + + self._GmlFIlls = [] + self.GmlFIlls = [] if GmlFIlls is None else GmlFIlls + + super(GmlMark, self).__init__(*args, **kw_args) + + _attrs = ["wellKnownName"] + _attr_types = {"wellKnownName": str} + _defaults = {"wellKnownName": ''} + _enums = {} + _refs = ["GmlGraphics", "GmlStrokes", "GmlFIlls"] + _many_refs = ["GmlGraphics", "GmlStrokes", "GmlFIlls"] + + def getGmlGraphics(self): + + return self._GmlGraphics + + def setGmlGraphics(self, value): + for p in self._GmlGraphics: + filtered = [q for q in p.GmlMarks if q != self] + self._GmlGraphics._GmlMarks = filtered + for r in value: + if self not in r._GmlMarks: + r._GmlMarks.append(self) + self._GmlGraphics = value + + GmlGraphics = property(getGmlGraphics, setGmlGraphics) + + def addGmlGraphics(self, *GmlGraphics): + for obj in GmlGraphics: + if self not in obj._GmlMarks: + obj._GmlMarks.append(self) + self._GmlGraphics.append(obj) + + def removeGmlGraphics(self, *GmlGraphics): + for obj in GmlGraphics: + if self in obj._GmlMarks: + obj._GmlMarks.remove(self) + self._GmlGraphics.remove(obj) + + def getGmlStrokes(self): + + return self._GmlStrokes + + def setGmlStrokes(self, value): + for p in self._GmlStrokes: + filtered = [q for q in p.GmlMarks if q != self] + self._GmlStrokes._GmlMarks = filtered + for r in value: + if self not in r._GmlMarks: + r._GmlMarks.append(self) + self._GmlStrokes = value + + GmlStrokes = property(getGmlStrokes, setGmlStrokes) + + def addGmlStrokes(self, *GmlStrokes): + for obj in GmlStrokes: + if self not in obj._GmlMarks: + obj._GmlMarks.append(self) + self._GmlStrokes.append(obj) + + def removeGmlStrokes(self, *GmlStrokes): + for obj in GmlStrokes: + if self in obj._GmlMarks: + obj._GmlMarks.remove(self) + self._GmlStrokes.remove(obj) + + def getGmlFIlls(self): + + return self._GmlFIlls + + def setGmlFIlls(self, value): + for p in self._GmlFIlls: + filtered = [q for q in p.GmlMarks if q != self] + self._GmlFIlls._GmlMarks = filtered + for r in value: + if self not in r._GmlMarks: + r._GmlMarks.append(self) + self._GmlFIlls = value + + GmlFIlls = property(getGmlFIlls, setGmlFIlls) + + def addGmlFIlls(self, *GmlFIlls): + for obj in GmlFIlls: + if self not in obj._GmlMarks: + obj._GmlMarks.append(self) + self._GmlFIlls.append(obj) + + def removeGmlFIlls(self, *GmlFIlls): + for obj in GmlFIlls: + if self in obj._GmlMarks: + obj._GmlMarks.remove(self) + self._GmlFIlls.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlObservation.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlObservation.py new file mode 100755 index 00000000..b371768e --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlObservation.py @@ -0,0 +1,136 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class GmlObservation(Element): + """A GML observation models the act of observing, often with a camera, a person or some form of instrument. An observation feature describes the 'metadata' associated with an information capture event, together with a value for the result of the observation. The basic structures introduced in this class are intended to serve as the foundation for more comprehensive schemas for scientific, technical and engineering measurement schemas.A GML observation models the act of observing, often with a camera, a person or some form of instrument. An observation feature describes the 'metadata' associated with an information capture event, together with a value for the result of the observation. The basic structures introduced in this class are intended to serve as the foundation for more comprehensive schemas for scientific, technical and engineering measurement schemas. + """ + + def __init__(self, resultOf='', target='', using='', dateTime='', GmlDiagramObjects=None, ChangeItems=None, GmlValues=None, *args, **kw_args): + """Initialises a new 'GmlObservation' instance. + + @param resultOf: Indicates the result of the observation. + @param target: Contains or points to the specimen, region or station which is the object of the observation + @param using: Contains or points to a description of a sensor, instrument or procedure used for the observation. + @param dateTime: + @param GmlDiagramObjects: + @param ChangeItems: + @param GmlValues: + """ + #: Indicates the result of the observation. + self.resultOf = resultOf + + #: Contains or points to the specimen, region or station which is the object of the observation + self.target = target + + #: Contains or points to a description of a sensor, instrument or procedure used for the observation. + self.using = using + + + self.dateTime = dateTime + + self._GmlDiagramObjects = [] + self.GmlDiagramObjects = [] if GmlDiagramObjects is None else GmlDiagramObjects + + self._ChangeItems = [] + self.ChangeItems = [] if ChangeItems is None else ChangeItems + + self._GmlValues = [] + self.GmlValues = [] if GmlValues is None else GmlValues + + super(GmlObservation, self).__init__(*args, **kw_args) + + _attrs = ["resultOf", "target", "using", "dateTime"] + _attr_types = {"resultOf": str, "target": str, "using": str, "dateTime": str} + _defaults = {"resultOf": '', "target": '', "using": '', "dateTime": ''} + _enums = {} + _refs = ["GmlDiagramObjects", "ChangeItems", "GmlValues"] + _many_refs = ["GmlDiagramObjects", "ChangeItems", "GmlValues"] + + def getGmlDiagramObjects(self): + + return self._GmlDiagramObjects + + def setGmlDiagramObjects(self, value): + for p in self._GmlDiagramObjects: + filtered = [q for q in p.GmlObservatins if q != self] + self._GmlDiagramObjects._GmlObservatins = filtered + for r in value: + if self not in r._GmlObservatins: + r._GmlObservatins.append(self) + self._GmlDiagramObjects = value + + GmlDiagramObjects = property(getGmlDiagramObjects, setGmlDiagramObjects) + + def addGmlDiagramObjects(self, *GmlDiagramObjects): + for obj in GmlDiagramObjects: + if self not in obj._GmlObservatins: + obj._GmlObservatins.append(self) + self._GmlDiagramObjects.append(obj) + + def removeGmlDiagramObjects(self, *GmlDiagramObjects): + for obj in GmlDiagramObjects: + if self in obj._GmlObservatins: + obj._GmlObservatins.remove(self) + self._GmlDiagramObjects.remove(obj) + + def getChangeItems(self): + + return self._ChangeItems + + def setChangeItems(self, value): + for x in self._ChangeItems: + x.GmlObservation = None + for y in value: + y._GmlObservation = self + self._ChangeItems = value + + ChangeItems = property(getChangeItems, setChangeItems) + + def addChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.GmlObservation = self + + def removeChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.GmlObservation = None + + def getGmlValues(self): + + return self._GmlValues + + def setGmlValues(self, value): + for x in self._GmlValues: + x.GmlObservation = None + for y in value: + y._GmlObservation = self + self._GmlValues = value + + GmlValues = property(getGmlValues, setGmlValues) + + def addGmlValues(self, *GmlValues): + for obj in GmlValues: + obj.GmlObservation = self + + def removeGmlValues(self, *GmlValues): + for obj in GmlValues: + obj.GmlObservation = None + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlPointGeometry.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlPointGeometry.py new file mode 100755 index 00000000..eb955acc --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlPointGeometry.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfGMLSupport.GmlDiagramObject import GmlDiagramObject + +class GmlPointGeometry(GmlDiagramObject): + """Typically used for rendering power system resources and/or point assets.Typically used for rendering power system resources and/or point assets. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'GmlPointGeometry' instance. + + """ + super(GmlPointGeometry, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlPointSymbol.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlPointSymbol.py new file mode 100755 index 00000000..c35a54a3 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlPointSymbol.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfGMLSupport.GmlSymbol import GmlSymbol + +class GmlPointSymbol(GmlSymbol): + """Used to draw a 'graphic' at a point.Used to draw a 'graphic' at a point. + """ + + def __init__(self, GmlGraphic=None, GmlDiagramObject=None, *args, **kw_args): + """Initialises a new 'GmlPointSymbol' instance. + + @param GmlGraphic: + @param GmlDiagramObject: + """ + self._GmlGraphic = None + self.GmlGraphic = GmlGraphic + + self._GmlDiagramObject = None + self.GmlDiagramObject = GmlDiagramObject + + super(GmlPointSymbol, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["GmlGraphic", "GmlDiagramObject"] + _many_refs = [] + + def getGmlGraphic(self): + + return self._GmlGraphic + + def setGmlGraphic(self, value): + if self._GmlGraphic is not None: + filtered = [x for x in self.GmlGraphic.GmlPointSymbols if x != self] + self._GmlGraphic._GmlPointSymbols = filtered + + self._GmlGraphic = value + if self._GmlGraphic is not None: + if self not in self._GmlGraphic._GmlPointSymbols: + self._GmlGraphic._GmlPointSymbols.append(self) + + GmlGraphic = property(getGmlGraphic, setGmlGraphic) + + def getGmlDiagramObject(self): + + return self._GmlDiagramObject + + def setGmlDiagramObject(self, value): + if self._GmlDiagramObject is not None: + filtered = [x for x in self.GmlDiagramObject.GmlPointSymbols if x != self] + self._GmlDiagramObject._GmlPointSymbols = filtered + + self._GmlDiagramObject = value + if self._GmlDiagramObject is not None: + if self not in self._GmlDiagramObject._GmlPointSymbols: + self._GmlDiagramObject._GmlPointSymbols.append(self) + + GmlDiagramObject = property(getGmlDiagramObject, setGmlDiagramObject) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlPolygonGeometry.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlPolygonGeometry.py new file mode 100755 index 00000000..a2677710 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlPolygonGeometry.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfGMLSupport.GmlDiagramObject import GmlDiagramObject + +class GmlPolygonGeometry(GmlDiagramObject): + """Used to show the footprint of substations, sites, service territories, tax districts, school districts, etc.Used to show the footprint of substations, sites, service territories, tax districts, school districts, etc. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'GmlPolygonGeometry' instance. + + """ + super(GmlPolygonGeometry, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlPolygonSymbol.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlPolygonSymbol.py new file mode 100755 index 00000000..44827e36 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlPolygonSymbol.py @@ -0,0 +1,99 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfGMLSupport.GmlSymbol import GmlSymbol + +class GmlPolygonSymbol(GmlSymbol): + """Used to draw a polygon (or other area-type geometries), including filling its interior and stroking its border (outline).Used to draw a polygon (or other area-type geometries), including filling its interior and stroking its border (outline). + """ + + def __init__(self, GmlDiagramObject=None, GmlFill=None, GmlStroke=None, *args, **kw_args): + """Initialises a new 'GmlPolygonSymbol' instance. + + @param GmlDiagramObject: + @param GmlFill: + @param GmlStroke: + """ + self._GmlDiagramObject = None + self.GmlDiagramObject = GmlDiagramObject + + self._GmlFill = None + self.GmlFill = GmlFill + + self._GmlStroke = None + self.GmlStroke = GmlStroke + + super(GmlPolygonSymbol, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["GmlDiagramObject", "GmlFill", "GmlStroke"] + _many_refs = [] + + def getGmlDiagramObject(self): + + return self._GmlDiagramObject + + def setGmlDiagramObject(self, value): + if self._GmlDiagramObject is not None: + filtered = [x for x in self.GmlDiagramObject.GmlPolygonSymbols if x != self] + self._GmlDiagramObject._GmlPolygonSymbols = filtered + + self._GmlDiagramObject = value + if self._GmlDiagramObject is not None: + if self not in self._GmlDiagramObject._GmlPolygonSymbols: + self._GmlDiagramObject._GmlPolygonSymbols.append(self) + + GmlDiagramObject = property(getGmlDiagramObject, setGmlDiagramObject) + + def getGmlFill(self): + + return self._GmlFill + + def setGmlFill(self, value): + if self._GmlFill is not None: + filtered = [x for x in self.GmlFill.GmlPolygonSymbols if x != self] + self._GmlFill._GmlPolygonSymbols = filtered + + self._GmlFill = value + if self._GmlFill is not None: + if self not in self._GmlFill._GmlPolygonSymbols: + self._GmlFill._GmlPolygonSymbols.append(self) + + GmlFill = property(getGmlFill, setGmlFill) + + def getGmlStroke(self): + + return self._GmlStroke + + def setGmlStroke(self, value): + if self._GmlStroke is not None: + filtered = [x for x in self.GmlStroke.GmlPolygonSymbols if x != self] + self._GmlStroke._GmlPolygonSymbols = filtered + + self._GmlStroke = value + if self._GmlStroke is not None: + if self not in self._GmlStroke._GmlPolygonSymbols: + self._GmlStroke._GmlPolygonSymbols.append(self) + + GmlStroke = property(getGmlStroke, setGmlStroke) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlPosition.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlPosition.py new file mode 100755 index 00000000..ae6c1061 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlPosition.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.PositionPoint import PositionPoint + +class GmlPosition(PositionPoint): + """Position point with a GML coordinate reference system.Position point with a GML coordinate reference system. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'GmlPosition' instance. + + """ + super(GmlPosition, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlRasterSymbol.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlRasterSymbol.py new file mode 100755 index 00000000..4cad0e96 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlRasterSymbol.py @@ -0,0 +1,91 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfGMLSupport.GmlSymbol import GmlSymbol + +class GmlRasterSymbol(GmlSymbol): + """Describes how to render raster/matrix-coverage data (e.g., satellite photos, DEMs).Describes how to render raster/matrix-coverage data (e.g., satellite photos, DEMs). + """ + + def __init__(self, graySourcename='', greenSourceName='', opacity=0.0, reliefFactor='', redSourcename='', overlapbehaviour='', brighnessOnly=False, blueSourcename='', GmlDiagramObject=None, *args, **kw_args): + """Initialises a new 'GmlRasterSymbol' instance. + + @param graySourcename: A single colour channel may be selected to display in grayscale. Colour Channels are identified by a system and data-dependent character identifier. Contrast enhancement may be applied to each channel in isolation. + @param greenSourceName: Colour Channels are identified by a system and data-dependent character identifier. Contrast enhancement may be applied to each channel in isolation. + @param opacity: Specifies the level of translucency to use when rendering the Graphic. The value is encoded as a floating-point value between 0.0 and 1.0 with 0.0 representing completely transparent and 1.0 representing completely opaque, with a linear scale of translucency for intermediate values. The default value is 1.0. + @param reliefFactor: The ReliefFactor gives the amount of exaggeration to use for the height of the 'hills'. A value of around 55 (times) gives reasonable results for Earth-based DEMs. The default value is system-dependent. + @param redSourcename: Colour Channels are identified by a system and data-dependent character identifier. Contrast enhancement may be applied to each channel in isolation. + @param overlapbehaviour: Tells a system how to behave when multiple raster images in a layer overlap each other, for example with satellite-image scenes. + @param brighnessOnly: If the BrightnessOnly flag is 0 (false, default), the shading is applied to the layer being rendered as the current RasterSymbol. If BrightnessOnly is 1 (true), the shading is applied to the brightness of the colors in the rendering canvas generated so far by other layers, with the effect of relief-shading these other layers. + @param blueSourcename: Colour Channels are identified by a system and data-dependent character identifier. Contrast enhancement may be applied to each channel in isolation. + @param GmlDiagramObject: + """ + #: A single colour channel may be selected to display in grayscale. Colour Channels are identified by a system and data-dependent character identifier. Contrast enhancement may be applied to each channel in isolation. + self.graySourcename = graySourcename + + #: Colour Channels are identified by a system and data-dependent character identifier. Contrast enhancement may be applied to each channel in isolation. + self.greenSourceName = greenSourceName + + #: Specifies the level of translucency to use when rendering the Graphic. The value is encoded as a floating-point value between 0.0 and 1.0 with 0.0 representing completely transparent and 1.0 representing completely opaque, with a linear scale of translucency for intermediate values. The default value is 1.0. + self.opacity = opacity + + #: The ReliefFactor gives the amount of exaggeration to use for the height of the 'hills'. A value of around 55 (times) gives reasonable results for Earth-based DEMs. The default value is system-dependent. + self.reliefFactor = reliefFactor + + #: Colour Channels are identified by a system and data-dependent character identifier. Contrast enhancement may be applied to each channel in isolation. + self.redSourcename = redSourcename + + #: Tells a system how to behave when multiple raster images in a layer overlap each other, for example with satellite-image scenes. + self.overlapbehaviour = overlapbehaviour + + #: If the BrightnessOnly flag is 0 (false, default), the shading is applied to the layer being rendered as the current RasterSymbol. If BrightnessOnly is 1 (true), the shading is applied to the brightness of the colors in the rendering canvas generated so far by other layers, with the effect of relief-shading these other layers. + self.brighnessOnly = brighnessOnly + + #: Colour Channels are identified by a system and data-dependent character identifier. Contrast enhancement may be applied to each channel in isolation. + self.blueSourcename = blueSourcename + + self._GmlDiagramObject = None + self.GmlDiagramObject = GmlDiagramObject + + super(GmlRasterSymbol, self).__init__(*args, **kw_args) + + _attrs = ["graySourcename", "greenSourceName", "opacity", "reliefFactor", "redSourcename", "overlapbehaviour", "brighnessOnly", "blueSourcename"] + _attr_types = {"graySourcename": str, "greenSourceName": str, "opacity": float, "reliefFactor": str, "redSourcename": str, "overlapbehaviour": str, "brighnessOnly": bool, "blueSourcename": str} + _defaults = {"graySourcename": '', "greenSourceName": '', "opacity": 0.0, "reliefFactor": '', "redSourcename": '', "overlapbehaviour": '', "brighnessOnly": False, "blueSourcename": ''} + _enums = {} + _refs = ["GmlDiagramObject"] + _many_refs = [] + + def getGmlDiagramObject(self): + + return self._GmlDiagramObject + + def setGmlDiagramObject(self, value): + if self._GmlDiagramObject is not None: + filtered = [x for x in self.GmlDiagramObject.GmlRasterSymbols if x != self] + self._GmlDiagramObject._GmlRasterSymbols = filtered + + self._GmlDiagramObject = value + if self._GmlDiagramObject is not None: + if self not in self._GmlDiagramObject._GmlRasterSymbols: + self._GmlDiagramObject._GmlRasterSymbols.append(self) + + GmlDiagramObject = property(getGmlDiagramObject, setGmlDiagramObject) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlSelector.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlSelector.py new file mode 100755 index 00000000..51a9d409 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlSelector.py @@ -0,0 +1,95 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlSelector(IdentifiedObject): + """A diagram element that allows selection by a user, i.e. as 'hyperNode' for navigating between diagrams, or as composite object representing multiple grouped objects.A diagram element that allows selection by a user, i.e. as 'hyperNode' for navigating between diagrams, or as composite object representing multiple grouped objects. + """ + + def __init__(self, ChangeItems=None, GmlDiagramObjects=None, *args, **kw_args): + """Initialises a new 'GmlSelector' instance. + + @param ChangeItems: + @param GmlDiagramObjects: + """ + self._ChangeItems = [] + self.ChangeItems = [] if ChangeItems is None else ChangeItems + + self._GmlDiagramObjects = [] + self.GmlDiagramObjects = [] if GmlDiagramObjects is None else GmlDiagramObjects + + super(GmlSelector, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ChangeItems", "GmlDiagramObjects"] + _many_refs = ["ChangeItems", "GmlDiagramObjects"] + + def getChangeItems(self): + + return self._ChangeItems + + def setChangeItems(self, value): + for x in self._ChangeItems: + x.GmlSelector = None + for y in value: + y._GmlSelector = self + self._ChangeItems = value + + ChangeItems = property(getChangeItems, setChangeItems) + + def addChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.GmlSelector = self + + def removeChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.GmlSelector = None + + def getGmlDiagramObjects(self): + + return self._GmlDiagramObjects + + def setGmlDiagramObjects(self, value): + for p in self._GmlDiagramObjects: + filtered = [q for q in p.GmlSelectors if q != self] + self._GmlDiagramObjects._GmlSelectors = filtered + for r in value: + if self not in r._GmlSelectors: + r._GmlSelectors.append(self) + self._GmlDiagramObjects = value + + GmlDiagramObjects = property(getGmlDiagramObjects, setGmlDiagramObjects) + + def addGmlDiagramObjects(self, *GmlDiagramObjects): + for obj in GmlDiagramObjects: + if self not in obj._GmlSelectors: + obj._GmlSelectors.append(self) + self._GmlDiagramObjects.append(obj) + + def removeGmlDiagramObjects(self, *GmlDiagramObjects): + for obj in GmlDiagramObjects: + if self in obj._GmlSelectors: + obj._GmlSelectors.remove(self) + self._GmlDiagramObjects.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlStroke.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlStroke.py new file mode 100755 index 00000000..117f3513 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlStroke.py @@ -0,0 +1,199 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlStroke(IdentifiedObject): + """The element encapsulating the graphical symbolization parameters for linear geometries.The element encapsulating the graphical symbolization parameters for linear geometries. + """ + + def __init__(self, lineCap='', width=0.0, linejoin='', dashArray='', lineStyle='', dashOffset='', opacity=0.0, GmlColour=None, GmlPolygonSymbols=None, GmlMarks=None, GmlSvgParameters=None, GmlLineSymbols=None, *args, **kw_args): + """Initialises a new 'GmlStroke' instance. + + @param lineCap: Enumerated values telling how line strings should be capped (at the two ends of the line string). The values are represented as content strings. The allowed values for line cap are 'butt', 'round', and 'square'. The default values are system-dependent. + @param width: The absolute width (thickness) of a stroke in pixels encoded as a float. The default is 1.0. Fractional numbers are allowed (with a system-dependent interpretation) but negative numbers are not. + @param linejoin: Enumerated values telling how line strings should be joined (between line segments). The values are represented as content strings. The allowed values for line join are 'mitre', 'round', and 'bevel'. The default values are system-dependent. + @param dashArray: Encodes a dash pattern as a series of space separated floats. The first number gives the length in pixels of dash to draw, the second gives the amount of space to leave, and this pattern repeats. If an odd number of values is given, then the pattern is expanded by repeating it twice to give an even number of values. Decimal values have a system-dependent interpretation (usually depending on whether antialiasing is being used). The default is to draw an unbroken line. + @param lineStyle: The name of a defined line style. Usually will be an enumerated value and will be system-specific. + @param dashOffset: Specifies the distance as a float into the 'stroke-dasharray' pattern at which to start drawing. + @param opacity: Specifies the level of translucency to use when rendering the stroke. The value is encoded as a floating-point value between 0.0 and 1.0 with 0.0 representing completely transparent and 1.0 representing completely opaque, with a linear scale of translucency for intermediate values. The default value is 1.0 + @param GmlColour: + @param GmlPolygonSymbols: + @param GmlMarks: + @param GmlSvgParameters: + @param GmlLineSymbols: + """ + #: Enumerated values telling how line strings should be capped (at the two ends of the line string). The values are represented as content strings. The allowed values for line cap are 'butt', 'round', and 'square'. The default values are system-dependent. + self.lineCap = lineCap + + #: The absolute width (thickness) of a stroke in pixels encoded as a float. The default is 1.0. Fractional numbers are allowed (with a system-dependent interpretation) but negative numbers are not. + self.width = width + + #: Enumerated values telling how line strings should be joined (between line segments). The values are represented as content strings. The allowed values for line join are 'mitre', 'round', and 'bevel'. The default values are system-dependent. + self.linejoin = linejoin + + #: Encodes a dash pattern as a series of space separated floats. The first number gives the length in pixels of dash to draw, the second gives the amount of space to leave, and this pattern repeats. If an odd number of values is given, then the pattern is expanded by repeating it twice to give an even number of values. Decimal values have a system-dependent interpretation (usually depending on whether antialiasing is being used). The default is to draw an unbroken line. + self.dashArray = dashArray + + #: The name of a defined line style. Usually will be an enumerated value and will be system-specific. + self.lineStyle = lineStyle + + #: Specifies the distance as a float into the 'stroke-dasharray' pattern at which to start drawing. + self.dashOffset = dashOffset + + #: Specifies the level of translucency to use when rendering the stroke. The value is encoded as a floating-point value between 0.0 and 1.0 with 0.0 representing completely transparent and 1.0 representing completely opaque, with a linear scale of translucency for intermediate values. The default value is 1.0 + self.opacity = opacity + + self._GmlColour = None + self.GmlColour = GmlColour + + self._GmlPolygonSymbols = [] + self.GmlPolygonSymbols = [] if GmlPolygonSymbols is None else GmlPolygonSymbols + + self._GmlMarks = [] + self.GmlMarks = [] if GmlMarks is None else GmlMarks + + self._GmlSvgParameters = [] + self.GmlSvgParameters = [] if GmlSvgParameters is None else GmlSvgParameters + + self._GmlLineSymbols = [] + self.GmlLineSymbols = [] if GmlLineSymbols is None else GmlLineSymbols + + super(GmlStroke, self).__init__(*args, **kw_args) + + _attrs = ["lineCap", "width", "linejoin", "dashArray", "lineStyle", "dashOffset", "opacity"] + _attr_types = {"lineCap": str, "width": float, "linejoin": str, "dashArray": str, "lineStyle": str, "dashOffset": str, "opacity": float} + _defaults = {"lineCap": '', "width": 0.0, "linejoin": '', "dashArray": '', "lineStyle": '', "dashOffset": '', "opacity": 0.0} + _enums = {} + _refs = ["GmlColour", "GmlPolygonSymbols", "GmlMarks", "GmlSvgParameters", "GmlLineSymbols"] + _many_refs = ["GmlPolygonSymbols", "GmlMarks", "GmlSvgParameters", "GmlLineSymbols"] + + def getGmlColour(self): + + return self._GmlColour + + def setGmlColour(self, value): + if self._GmlColour is not None: + filtered = [x for x in self.GmlColour.GmlStrokes if x != self] + self._GmlColour._GmlStrokes = filtered + + self._GmlColour = value + if self._GmlColour is not None: + if self not in self._GmlColour._GmlStrokes: + self._GmlColour._GmlStrokes.append(self) + + GmlColour = property(getGmlColour, setGmlColour) + + def getGmlPolygonSymbols(self): + + return self._GmlPolygonSymbols + + def setGmlPolygonSymbols(self, value): + for x in self._GmlPolygonSymbols: + x.GmlStroke = None + for y in value: + y._GmlStroke = self + self._GmlPolygonSymbols = value + + GmlPolygonSymbols = property(getGmlPolygonSymbols, setGmlPolygonSymbols) + + def addGmlPolygonSymbols(self, *GmlPolygonSymbols): + for obj in GmlPolygonSymbols: + obj.GmlStroke = self + + def removeGmlPolygonSymbols(self, *GmlPolygonSymbols): + for obj in GmlPolygonSymbols: + obj.GmlStroke = None + + def getGmlMarks(self): + + return self._GmlMarks + + def setGmlMarks(self, value): + for p in self._GmlMarks: + filtered = [q for q in p.GmlStrokes if q != self] + self._GmlMarks._GmlStrokes = filtered + for r in value: + if self not in r._GmlStrokes: + r._GmlStrokes.append(self) + self._GmlMarks = value + + GmlMarks = property(getGmlMarks, setGmlMarks) + + def addGmlMarks(self, *GmlMarks): + for obj in GmlMarks: + if self not in obj._GmlStrokes: + obj._GmlStrokes.append(self) + self._GmlMarks.append(obj) + + def removeGmlMarks(self, *GmlMarks): + for obj in GmlMarks: + if self in obj._GmlStrokes: + obj._GmlStrokes.remove(self) + self._GmlMarks.remove(obj) + + def getGmlSvgParameters(self): + + return self._GmlSvgParameters + + def setGmlSvgParameters(self, value): + for p in self._GmlSvgParameters: + filtered = [q for q in p.GmlStokes if q != self] + self._GmlSvgParameters._GmlStokes = filtered + for r in value: + if self not in r._GmlStokes: + r._GmlStokes.append(self) + self._GmlSvgParameters = value + + GmlSvgParameters = property(getGmlSvgParameters, setGmlSvgParameters) + + def addGmlSvgParameters(self, *GmlSvgParameters): + for obj in GmlSvgParameters: + if self not in obj._GmlStokes: + obj._GmlStokes.append(self) + self._GmlSvgParameters.append(obj) + + def removeGmlSvgParameters(self, *GmlSvgParameters): + for obj in GmlSvgParameters: + if self in obj._GmlStokes: + obj._GmlStokes.remove(self) + self._GmlSvgParameters.remove(obj) + + def getGmlLineSymbols(self): + + return self._GmlLineSymbols + + def setGmlLineSymbols(self, value): + for x in self._GmlLineSymbols: + x.GmlStroke = None + for y in value: + y._GmlStroke = self + self._GmlLineSymbols = value + + GmlLineSymbols = property(getGmlLineSymbols, setGmlLineSymbols) + + def addGmlLineSymbols(self, *GmlLineSymbols): + for obj in GmlLineSymbols: + obj.GmlStroke = self + + def removeGmlLineSymbols(self, *GmlLineSymbols): + for obj in GmlLineSymbols: + obj.GmlStroke = None + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlSvgParameter.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlSvgParameter.py new file mode 100755 index 00000000..72486b89 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlSvgParameter.py @@ -0,0 +1,140 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlSvgParameter(IdentifiedObject): + """Refers to an SVG/CSS graphical-formatting parameter. The parameter is identified using the 'name' attribute and the content of the element gives the SVG/CSS-coded value.Refers to an SVG/CSS graphical-formatting parameter. The parameter is identified using the 'name' attribute and the content of the element gives the SVG/CSS-coded value. + """ + + def __init__(self, attribute='', value='', GmlStokes=None, GmlFonts=None, GmlFills=None, *args, **kw_args): + """Initialises a new 'GmlSvgParameter' instance. + + @param attribute: The attribute of the GmlSvgParameter. E.g., for 'Stroke', the following SvgParameters may be used: 'stroke' (color), 'stroke-opacity', 'stroke-width', 'stroke-linejoin', 'stroke-linecap', 'stroke-dasharray', and 'stroke-dashoffset'. Others are not officially supported. + @param value: The SVG/CSS-coded value of the associated SvgAttribute. + @param GmlStokes: + @param GmlFonts: + @param GmlFills: + """ + #: The attribute of the GmlSvgParameter. E.g., for 'Stroke', the following SvgParameters may be used: 'stroke' (color), 'stroke-opacity', 'stroke-width', 'stroke-linejoin', 'stroke-linecap', 'stroke-dasharray', and 'stroke-dashoffset'. Others are not officially supported. + self.attribute = attribute + + #: The SVG/CSS-coded value of the associated SvgAttribute. + self.value = value + + self._GmlStokes = [] + self.GmlStokes = [] if GmlStokes is None else GmlStokes + + self._GmlFonts = [] + self.GmlFonts = [] if GmlFonts is None else GmlFonts + + self._GmlFills = [] + self.GmlFills = [] if GmlFills is None else GmlFills + + super(GmlSvgParameter, self).__init__(*args, **kw_args) + + _attrs = ["attribute", "value"] + _attr_types = {"attribute": str, "value": str} + _defaults = {"attribute": '', "value": ''} + _enums = {} + _refs = ["GmlStokes", "GmlFonts", "GmlFills"] + _many_refs = ["GmlStokes", "GmlFonts", "GmlFills"] + + def getGmlStokes(self): + + return self._GmlStokes + + def setGmlStokes(self, value): + for p in self._GmlStokes: + filtered = [q for q in p.GmlSvgParameters if q != self] + self._GmlStokes._GmlSvgParameters = filtered + for r in value: + if self not in r._GmlSvgParameters: + r._GmlSvgParameters.append(self) + self._GmlStokes = value + + GmlStokes = property(getGmlStokes, setGmlStokes) + + def addGmlStokes(self, *GmlStokes): + for obj in GmlStokes: + if self not in obj._GmlSvgParameters: + obj._GmlSvgParameters.append(self) + self._GmlStokes.append(obj) + + def removeGmlStokes(self, *GmlStokes): + for obj in GmlStokes: + if self in obj._GmlSvgParameters: + obj._GmlSvgParameters.remove(self) + self._GmlStokes.remove(obj) + + def getGmlFonts(self): + + return self._GmlFonts + + def setGmlFonts(self, value): + for p in self._GmlFonts: + filtered = [q for q in p.GmlSvgParameters if q != self] + self._GmlFonts._GmlSvgParameters = filtered + for r in value: + if self not in r._GmlSvgParameters: + r._GmlSvgParameters.append(self) + self._GmlFonts = value + + GmlFonts = property(getGmlFonts, setGmlFonts) + + def addGmlFonts(self, *GmlFonts): + for obj in GmlFonts: + if self not in obj._GmlSvgParameters: + obj._GmlSvgParameters.append(self) + self._GmlFonts.append(obj) + + def removeGmlFonts(self, *GmlFonts): + for obj in GmlFonts: + if self in obj._GmlSvgParameters: + obj._GmlSvgParameters.remove(self) + self._GmlFonts.remove(obj) + + def getGmlFills(self): + + return self._GmlFills + + def setGmlFills(self, value): + for p in self._GmlFills: + filtered = [q for q in p.GmlSvgParameters if q != self] + self._GmlFills._GmlSvgParameters = filtered + for r in value: + if self not in r._GmlSvgParameters: + r._GmlSvgParameters.append(self) + self._GmlFills = value + + GmlFills = property(getGmlFills, setGmlFills) + + def addGmlFills(self, *GmlFills): + for obj in GmlFills: + if self not in obj._GmlSvgParameters: + obj._GmlSvgParameters.append(self) + self._GmlFills.append(obj) + + def removeGmlFills(self, *GmlFills): + for obj in GmlFills: + if self in obj._GmlSvgParameters: + obj._GmlSvgParameters.remove(self) + self._GmlFills.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlSymbol.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlSymbol.py new file mode 100755 index 00000000..1c473885 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlSymbol.py @@ -0,0 +1,102 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlSymbol(IdentifiedObject): + """Describes how a feature is to appear on a map or display. The symbol describes not just the shape that should appear but also such graphical properties as color and opacity.Describes how a feature is to appear on a map or display. The symbol describes not just the shape that should appear but also such graphical properties as color and opacity. + """ + + def __init__(self, version='', level='', type='', GmlFeatureStyles=None, GmlBaseSymbol=None, *args, **kw_args): + """Initialises a new 'GmlSymbol' instance. + + @param version: The version of the Symbol. + @param level: The level (of the map) where the symbol exists or the zoom levels at which this diagram object is displayed. As a way of de-cluttering displays, for example, some symbols and annotations are only shown when zoomed in. + @param type: The Symbol type. + @param GmlFeatureStyles: + @param GmlBaseSymbol: + """ + #: The version of the Symbol. + self.version = version + + #: The level (of the map) where the symbol exists or the zoom levels at which this diagram object is displayed. As a way of de-cluttering displays, for example, some symbols and annotations are only shown when zoomed in. + self.level = level + + #: The Symbol type. + self.type = type + + self._GmlFeatureStyles = [] + self.GmlFeatureStyles = [] if GmlFeatureStyles is None else GmlFeatureStyles + + self._GmlBaseSymbol = None + self.GmlBaseSymbol = GmlBaseSymbol + + super(GmlSymbol, self).__init__(*args, **kw_args) + + _attrs = ["version", "level", "type"] + _attr_types = {"version": str, "level": str, "type": str} + _defaults = {"version": '', "level": '', "type": ''} + _enums = {} + _refs = ["GmlFeatureStyles", "GmlBaseSymbol"] + _many_refs = ["GmlFeatureStyles"] + + def getGmlFeatureStyles(self): + + return self._GmlFeatureStyles + + def setGmlFeatureStyles(self, value): + for p in self._GmlFeatureStyles: + filtered = [q for q in p.GmlSymbols if q != self] + self._GmlFeatureStyles._GmlSymbols = filtered + for r in value: + if self not in r._GmlSymbols: + r._GmlSymbols.append(self) + self._GmlFeatureStyles = value + + GmlFeatureStyles = property(getGmlFeatureStyles, setGmlFeatureStyles) + + def addGmlFeatureStyles(self, *GmlFeatureStyles): + for obj in GmlFeatureStyles: + if self not in obj._GmlSymbols: + obj._GmlSymbols.append(self) + self._GmlFeatureStyles.append(obj) + + def removeGmlFeatureStyles(self, *GmlFeatureStyles): + for obj in GmlFeatureStyles: + if self in obj._GmlSymbols: + obj._GmlSymbols.remove(self) + self._GmlFeatureStyles.remove(obj) + + def getGmlBaseSymbol(self): + + return self._GmlBaseSymbol + + def setGmlBaseSymbol(self, value): + if self._GmlBaseSymbol is not None: + filtered = [x for x in self.GmlBaseSymbol.GmlSymbols if x != self] + self._GmlBaseSymbol._GmlSymbols = filtered + + self._GmlBaseSymbol = value + if self._GmlBaseSymbol is not None: + if self not in self._GmlBaseSymbol._GmlSymbols: + self._GmlBaseSymbol._GmlSymbols.append(self) + + GmlBaseSymbol = property(getGmlBaseSymbol, setGmlBaseSymbol) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlTextSymbol.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlTextSymbol.py new file mode 100755 index 00000000..696fae6b --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlTextSymbol.py @@ -0,0 +1,159 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfGMLSupport.GmlSymbol import GmlSymbol + +class GmlTextSymbol(GmlSymbol): + """Used for styling text labels, i.e., for rendering them according to various graphical parameters.Used for styling text labels, i.e., for rendering them according to various graphical parameters. + """ + + def __init__(self, label='', labelType='', fieldID='', minFontSize=0, property='', GmlFill=None, GmlLabelPlacement=None, GmlHalo=None, GmlFont=None, GmlDiagramObject=None, *args, **kw_args): + """Initialises a new 'GmlTextSymbol' instance. + + @param label: Text-label content. If the value is not provided, then no text will be rendered. + @param labelType: The type-classification of a label. + @param fieldID: The name of the field of the class being annotated. Most objects will include name, description, and aliasName. Many objects may contain other fields such as comment, status, etc. + @param minFontSize: The minimum font size allowed. + @param property: Generic method for capturing all unspecified information pertaining to the TextSymbol. + @param GmlFill: + @param GmlLabelPlacement: + @param GmlHalo: + @param GmlFont: + @param GmlDiagramObject: + """ + #: Text-label content. If the value is not provided, then no text will be rendered. + self.label = label + + #: The type-classification of a label. + self.labelType = labelType + + #: The name of the field of the class being annotated. Most objects will include name, description, and aliasName. Many objects may contain other fields such as comment, status, etc. + self.fieldID = fieldID + + #: The minimum font size allowed. + self.minFontSize = minFontSize + + #: Generic method for capturing all unspecified information pertaining to the TextSymbol. + self.property = property + + self._GmlFill = None + self.GmlFill = GmlFill + + self._GmlLabelPlacement = None + self.GmlLabelPlacement = GmlLabelPlacement + + self._GmlHalo = None + self.GmlHalo = GmlHalo + + self._GmlFont = None + self.GmlFont = GmlFont + + self._GmlDiagramObject = None + self.GmlDiagramObject = GmlDiagramObject + + super(GmlTextSymbol, self).__init__(*args, **kw_args) + + _attrs = ["label", "labelType", "fieldID", "minFontSize", "property"] + _attr_types = {"label": str, "labelType": str, "fieldID": str, "minFontSize": int, "property": str} + _defaults = {"label": '', "labelType": '', "fieldID": '', "minFontSize": 0, "property": ''} + _enums = {} + _refs = ["GmlFill", "GmlLabelPlacement", "GmlHalo", "GmlFont", "GmlDiagramObject"] + _many_refs = [] + + def getGmlFill(self): + + return self._GmlFill + + def setGmlFill(self, value): + if self._GmlFill is not None: + filtered = [x for x in self.GmlFill.GmlTextSymbols if x != self] + self._GmlFill._GmlTextSymbols = filtered + + self._GmlFill = value + if self._GmlFill is not None: + if self not in self._GmlFill._GmlTextSymbols: + self._GmlFill._GmlTextSymbols.append(self) + + GmlFill = property(getGmlFill, setGmlFill) + + def getGmlLabelPlacement(self): + + return self._GmlLabelPlacement + + def setGmlLabelPlacement(self, value): + if self._GmlLabelPlacement is not None: + filtered = [x for x in self.GmlLabelPlacement.GmlTextSymbols if x != self] + self._GmlLabelPlacement._GmlTextSymbols = filtered + + self._GmlLabelPlacement = value + if self._GmlLabelPlacement is not None: + if self not in self._GmlLabelPlacement._GmlTextSymbols: + self._GmlLabelPlacement._GmlTextSymbols.append(self) + + GmlLabelPlacement = property(getGmlLabelPlacement, setGmlLabelPlacement) + + def getGmlHalo(self): + + return self._GmlHalo + + def setGmlHalo(self, value): + if self._GmlHalo is not None: + filtered = [x for x in self.GmlHalo.GmlTextSymbols if x != self] + self._GmlHalo._GmlTextSymbols = filtered + + self._GmlHalo = value + if self._GmlHalo is not None: + if self not in self._GmlHalo._GmlTextSymbols: + self._GmlHalo._GmlTextSymbols.append(self) + + GmlHalo = property(getGmlHalo, setGmlHalo) + + def getGmlFont(self): + + return self._GmlFont + + def setGmlFont(self, value): + if self._GmlFont is not None: + filtered = [x for x in self.GmlFont.GmlTextSymbols if x != self] + self._GmlFont._GmlTextSymbols = filtered + + self._GmlFont = value + if self._GmlFont is not None: + if self not in self._GmlFont._GmlTextSymbols: + self._GmlFont._GmlTextSymbols.append(self) + + GmlFont = property(getGmlFont, setGmlFont) + + def getGmlDiagramObject(self): + + return self._GmlDiagramObject + + def setGmlDiagramObject(self, value): + if self._GmlDiagramObject is not None: + filtered = [x for x in self.GmlDiagramObject.GmlTextSymbols if x != self] + self._GmlDiagramObject._GmlTextSymbols = filtered + + self._GmlDiagramObject = value + if self._GmlDiagramObject is not None: + if self not in self._GmlDiagramObject._GmlTextSymbols: + self._GmlDiagramObject._GmlTextSymbols.append(self) + + GmlDiagramObject = property(getGmlDiagramObject, setGmlDiagramObject) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlTopologyStyle.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlTopologyStyle.py new file mode 100755 index 00000000..3c4a9824 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlTopologyStyle.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlTopologyStyle(IdentifiedObject): + """The style for one topology property. Similarly to the Geometry style, a feature can have multiple topology properties, thus multiple topology style descriptors can be specified within one feature style.The style for one topology property. Similarly to the Geometry style, a feature can have multiple topology properties, thus multiple topology style descriptors can be specified within one feature style. + """ + + def __init__(self, GmlLableStyle=None, GmlFeatureStyle=None, *args, **kw_args): + """Initialises a new 'GmlTopologyStyle' instance. + + @param GmlLableStyle: + @param GmlFeatureStyle: + """ + self._GmlLableStyle = None + self.GmlLableStyle = GmlLableStyle + + self._GmlFeatureStyle = None + self.GmlFeatureStyle = GmlFeatureStyle + + super(GmlTopologyStyle, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["GmlLableStyle", "GmlFeatureStyle"] + _many_refs = [] + + def getGmlLableStyle(self): + + return self._GmlLableStyle + + def setGmlLableStyle(self, value): + if self._GmlLableStyle is not None: + filtered = [x for x in self.GmlLableStyle.GmlTopologyStyles if x != self] + self._GmlLableStyle._GmlTopologyStyles = filtered + + self._GmlLableStyle = value + if self._GmlLableStyle is not None: + if self not in self._GmlLableStyle._GmlTopologyStyles: + self._GmlLableStyle._GmlTopologyStyles.append(self) + + GmlLableStyle = property(getGmlLableStyle, setGmlLableStyle) + + def getGmlFeatureStyle(self): + + return self._GmlFeatureStyle + + def setGmlFeatureStyle(self, value): + if self._GmlFeatureStyle is not None: + filtered = [x for x in self.GmlFeatureStyle.GmlTobologyStyles if x != self] + self._GmlFeatureStyle._GmlTobologyStyles = filtered + + self._GmlFeatureStyle = value + if self._GmlFeatureStyle is not None: + if self not in self._GmlFeatureStyle._GmlTobologyStyles: + self._GmlFeatureStyle._GmlTobologyStyles.append(self) + + GmlFeatureStyle = property(getGmlFeatureStyle, setGmlFeatureStyle) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/GmlValue.py b/CIM16/IEC61970/Informative/InfGMLSupport/GmlValue.py new file mode 100755 index 00000000..eadda3a8 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/GmlValue.py @@ -0,0 +1,91 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GmlValue(IdentifiedObject): + """Used for direct representation of values.Used for direct representation of values. + """ + + def __init__(self, dateTime='', timePeriod='', value=0.0, GmlObservation=None, MeasurementValue=None, *args, **kw_args): + """Initialises a new 'GmlValue' instance. + + @param dateTime: + @param timePeriod: + @param value: + @param GmlObservation: + @param MeasurementValue: + """ + + self.dateTime = dateTime + + + self.timePeriod = timePeriod + + + self.value = value + + self._GmlObservation = None + self.GmlObservation = GmlObservation + + self._MeasurementValue = None + self.MeasurementValue = MeasurementValue + + super(GmlValue, self).__init__(*args, **kw_args) + + _attrs = ["dateTime", "timePeriod", "value"] + _attr_types = {"dateTime": str, "timePeriod": str, "value": float} + _defaults = {"dateTime": '', "timePeriod": '', "value": 0.0} + _enums = {} + _refs = ["GmlObservation", "MeasurementValue"] + _many_refs = [] + + def getGmlObservation(self): + + return self._GmlObservation + + def setGmlObservation(self, value): + if self._GmlObservation is not None: + filtered = [x for x in self.GmlObservation.GmlValues if x != self] + self._GmlObservation._GmlValues = filtered + + self._GmlObservation = value + if self._GmlObservation is not None: + if self not in self._GmlObservation._GmlValues: + self._GmlObservation._GmlValues.append(self) + + GmlObservation = property(getGmlObservation, setGmlObservation) + + def getMeasurementValue(self): + + return self._MeasurementValue + + def setMeasurementValue(self, value): + if self._MeasurementValue is not None: + filtered = [x for x in self.MeasurementValue.GmlValues if x != self] + self._MeasurementValue._GmlValues = filtered + + self._MeasurementValue = value + if self._MeasurementValue is not None: + if self not in self._MeasurementValue._GmlValues: + self._MeasurementValue._GmlValues.append(self) + + MeasurementValue = property(getMeasurementValue, setMeasurementValue) + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/Map.py b/CIM16/IEC61970/Informative/InfGMLSupport/Map.py new file mode 100755 index 00000000..be94a69d --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/Map.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfGMLSupport.Diagram import Diagram + +class Map(Diagram): + """A type of diagram that is usually printed on paper. It normally depicts part of the earth's surface, showing utility assets, right of ways, topological data, coordinates, grids, etc. Maps vary depending on whether they are used for dispatch, design, schematic, etc.A type of diagram that is usually printed on paper. It normally depicts part of the earth's surface, showing utility assets, right of ways, topological data, coordinates, grids, etc. Maps vary depending on whether they are used for dispatch, design, schematic, etc. + """ + + def __init__(self, pageNumber=0, mapLocGrid='', *args, **kw_args): + """Initialises a new 'Map' instance. + + @param pageNumber: Page number for particular set of maps specified by 'category'. + @param mapLocGrid: Map grid number. + """ + #: Page number for particular set of maps specified by 'category'. + self.pageNumber = pageNumber + + #: Map grid number. + self.mapLocGrid = mapLocGrid + + super(Map, self).__init__(*args, **kw_args) + + _attrs = ["pageNumber", "mapLocGrid"] + _attr_types = {"pageNumber": int, "mapLocGrid": str} + _defaults = {"pageNumber": 0, "mapLocGrid": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfGMLSupport/__init__.py b/CIM16/IEC61970/Informative/InfGMLSupport/__init__.py new file mode 100755 index 00000000..6bd7a05d --- /dev/null +++ b/CIM16/IEC61970/Informative/InfGMLSupport/__init__.py @@ -0,0 +1,68 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The package contains portions of the model defined by graphic standards such as those proposed by OpenGIS Consortium referred to as the Geography Markup Language (GML). It facilitates integration among electric utility applications (CIM) and Geographical Information Systems (GIS) and other applications. Rather than inventing new CIM classes that accomplish similar functionality as in existing GML, the preferred approach is to use and extend 'Gml' classes as appropriate. Note that care has been taken to separate the geometry of features from how features can be graphically represented. GML supports the concept of a geographic feature, which is 'an abstraction of a real world phenomenon; it is a geographic feature if it is associated with a location relative to the Earth'. So a digital representation of the real world can be thought of as a set of features. The state of a feature is defined by a set of properties, where each property can be thought of as a {name, type, value} triple. The number of properties a feature may have, together with their names and types, are determined by its type definition. Geographic features with geometry are those with properties that may be geometry-valued. TODO: The following has been copied from a very old version of draft Part 11, so the references are wrong, but we store the knowledge here to reuse later: 'A Geographic Feature is 'an abstraction of a real world phenomenon; it is a geographic feature if it can is asociated with a location relative to the Earth. A digital representation of the real world can be thought of as a set of features. He state of a feature is defined by a set of properties, whre each property can be thought of as a (name, type, value) triple. The number of propoerties a feature may have, together with their names and types, are determined by its type definition. Geographic features with geometry are those with properties tht may be geometry-valued. Geographic features in GML include coverages and observations as subtypes. A coverage is a type of feature that has a coverage function with a spatial domain and a value set range of homogeneous 2 to n dimensional tuples. A coverage can represent one feature or a collection of features 'to model and make visible spatial relationships between, and the spatial distribution of, earth phenomena.' A reference system provides a scale of measurement for assigning values to a location, time or other descriptive quantity or quality. A coordinate reference system consists of set of coordinate system axes that are related to the earth through a datum that defines the size and shape of the earth. Geometries in GML indicate the coordinate reference system in which the measurements have ben made. The 'parent' geometry element of a geometric complex or geometric aggregate makes this indication for its constituent geometries.' +""" + +from CIM16.IEC61970.Informative.InfGMLSupport.GmlFeatureType import GmlFeatureType +from CIM16.IEC61970.Informative.InfGMLSupport.Map import Map +from CIM16.IEC61970.Informative.InfGMLSupport.GmlPointGeometry import GmlPointGeometry +from CIM16.IEC61970.Informative.InfGMLSupport.GmlHalo import GmlHalo +from CIM16.IEC61970.Informative.InfGMLSupport.GmlColour import GmlColour +from CIM16.IEC61970.Informative.InfGMLSupport.GmlFont import GmlFont +from CIM16.IEC61970.Informative.InfGMLSupport.GmlPolygonSymbol import GmlPolygonSymbol +from CIM16.IEC61970.Informative.InfGMLSupport.GmlStroke import GmlStroke +from CIM16.IEC61970.Informative.InfGMLSupport.GmlBaseSymbol import GmlBaseSymbol +from CIM16.IEC61970.Informative.InfGMLSupport.GmlPosition import GmlPosition +from CIM16.IEC61970.Informative.InfGMLSupport.GmlTextSymbol import GmlTextSymbol +from CIM16.IEC61970.Informative.InfGMLSupport.GmlPolygonGeometry import GmlPolygonGeometry +from CIM16.IEC61970.Informative.InfGMLSupport.GmlObservation import GmlObservation +from CIM16.IEC61970.Informative.InfGMLSupport.GmlMark import GmlMark +from CIM16.IEC61970.Informative.InfGMLSupport.GmlGraphic import GmlGraphic +from CIM16.IEC61970.Informative.InfGMLSupport.GmlLabelPlacement import GmlLabelPlacement +from CIM16.IEC61970.Informative.InfGMLSupport.GmlGeometryStyle import GmlGeometryStyle +from CIM16.IEC61970.Informative.InfGMLSupport.GmlLineGeometry import GmlLineGeometry +from CIM16.IEC61970.Informative.InfGMLSupport.GmlValue import GmlValue +from CIM16.IEC61970.Informative.InfGMLSupport.GmlLineSymbol import GmlLineSymbol +from CIM16.IEC61970.Informative.InfGMLSupport.GmlDiagramObject import GmlDiagramObject +from CIM16.IEC61970.Informative.InfGMLSupport.GmlPointSymbol import GmlPointSymbol +from CIM16.IEC61970.Informative.InfGMLSupport.GmlTopologyStyle import GmlTopologyStyle +from CIM16.IEC61970.Informative.InfGMLSupport.GmlSelector import GmlSelector +from CIM16.IEC61970.Informative.InfGMLSupport.GmlSvgParameter import GmlSvgParameter +from CIM16.IEC61970.Informative.InfGMLSupport.GmlLabelStyle import GmlLabelStyle +from CIM16.IEC61970.Informative.InfGMLSupport.GmlFill import GmlFill +from CIM16.IEC61970.Informative.InfGMLSupport.Diagram import Diagram +from CIM16.IEC61970.Informative.InfGMLSupport.GmlSymbol import GmlSymbol +from CIM16.IEC61970.Informative.InfGMLSupport.GmlFeatureStyle import GmlFeatureStyle +from CIM16.IEC61970.Informative.InfGMLSupport.GmlRasterSymbol import GmlRasterSymbol + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#InfGMLSupport" +nsPrefix = "cimInfGMLSupport" + + +class QueryGrammarKind(str): + """Values are: other, xpath, xquery + """ + pass + +class DiagramKind(str): + """Values are: other, geographic, internalView, designSketch, schematic + """ + pass diff --git a/CIM16/IEC61970/Informative/InfLoadControl/LoadLimitFunction.py b/CIM16/IEC61970/Informative/InfLoadControl/LoadLimitFunction.py new file mode 100755 index 00000000..47473f31 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLoadControl/LoadLimitFunction.py @@ -0,0 +1,55 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfLoadControl.LoadMgmtFunction import LoadMgmtFunction + +class LoadLimitFunction(LoadMgmtFunction): + """A kind of LoadMgmtFunction that limits the customer load to a given value.A kind of LoadMgmtFunction that limits the customer load to a given value. + """ + + def __init__(self, disconnectTimeDelay=0.0, isAutoReconOp=False, reconnectTimeDelay=0.0, maximumLoad=0.0, *args, **kw_args): + """Initialises a new 'LoadLimitFunction' instance. + + @param disconnectTimeDelay: From the point when the maximumLoad threshold is crossed there may be a finite delay before the switch actually disconnects the load. Typically this is to buffer against transient load fluctuations. + @param isAutoReconOp: True if the switch will reconnect automatically, otherwise it will reconnect under manual control. + @param reconnectTimeDelay: From the point when the load recovers from an overload condition and crosses the maximumLoad threshold going down, there may be a finite time delay before the switch actually reconnects the load. Typically this is to give overload conditions sufficient time to clear, thus preventing unnecessary load switching activity. + @param maximumLoad: The power level, to which the customer load is being limited when this function activates. When the maximum load is exceeded the switch will typically open to shed the complete customer load. + """ + #: From the point when the maximumLoad threshold is crossed there may be a finite delay before the switch actually disconnects the load. Typically this is to buffer against transient load fluctuations. + self.disconnectTimeDelay = disconnectTimeDelay + + #: True if the switch will reconnect automatically, otherwise it will reconnect under manual control. + self.isAutoReconOp = isAutoReconOp + + #: From the point when the load recovers from an overload condition and crosses the maximumLoad threshold going down, there may be a finite time delay before the switch actually reconnects the load. Typically this is to give overload conditions sufficient time to clear, thus preventing unnecessary load switching activity. + self.reconnectTimeDelay = reconnectTimeDelay + + #: The power level, to which the customer load is being limited when this function activates. When the maximum load is exceeded the switch will typically open to shed the complete customer load. + self.maximumLoad = maximumLoad + + super(LoadLimitFunction, self).__init__(*args, **kw_args) + + _attrs = ["disconnectTimeDelay", "isAutoReconOp", "reconnectTimeDelay", "maximumLoad"] + _attr_types = {"disconnectTimeDelay": float, "isAutoReconOp": bool, "reconnectTimeDelay": float, "maximumLoad": float} + _defaults = {"disconnectTimeDelay": 0.0, "isAutoReconOp": False, "reconnectTimeDelay": 0.0, "maximumLoad": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfLoadControl/LoadMgmtFunction.py b/CIM16/IEC61970/Informative/InfLoadControl/LoadMgmtFunction.py new file mode 100755 index 00000000..97151d22 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLoadControl/LoadMgmtFunction.py @@ -0,0 +1,119 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Metering.EndDeviceFunction import EndDeviceFunction + +class LoadMgmtFunction(EndDeviceFunction): + """A collective function at an end device that manages the customer load.A collective function at an end device that manages the customer load. + """ + + def __init__(self, schedulingBasis="remoteControl", remoteOverRide=False, isAutoOp=False, loadStatus="limitedLoad", manualOverRide=False, overRideTimeOut=0.0, Switches=None, LoadMgmtRecords=None, *args, **kw_args): + """Initialises a new 'LoadMgmtFunction' instance. + + @param schedulingBasis: The basis of Load Management scheduling used here: Time Based, Tariff Based, Remote Control and Manual Control. Values are: "remoteControl", "timeBased", "tariffBased", "manualControl" + @param remoteOverRide: True if the currently active schedule is being remotely over-ridden to either shed load or to limit load. + @param isAutoOp: True if LoadMgmtFunction operates under automatic control, otherwise it operates under manual control. + @param loadStatus: The present state of the load being either shed (noLoad), limited (limitedLoad) or fully connected (fullLoad). This refers only to the portion of the customer load that is under control of the LoadMgmtFunction. Values are: "limitedLoad", "noLoad", "fullLoad" + @param manualOverRide: True if the currently active schedule is being manually over-ridden to either shed load or to limit load. + @param overRideTimeOut: After a command had been received to activate the mannualOverRide state or remoteOverRideState, the normal (halted) schedule will resume after this specified time duration had elapsed. + @param Switches: + @param LoadMgmtRecords: + """ + #: The basis of Load Management scheduling used here: Time Based, Tariff Based, Remote Control and Manual Control. Values are: "remoteControl", "timeBased", "tariffBased", "manualControl" + self.schedulingBasis = schedulingBasis + + #: True if the currently active schedule is being remotely over-ridden to either shed load or to limit load. + self.remoteOverRide = remoteOverRide + + #: True if LoadMgmtFunction operates under automatic control, otherwise it operates under manual control. + self.isAutoOp = isAutoOp + + #: The present state of the load being either shed (noLoad), limited (limitedLoad) or fully connected (fullLoad). This refers only to the portion of the customer load that is under control of the LoadMgmtFunction. Values are: "limitedLoad", "noLoad", "fullLoad" + self.loadStatus = loadStatus + + #: True if the currently active schedule is being manually over-ridden to either shed load or to limit load. + self.manualOverRide = manualOverRide + + #: After a command had been received to activate the mannualOverRide state or remoteOverRideState, the normal (halted) schedule will resume after this specified time duration had elapsed. + self.overRideTimeOut = overRideTimeOut + + self._Switches = [] + self.Switches = [] if Switches is None else Switches + + self._LoadMgmtRecords = [] + self.LoadMgmtRecords = [] if LoadMgmtRecords is None else LoadMgmtRecords + + super(LoadMgmtFunction, self).__init__(*args, **kw_args) + + _attrs = ["schedulingBasis", "remoteOverRide", "isAutoOp", "loadStatus", "manualOverRide", "overRideTimeOut"] + _attr_types = {"schedulingBasis": str, "remoteOverRide": bool, "isAutoOp": bool, "loadStatus": str, "manualOverRide": bool, "overRideTimeOut": float} + _defaults = {"schedulingBasis": "remoteControl", "remoteOverRide": False, "isAutoOp": False, "loadStatus": "limitedLoad", "manualOverRide": False, "overRideTimeOut": 0.0} + _enums = {"schedulingBasis": "LoadMgmtKind", "loadStatus": "LoadStateKind"} + _refs = ["Switches", "LoadMgmtRecords"] + _many_refs = ["Switches", "LoadMgmtRecords"] + + def getSwitches(self): + + return self._Switches + + def setSwitches(self, value): + for p in self._Switches: + filtered = [q for q in p.LoadMgmtFunctions if q != self] + self._Switches._LoadMgmtFunctions = filtered + for r in value: + if self not in r._LoadMgmtFunctions: + r._LoadMgmtFunctions.append(self) + self._Switches = value + + Switches = property(getSwitches, setSwitches) + + def addSwitches(self, *Switches): + for obj in Switches: + if self not in obj._LoadMgmtFunctions: + obj._LoadMgmtFunctions.append(self) + self._Switches.append(obj) + + def removeSwitches(self, *Switches): + for obj in Switches: + if self in obj._LoadMgmtFunctions: + obj._LoadMgmtFunctions.remove(self) + self._Switches.remove(obj) + + def getLoadMgmtRecords(self): + + return self._LoadMgmtRecords + + def setLoadMgmtRecords(self, value): + for x in self._LoadMgmtRecords: + x.LoadMgmtFunction = None + for y in value: + y._LoadMgmtFunction = self + self._LoadMgmtRecords = value + + LoadMgmtRecords = property(getLoadMgmtRecords, setLoadMgmtRecords) + + def addLoadMgmtRecords(self, *LoadMgmtRecords): + for obj in LoadMgmtRecords: + obj.LoadMgmtFunction = self + + def removeLoadMgmtRecords(self, *LoadMgmtRecords): + for obj in LoadMgmtRecords: + obj.LoadMgmtFunction = None + diff --git a/CIM16/IEC61970/Informative/InfLoadControl/LoadMgmtRecord.py b/CIM16/IEC61970/Informative/InfLoadControl/LoadMgmtRecord.py new file mode 100755 index 00000000..3e6f4b74 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLoadControl/LoadMgmtRecord.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.ActivityRecord import ActivityRecord + +class LoadMgmtRecord(ActivityRecord): + """A log of actual measured load reductions as a result of load shed operations.A log of actual measured load reductions as a result of load shed operations. + """ + + def __init__(self, loadReduction=0.0, LoadMgmtFunction=None, *args, **kw_args): + """Initialises a new 'LoadMgmtRecord' instance. + + @param loadReduction: The measured reduction of the total load power as a result of the load shed activation. Thus it is the difference in power before and after the load shed operation. + @param LoadMgmtFunction: + """ + #: The measured reduction of the total load power as a result of the load shed activation. Thus it is the difference in power before and after the load shed operation. + self.loadReduction = loadReduction + + self._LoadMgmtFunction = None + self.LoadMgmtFunction = LoadMgmtFunction + + super(LoadMgmtRecord, self).__init__(*args, **kw_args) + + _attrs = ["loadReduction"] + _attr_types = {"loadReduction": float} + _defaults = {"loadReduction": 0.0} + _enums = {} + _refs = ["LoadMgmtFunction"] + _many_refs = [] + + def getLoadMgmtFunction(self): + + return self._LoadMgmtFunction + + def setLoadMgmtFunction(self, value): + if self._LoadMgmtFunction is not None: + filtered = [x for x in self.LoadMgmtFunction.LoadMgmtRecords if x != self] + self._LoadMgmtFunction._LoadMgmtRecords = filtered + + self._LoadMgmtFunction = value + if self._LoadMgmtFunction is not None: + if self not in self._LoadMgmtFunction._LoadMgmtRecords: + self._LoadMgmtFunction._LoadMgmtRecords.append(self) + + LoadMgmtFunction = property(getLoadMgmtFunction, setLoadMgmtFunction) + diff --git a/CIM16/IEC61970/Informative/InfLoadControl/LoadShedFunction.py b/CIM16/IEC61970/Informative/InfLoadControl/LoadShedFunction.py new file mode 100755 index 00000000..026cb4a9 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLoadControl/LoadShedFunction.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfLoadControl.LoadMgmtFunction import LoadMgmtFunction + +class LoadShedFunction(LoadMgmtFunction): + """A kind of LoadMgmtFunction that sheds a part of the customer load.A kind of LoadMgmtFunction that sheds a part of the customer load. + """ + + def __init__(self, switchedLoad=0.0, *args, **kw_args): + """Initialises a new 'LoadShedFunction' instance. + + @param switchedLoad: The value of the load that is connected to the shedding switch. Typically this is a noted nominal value rather than a measured value. + """ + #: The value of the load that is connected to the shedding switch. Typically this is a noted nominal value rather than a measured value. + self.switchedLoad = switchedLoad + + super(LoadShedFunction, self).__init__(*args, **kw_args) + + _attrs = ["switchedLoad"] + _attr_types = {"switchedLoad": float} + _defaults = {"switchedLoad": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfLoadControl/__init__.py b/CIM16/IEC61970/Informative/InfLoadControl/__init__.py new file mode 100755 index 00000000..487aa4e8 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLoadControl/__init__.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +from CIM16.IEC61970.Informative.InfLoadControl.LoadMgmtRecord import LoadMgmtRecord +from CIM16.IEC61970.Informative.InfLoadControl.LoadShedFunction import LoadShedFunction +from CIM16.IEC61970.Informative.InfLoadControl.LoadMgmtFunction import LoadMgmtFunction +from CIM16.IEC61970.Informative.InfLoadControl.LoadLimitFunction import LoadLimitFunction + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15#InfLoadControl" +nsPrefix = "cimInfLoadControl" + + +class LoadMgmtKind(str): + """Values are: remoteControl, timeBased, tariffBased, manualControl + """ + pass + +class LoadStateKind(str): + """Values are: limitedLoad, noLoad, fullLoad + """ + pass diff --git a/CIM16/IEC61970/Informative/InfLocations/Direction.py b/CIM16/IEC61970/Informative/InfLocations/Direction.py new file mode 100755 index 00000000..ff4cd889 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLocations/Direction.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class Direction(Element): + """Used for navigating from one location to another location.Used for navigating from one location to another location. + """ + + def __init__(self, directionInfo='', Location=None, *args, **kw_args): + """Initialises a new 'Direction' instance. + + @param directionInfo: Detailed directional information. + @param Location: + """ + #: Detailed directional information. + self.directionInfo = directionInfo + + self._Location = None + self.Location = Location + + super(Direction, self).__init__(*args, **kw_args) + + _attrs = ["directionInfo"] + _attr_types = {"directionInfo": str} + _defaults = {"directionInfo": ''} + _enums = {} + _refs = ["Location"] + _many_refs = [] + + def getLocation(self): + + return self._Location + + def setLocation(self, value): + if self._Location is not None: + filtered = [x for x in self.Location.Directions if x != self] + self._Location._Directions = filtered + + self._Location = value + if self._Location is not None: + if self not in self._Location._Directions: + self._Location._Directions.append(self) + + Location = property(getLocation, setLocation) + diff --git a/CIM16/IEC61970/Informative/InfLocations/Hazard.py b/CIM16/IEC61970/Informative/InfLocations/Hazard.py new file mode 100755 index 00000000..f283d4b2 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLocations/Hazard.py @@ -0,0 +1,80 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Hazard(IdentifiedObject): + """A hazard is any object or condition that is a danger for causing loss or perils to an asset and/or people. Examples of hazards are trees growing under overhead power lines, a park being located by a substation (i.e., children climb fence to recover a ball), a lake near an overhead distribution line (fishing pole/line contacting power lines), etc.A hazard is any object or condition that is a danger for causing loss or perils to an asset and/or people. Examples of hazards are trees growing under overhead power lines, a park being located by a substation (i.e., children climb fence to recover a ball), a lake near an overhead distribution line (fishing pole/line contacting power lines), etc. + """ + + def __init__(self, category='', Locations=None, status=None, *args, **kw_args): + """Initialises a new 'Hazard' instance. + + @param category: Category by utility's corporate standards and practices. + @param Locations: The point or polygon location of a given hazard. + @param status: + """ + #: Category by utility's corporate standards and practices. + self.category = category + + self._Locations = [] + self.Locations = [] if Locations is None else Locations + + self.status = status + + super(Hazard, self).__init__(*args, **kw_args) + + _attrs = ["category"] + _attr_types = {"category": str} + _defaults = {"category": ''} + _enums = {} + _refs = ["Locations", "status"] + _many_refs = ["Locations"] + + def getLocations(self): + """The point or polygon location of a given hazard. + """ + return self._Locations + + def setLocations(self, value): + for p in self._Locations: + filtered = [q for q in p.Hazards if q != self] + self._Locations._Hazards = filtered + for r in value: + if self not in r._Hazards: + r._Hazards.append(self) + self._Locations = value + + Locations = property(getLocations, setLocations) + + def addLocations(self, *Locations): + for obj in Locations: + if self not in obj._Hazards: + obj._Hazards.append(self) + self._Locations.append(obj) + + def removeLocations(self, *Locations): + for obj in Locations: + if self in obj._Hazards: + obj._Hazards.remove(self) + self._Locations.remove(obj) + + status = None + diff --git a/CIM16/IEC61970/Informative/InfLocations/LandProperty.py b/CIM16/IEC61970/Informative/InfLocations/LandProperty.py new file mode 100755 index 00000000..75a73bc9 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLocations/LandProperty.py @@ -0,0 +1,258 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class LandProperty(IdentifiedObject): + """Information about a particular piece of (land) property such as its use. Ownership of the property may be determined through associations to Organisations and/or ErpPersons.Information about a particular piece of (land) property such as its use. Ownership of the property may be determined through associations to Organisations and/or ErpPersons. + """ + + def __init__(self, kind="store", externalRecordReference='', demographicKind="other", status=None, LocationGrants=None, ErpSiteLevelDatas=None, ErpPersonRoles=None, ErpOrganisationRoles=None, AssetContainers=None, Locations=None, RightOfWays=None, *args, **kw_args): + """Initialises a new 'LandProperty' instance. + + @param kind: Kind of (land) property, categorised according to its main functional use from the utility's perspective. Values are: "store", "customerPremise", "building", "external", "gridSupplyPoint", "substation", "depot" + @param externalRecordReference: Reference allocated by the governing organisation (such as municipality) to this piece of land that has a formal reference to Surveyor General's records. The governing organisation is specified in associated Organisation. + @param demographicKind: Demographics around the site. Values are: "other", "urban", "rural" + @param status: + @param LocationGrants: All location grants this land property has. + @param ErpSiteLevelDatas: + @param ErpPersonRoles: + @param ErpOrganisationRoles: + @param AssetContainers: + @param Locations: The spatail description of a piece of property. + @param RightOfWays: All rights of way this land property has. + """ + #: Kind of (land) property, categorised according to its main functional use from the utility's perspective. Values are: "store", "customerPremise", "building", "external", "gridSupplyPoint", "substation", "depot" + self.kind = kind + + #: Reference allocated by the governing organisation (such as municipality) to this piece of land that has a formal reference to Surveyor General's records. The governing organisation is specified in associated Organisation. + self.externalRecordReference = externalRecordReference + + #: Demographics around the site. Values are: "other", "urban", "rural" + self.demographicKind = demographicKind + + self.status = status + + self._LocationGrants = [] + self.LocationGrants = [] if LocationGrants is None else LocationGrants + + self._ErpSiteLevelDatas = [] + self.ErpSiteLevelDatas = [] if ErpSiteLevelDatas is None else ErpSiteLevelDatas + + self._ErpPersonRoles = [] + self.ErpPersonRoles = [] if ErpPersonRoles is None else ErpPersonRoles + + self._ErpOrganisationRoles = [] + self.ErpOrganisationRoles = [] if ErpOrganisationRoles is None else ErpOrganisationRoles + + self._AssetContainers = [] + self.AssetContainers = [] if AssetContainers is None else AssetContainers + + self._Locations = [] + self.Locations = [] if Locations is None else Locations + + self._RightOfWays = [] + self.RightOfWays = [] if RightOfWays is None else RightOfWays + + super(LandProperty, self).__init__(*args, **kw_args) + + _attrs = ["kind", "externalRecordReference", "demographicKind"] + _attr_types = {"kind": str, "externalRecordReference": str, "demographicKind": str} + _defaults = {"kind": "store", "externalRecordReference": '', "demographicKind": "other"} + _enums = {"kind": "LandPropertyKind", "demographicKind": "DemographicKind"} + _refs = ["status", "LocationGrants", "ErpSiteLevelDatas", "ErpPersonRoles", "ErpOrganisationRoles", "AssetContainers", "Locations", "RightOfWays"] + _many_refs = ["LocationGrants", "ErpSiteLevelDatas", "ErpPersonRoles", "ErpOrganisationRoles", "AssetContainers", "Locations", "RightOfWays"] + + status = None + + def getLocationGrants(self): + """All location grants this land property has. + """ + return self._LocationGrants + + def setLocationGrants(self, value): + for x in self._LocationGrants: + x.LandProperty = None + for y in value: + y._LandProperty = self + self._LocationGrants = value + + LocationGrants = property(getLocationGrants, setLocationGrants) + + def addLocationGrants(self, *LocationGrants): + for obj in LocationGrants: + obj.LandProperty = self + + def removeLocationGrants(self, *LocationGrants): + for obj in LocationGrants: + obj.LandProperty = None + + def getErpSiteLevelDatas(self): + + return self._ErpSiteLevelDatas + + def setErpSiteLevelDatas(self, value): + for x in self._ErpSiteLevelDatas: + x.LandProperty = None + for y in value: + y._LandProperty = self + self._ErpSiteLevelDatas = value + + ErpSiteLevelDatas = property(getErpSiteLevelDatas, setErpSiteLevelDatas) + + def addErpSiteLevelDatas(self, *ErpSiteLevelDatas): + for obj in ErpSiteLevelDatas: + obj.LandProperty = self + + def removeErpSiteLevelDatas(self, *ErpSiteLevelDatas): + for obj in ErpSiteLevelDatas: + obj.LandProperty = None + + def getErpPersonRoles(self): + + return self._ErpPersonRoles + + def setErpPersonRoles(self, value): + for x in self._ErpPersonRoles: + x.LandProperty = None + for y in value: + y._LandProperty = self + self._ErpPersonRoles = value + + ErpPersonRoles = property(getErpPersonRoles, setErpPersonRoles) + + def addErpPersonRoles(self, *ErpPersonRoles): + for obj in ErpPersonRoles: + obj.LandProperty = self + + def removeErpPersonRoles(self, *ErpPersonRoles): + for obj in ErpPersonRoles: + obj.LandProperty = None + + def getErpOrganisationRoles(self): + + return self._ErpOrganisationRoles + + def setErpOrganisationRoles(self, value): + for p in self._ErpOrganisationRoles: + filtered = [q for q in p.LandProperty if q != self] + self._ErpOrganisationRoles._LandProperty = filtered + for r in value: + if self not in r._LandProperty: + r._LandProperty.append(self) + self._ErpOrganisationRoles = value + + ErpOrganisationRoles = property(getErpOrganisationRoles, setErpOrganisationRoles) + + def addErpOrganisationRoles(self, *ErpOrganisationRoles): + for obj in ErpOrganisationRoles: + if self not in obj._LandProperty: + obj._LandProperty.append(self) + self._ErpOrganisationRoles.append(obj) + + def removeErpOrganisationRoles(self, *ErpOrganisationRoles): + for obj in ErpOrganisationRoles: + if self in obj._LandProperty: + obj._LandProperty.remove(self) + self._ErpOrganisationRoles.remove(obj) + + def getAssetContainers(self): + + return self._AssetContainers + + def setAssetContainers(self, value): + for p in self._AssetContainers: + filtered = [q for q in p.LandProperties if q != self] + self._AssetContainers._LandProperties = filtered + for r in value: + if self not in r._LandProperties: + r._LandProperties.append(self) + self._AssetContainers = value + + AssetContainers = property(getAssetContainers, setAssetContainers) + + def addAssetContainers(self, *AssetContainers): + for obj in AssetContainers: + if self not in obj._LandProperties: + obj._LandProperties.append(self) + self._AssetContainers.append(obj) + + def removeAssetContainers(self, *AssetContainers): + for obj in AssetContainers: + if self in obj._LandProperties: + obj._LandProperties.remove(self) + self._AssetContainers.remove(obj) + + def getLocations(self): + """The spatail description of a piece of property. + """ + return self._Locations + + def setLocations(self, value): + for p in self._Locations: + filtered = [q for q in p.LandProperties if q != self] + self._Locations._LandProperties = filtered + for r in value: + if self not in r._LandProperties: + r._LandProperties.append(self) + self._Locations = value + + Locations = property(getLocations, setLocations) + + def addLocations(self, *Locations): + for obj in Locations: + if self not in obj._LandProperties: + obj._LandProperties.append(self) + self._Locations.append(obj) + + def removeLocations(self, *Locations): + for obj in Locations: + if self in obj._LandProperties: + obj._LandProperties.remove(self) + self._Locations.remove(obj) + + def getRightOfWays(self): + """All rights of way this land property has. + """ + return self._RightOfWays + + def setRightOfWays(self, value): + for p in self._RightOfWays: + filtered = [q for q in p.LandProperties if q != self] + self._RightOfWays._LandProperties = filtered + for r in value: + if self not in r._LandProperties: + r._LandProperties.append(self) + self._RightOfWays = value + + RightOfWays = property(getRightOfWays, setRightOfWays) + + def addRightOfWays(self, *RightOfWays): + for obj in RightOfWays: + if self not in obj._LandProperties: + obj._LandProperties.append(self) + self._RightOfWays.append(obj) + + def removeRightOfWays(self, *RightOfWays): + for obj in RightOfWays: + if self in obj._LandProperties: + obj._LandProperties.remove(self) + self._RightOfWays.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfLocations/LocationGrant.py b/CIM16/IEC61970/Informative/InfLocations/LocationGrant.py new file mode 100755 index 00000000..8c60aa0c --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLocations/LocationGrant.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Agreement import Agreement + +class LocationGrant(Agreement): + """A grant provides a right, as defined by type, for a parcel of land. Note that the association to Location, Asset, Organisation, etc. for the Grant is inherited from Agreement, a type of Document.A grant provides a right, as defined by type, for a parcel of land. Note that the association to Location, Asset, Organisation, etc. for the Grant is inherited from Agreement, a type of Document. + """ + + def __init__(self, propertyData='', LandProperty=None, *args, **kw_args): + """Initialises a new 'LocationGrant' instance. + + @param propertyData: Property related information that describes the Grant's land parcel. For example, it may be a deed book number, deed book page number, and parcel number. + @param LandProperty: Land property this location grant applies to. + """ + #: Property related information that describes the Grant's land parcel. For example, it may be a deed book number, deed book page number, and parcel number. + self.propertyData = propertyData + + self._LandProperty = None + self.LandProperty = LandProperty + + super(LocationGrant, self).__init__(*args, **kw_args) + + _attrs = ["propertyData"] + _attr_types = {"propertyData": str} + _defaults = {"propertyData": ''} + _enums = {} + _refs = ["LandProperty"] + _many_refs = [] + + def getLandProperty(self): + """Land property this location grant applies to. + """ + return self._LandProperty + + def setLandProperty(self, value): + if self._LandProperty is not None: + filtered = [x for x in self.LandProperty.LocationGrants if x != self] + self._LandProperty._LocationGrants = filtered + + self._LandProperty = value + if self._LandProperty is not None: + if self not in self._LandProperty._LocationGrants: + self._LandProperty._LocationGrants.append(self) + + LandProperty = property(getLandProperty, setLandProperty) + diff --git a/CIM16/IEC61970/Informative/InfLocations/OrgPropertyRole.py b/CIM16/IEC61970/Informative/InfLocations/OrgPropertyRole.py new file mode 100755 index 00000000..55ab6787 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLocations/OrgPropertyRole.py @@ -0,0 +1,90 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.Role import Role + +class OrgPropertyRole(Role): + """Roles played between Organisations and a given piece of property. For example, the Organisation may be the owner, renter, occupier, taxiing authority, etc.Roles played between Organisations and a given piece of property. For example, the Organisation may be the owner, renter, occupier, taxiing authority, etc. + """ + + def __init__(self, LandProperty=None, ErpOrganisation=None, *args, **kw_args): + """Initialises a new 'OrgPropertyRole' instance. + + @param LandProperty: + @param ErpOrganisation: + """ + self._LandProperty = [] + self.LandProperty = [] if LandProperty is None else LandProperty + + self._ErpOrganisation = None + self.ErpOrganisation = ErpOrganisation + + super(OrgPropertyRole, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["LandProperty", "ErpOrganisation"] + _many_refs = ["LandProperty"] + + def getLandProperty(self): + + return self._LandProperty + + def setLandProperty(self, value): + for p in self._LandProperty: + filtered = [q for q in p.ErpOrganisationRoles if q != self] + self._LandProperty._ErpOrganisationRoles = filtered + for r in value: + if self not in r._ErpOrganisationRoles: + r._ErpOrganisationRoles.append(self) + self._LandProperty = value + + LandProperty = property(getLandProperty, setLandProperty) + + def addLandProperty(self, *LandProperty): + for obj in LandProperty: + if self not in obj._ErpOrganisationRoles: + obj._ErpOrganisationRoles.append(self) + self._LandProperty.append(obj) + + def removeLandProperty(self, *LandProperty): + for obj in LandProperty: + if self in obj._ErpOrganisationRoles: + obj._ErpOrganisationRoles.remove(self) + self._LandProperty.remove(obj) + + def getErpOrganisation(self): + + return self._ErpOrganisation + + def setErpOrganisation(self, value): + if self._ErpOrganisation is not None: + filtered = [x for x in self.ErpOrganisation.LandPropertyRoles if x != self] + self._ErpOrganisation._LandPropertyRoles = filtered + + self._ErpOrganisation = value + if self._ErpOrganisation is not None: + if self not in self._ErpOrganisation._LandPropertyRoles: + self._ErpOrganisation._LandPropertyRoles.append(self) + + ErpOrganisation = property(getErpOrganisation, setErpOrganisation) + diff --git a/CIM16/IEC61970/Informative/InfLocations/PersonPropertyRole.py b/CIM16/IEC61970/Informative/InfLocations/PersonPropertyRole.py new file mode 100755 index 00000000..2ba172ba --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLocations/PersonPropertyRole.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.Role import Role + +class PersonPropertyRole(Role): + """The role of a person relative to a given piece of property. Examples of roles include: owner, renter, contractor, etc.The role of a person relative to a given piece of property. Examples of roles include: owner, renter, contractor, etc. + """ + + def __init__(self, ErpPerson=None, LandProperty=None, *args, **kw_args): + """Initialises a new 'PersonPropertyRole' instance. + + @param ErpPerson: + @param LandProperty: + """ + self._ErpPerson = None + self.ErpPerson = ErpPerson + + self._LandProperty = None + self.LandProperty = LandProperty + + super(PersonPropertyRole, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpPerson", "LandProperty"] + _many_refs = [] + + def getErpPerson(self): + + return self._ErpPerson + + def setErpPerson(self, value): + if self._ErpPerson is not None: + filtered = [x for x in self.ErpPerson.LandPropertyRoles if x != self] + self._ErpPerson._LandPropertyRoles = filtered + + self._ErpPerson = value + if self._ErpPerson is not None: + if self not in self._ErpPerson._LandPropertyRoles: + self._ErpPerson._LandPropertyRoles.append(self) + + ErpPerson = property(getErpPerson, setErpPerson) + + def getLandProperty(self): + + return self._LandProperty + + def setLandProperty(self, value): + if self._LandProperty is not None: + filtered = [x for x in self.LandProperty.ErpPersonRoles if x != self] + self._LandProperty._ErpPersonRoles = filtered + + self._LandProperty = value + if self._LandProperty is not None: + if self not in self._LandProperty._ErpPersonRoles: + self._LandProperty._ErpPersonRoles.append(self) + + LandProperty = property(getLandProperty, setLandProperty) + diff --git a/CIM16/IEC61970/Informative/InfLocations/RedLine.py b/CIM16/IEC61970/Informative/InfLocations/RedLine.py new file mode 100755 index 00000000..304c986d --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLocations/RedLine.py @@ -0,0 +1,75 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class RedLine(IdentifiedObject): + """This class is used for handling the accompanying annotations, time stamp, author, etc. of designs, drawings and maps. A red line can be associated with any Location object.This class is used for handling the accompanying annotations, time stamp, author, etc. of designs, drawings and maps. A red line can be associated with any Location object. + """ + + def __init__(self, Locations=None, status=None, *args, **kw_args): + """Initialises a new 'RedLine' instance. + + @param Locations: + @param status: + """ + self._Locations = [] + self.Locations = [] if Locations is None else Locations + + self.status = status + + super(RedLine, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Locations", "status"] + _many_refs = ["Locations"] + + def getLocations(self): + + return self._Locations + + def setLocations(self, value): + for p in self._Locations: + filtered = [q for q in p.RedLines if q != self] + self._Locations._RedLines = filtered + for r in value: + if self not in r._RedLines: + r._RedLines.append(self) + self._Locations = value + + Locations = property(getLocations, setLocations) + + def addLocations(self, *Locations): + for obj in Locations: + if self not in obj._RedLines: + obj._RedLines.append(self) + self._Locations.append(obj) + + def removeLocations(self, *Locations): + for obj in Locations: + if self in obj._RedLines: + obj._RedLines.remove(self) + self._Locations.remove(obj) + + status = None + diff --git a/CIM16/IEC61970/Informative/InfLocations/RightOfWay.py b/CIM16/IEC61970/Informative/InfLocations/RightOfWay.py new file mode 100755 index 00000000..98559b52 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLocations/RightOfWay.py @@ -0,0 +1,75 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Agreement import Agreement + +class RightOfWay(Agreement): + """A right-of-way (ROW) is for land where it is lawful to use for a public road, an electric power line, etc. Note that the association to Location, Asset, Organisation, etc. for the Grant is inherited from Agreement, a type of Document.A right-of-way (ROW) is for land where it is lawful to use for a public road, an electric power line, etc. Note that the association to Location, Asset, Organisation, etc. for the Grant is inherited from Agreement, a type of Document. + """ + + def __init__(self, propertyData='', LandProperties=None, *args, **kw_args): + """Initialises a new 'RightOfWay' instance. + + @param propertyData: Property related information that describes the ROW's land parcel. For example, it may be a deed book number, deed book page number, and parcel number. + @param LandProperties: All land properties this right of way applies to. + """ + #: Property related information that describes the ROW's land parcel. For example, it may be a deed book number, deed book page number, and parcel number. + self.propertyData = propertyData + + self._LandProperties = [] + self.LandProperties = [] if LandProperties is None else LandProperties + + super(RightOfWay, self).__init__(*args, **kw_args) + + _attrs = ["propertyData"] + _attr_types = {"propertyData": str} + _defaults = {"propertyData": ''} + _enums = {} + _refs = ["LandProperties"] + _many_refs = ["LandProperties"] + + def getLandProperties(self): + """All land properties this right of way applies to. + """ + return self._LandProperties + + def setLandProperties(self, value): + for p in self._LandProperties: + filtered = [q for q in p.RightOfWays if q != self] + self._LandProperties._RightOfWays = filtered + for r in value: + if self not in r._RightOfWays: + r._RightOfWays.append(self) + self._LandProperties = value + + LandProperties = property(getLandProperties, setLandProperties) + + def addLandProperties(self, *LandProperties): + for obj in LandProperties: + if self not in obj._RightOfWays: + obj._RightOfWays.append(self) + self._LandProperties.append(obj) + + def removeLandProperties(self, *LandProperties): + for obj in LandProperties: + if self in obj._RightOfWays: + obj._RightOfWays.remove(self) + self._LandProperties.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfLocations/Route.py b/CIM16/IEC61970/Informative/InfLocations/Route.py new file mode 100755 index 00000000..b68b2137 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLocations/Route.py @@ -0,0 +1,104 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Route(IdentifiedObject): + """Route that is followed, for example by service crews.Route that is followed, for example by service crews. + """ + + def __init__(self, category='', Crews=None, status=None, Locations=None, *args, **kw_args): + """Initialises a new 'Route' instance. + + @param category: Category by utility's work management standards and practices. + @param Crews: + @param status: + @param Locations: + """ + #: Category by utility's work management standards and practices. + self.category = category + + self._Crews = [] + self.Crews = [] if Crews is None else Crews + + self.status = status + + self._Locations = [] + self.Locations = [] if Locations is None else Locations + + super(Route, self).__init__(*args, **kw_args) + + _attrs = ["category"] + _attr_types = {"category": str} + _defaults = {"category": ''} + _enums = {} + _refs = ["Crews", "status", "Locations"] + _many_refs = ["Crews", "Locations"] + + def getCrews(self): + + return self._Crews + + def setCrews(self, value): + for x in self._Crews: + x.Route = None + for y in value: + y._Route = self + self._Crews = value + + Crews = property(getCrews, setCrews) + + def addCrews(self, *Crews): + for obj in Crews: + obj.Route = self + + def removeCrews(self, *Crews): + for obj in Crews: + obj.Route = None + + status = None + + def getLocations(self): + + return self._Locations + + def setLocations(self, value): + for p in self._Locations: + filtered = [q for q in p.Routes if q != self] + self._Locations._Routes = filtered + for r in value: + if self not in r._Routes: + r._Routes.append(self) + self._Locations = value + + Locations = property(getLocations, setLocations) + + def addLocations(self, *Locations): + for obj in Locations: + if self not in obj._Routes: + obj._Routes.append(self) + self._Locations.append(obj) + + def removeLocations(self, *Locations): + for obj in Locations: + if self in obj._Routes: + obj._Routes.remove(self) + self._Locations.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfLocations/Zone.py b/CIM16/IEC61970/Informative/InfLocations/Zone.py new file mode 100755 index 00000000..f99234a5 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLocations/Zone.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Location import Location + +class Zone(Location): + """Area divided off from other areas. It may be part of the electrical network, a land area where special restrictions apply, weather areas, etc. For weather, it is an area where a set of relatively homogenous weather measurements apply.Area divided off from other areas. It may be part of the electrical network, a land area where special restrictions apply, weather areas, etc. For weather, it is an area where a set of relatively homogenous weather measurements apply. + """ + + def __init__(self, kind="weatherZone", *args, **kw_args): + """Initialises a new 'Zone' instance. + + @param kind: Kind of this zone. Values are: "weatherZone", "other", "specialRestrictionLand", "electricalNetwork" + """ + #: Kind of this zone. Values are: "weatherZone", "other", "specialRestrictionLand", "electricalNetwork" + self.kind = kind + + super(Zone, self).__init__(*args, **kw_args) + + _attrs = ["kind"] + _attr_types = {"kind": str} + _defaults = {"kind": "weatherZone"} + _enums = {"kind": "ZoneKind"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfLocations/__init__.py b/CIM16/IEC61970/Informative/InfLocations/__init__.py new file mode 100755 index 00000000..fe1a93b9 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfLocations/__init__.py @@ -0,0 +1,50 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +from CIM16.IEC61970.Informative.InfLocations.LocationGrant import LocationGrant +from CIM16.IEC61970.Informative.InfLocations.RightOfWay import RightOfWay +from CIM16.IEC61970.Informative.InfLocations.PersonPropertyRole import PersonPropertyRole +from CIM16.IEC61970.Informative.InfLocations.Zone import Zone +from CIM16.IEC61970.Informative.InfLocations.RedLine import RedLine +from CIM16.IEC61970.Informative.InfLocations.Route import Route +from CIM16.IEC61970.Informative.InfLocations.OrgPropertyRole import OrgPropertyRole +from CIM16.IEC61970.Informative.InfLocations.Direction import Direction +from CIM16.IEC61970.Informative.InfLocations.LandProperty import LandProperty +from CIM16.IEC61970.Informative.InfLocations.Hazard import Hazard + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#InfLocations" +nsPrefix = "cimInfLocations" + + +class LandPropertyKind(str): + """Values are: store, customerPremise, building, external, gridSupplyPoint, substation, depot + """ + pass + +class DemographicKind(str): + """Values are: other, urban, rural + """ + pass + +class ZoneKind(str): + """Values are: weatherZone, other, specialRestrictionLand, electricalNetwork + """ + pass diff --git a/CIM16/IEC61970/Informative/InfMetering/GasMeteringFunction.py b/CIM16/IEC61970/Informative/InfMetering/GasMeteringFunction.py new file mode 100755 index 00000000..1e317161 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfMetering/GasMeteringFunction.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Metering.EndDeviceFunction import EndDeviceFunction + +class GasMeteringFunction(EndDeviceFunction): + """Functionality performed by a gas meter. It's entirely possible that the metering system would carry information to/from gas meters even though it was built primarily to carry the higher-value electric meter data.Functionality performed by a gas meter. It's entirely possible that the metering system would carry information to/from gas meters even though it was built primarily to carry the higher-value electric meter data. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'GasMeteringFunction' instance. + + """ + super(GasMeteringFunction, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfMetering/WaterMeteringFunction.py b/CIM16/IEC61970/Informative/InfMetering/WaterMeteringFunction.py new file mode 100755 index 00000000..7d6531a0 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfMetering/WaterMeteringFunction.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Metering.EndDeviceFunction import EndDeviceFunction + +class WaterMeteringFunction(EndDeviceFunction): + """Functionality performed by a water meter. It's entirely possible that the metering system would carry information to/from water meters even though it was built primarily to carry the higher-value electric meter data.Functionality performed by a water meter. It's entirely possible that the metering system would carry information to/from water meters even though it was built primarily to carry the higher-value electric meter data. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'WaterMeteringFunction' instance. + + """ + super(WaterMeteringFunction, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfMetering/__init__.py b/CIM16/IEC61970/Informative/InfMetering/__init__.py new file mode 100755 index 00000000..60361546 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfMetering/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +from CIM16.IEC61970.Informative.InfMetering.GasMeteringFunction import GasMeteringFunction +from CIM16.IEC61970.Informative.InfMetering.WaterMeteringFunction import WaterMeteringFunction + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#InfMetering" +nsPrefix = "cimInfMetering" + diff --git a/CIM16/IEC61970/Informative/InfOperations/CallBack.py b/CIM16/IEC61970/Informative/InfOperations/CallBack.py new file mode 100755 index 00000000..5ff6aace --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/CallBack.py @@ -0,0 +1,151 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class CallBack(IdentifiedObject): + """Information about a planned CallBack or a CallBack that has occurred, from the utility to a customer regarding the status and plans about resolving trouble, performing work, etc.Information about a planned CallBack or a CallBack that has occurred, from the utility to a customer regarding the status and plans about resolving trouble, performing work, etc. + """ + + def __init__(self, dateTime='', comment='', advice='', contactDetail='', problemInfo='', Appointments=None, ErpPersons=None, TroubleTickets=None, status=None, *args, **kw_args): + """Initialises a new 'CallBack' instance. + + @param dateTime: (if callback already occured) Date and time when this call back occurred. + @param comment: Comments by customer during this call back. + @param advice: Advice already given to the customer during this call back. + @param contactDetail: Additional contact details that are not provided for ErpPerson with ErpTelephoneNumber. + @param problemInfo: Descriptiion of the problem reported during this call back. + @param Appointments: + @param ErpPersons: + @param TroubleTickets: + @param status: + """ + #: (if callback already occured) Date and time when this call back occurred. + self.dateTime = dateTime + + #: Comments by customer during this call back. + self.comment = comment + + #: Advice already given to the customer during this call back. + self.advice = advice + + #: Additional contact details that are not provided for ErpPerson with ErpTelephoneNumber. + self.contactDetail = contactDetail + + #: Descriptiion of the problem reported during this call back. + self.problemInfo = problemInfo + + self._Appointments = [] + self.Appointments = [] if Appointments is None else Appointments + + self._ErpPersons = [] + self.ErpPersons = [] if ErpPersons is None else ErpPersons + + self._TroubleTickets = [] + self.TroubleTickets = [] if TroubleTickets is None else TroubleTickets + + self.status = status + + super(CallBack, self).__init__(*args, **kw_args) + + _attrs = ["dateTime", "comment", "advice", "contactDetail", "problemInfo"] + _attr_types = {"dateTime": str, "comment": str, "advice": str, "contactDetail": str, "problemInfo": str} + _defaults = {"dateTime": '', "comment": '', "advice": '', "contactDetail": '', "problemInfo": ''} + _enums = {} + _refs = ["Appointments", "ErpPersons", "TroubleTickets", "status"] + _many_refs = ["Appointments", "ErpPersons", "TroubleTickets"] + + def getAppointments(self): + + return self._Appointments + + def setAppointments(self, value): + for x in self._Appointments: + x.CallBack = None + for y in value: + y._CallBack = self + self._Appointments = value + + Appointments = property(getAppointments, setAppointments) + + def addAppointments(self, *Appointments): + for obj in Appointments: + obj.CallBack = self + + def removeAppointments(self, *Appointments): + for obj in Appointments: + obj.CallBack = None + + def getErpPersons(self): + + return self._ErpPersons + + def setErpPersons(self, value): + for p in self._ErpPersons: + filtered = [q for q in p.CallBacks if q != self] + self._ErpPersons._CallBacks = filtered + for r in value: + if self not in r._CallBacks: + r._CallBacks.append(self) + self._ErpPersons = value + + ErpPersons = property(getErpPersons, setErpPersons) + + def addErpPersons(self, *ErpPersons): + for obj in ErpPersons: + if self not in obj._CallBacks: + obj._CallBacks.append(self) + self._ErpPersons.append(obj) + + def removeErpPersons(self, *ErpPersons): + for obj in ErpPersons: + if self in obj._CallBacks: + obj._CallBacks.remove(self) + self._ErpPersons.remove(obj) + + def getTroubleTickets(self): + + return self._TroubleTickets + + def setTroubleTickets(self, value): + for p in self._TroubleTickets: + filtered = [q for q in p.CallBacks if q != self] + self._TroubleTickets._CallBacks = filtered + for r in value: + if self not in r._CallBacks: + r._CallBacks.append(self) + self._TroubleTickets = value + + TroubleTickets = property(getTroubleTickets, setTroubleTickets) + + def addTroubleTickets(self, *TroubleTickets): + for obj in TroubleTickets: + if self not in obj._CallBacks: + obj._CallBacks.append(self) + self._TroubleTickets.append(obj) + + def removeTroubleTickets(self, *TroubleTickets): + for obj in TroubleTickets: + if self in obj._CallBacks: + obj._CallBacks.remove(self) + self._TroubleTickets.remove(obj) + + status = None + diff --git a/CIM16/IEC61970/Informative/InfOperations/ChangeItem.py b/CIM16/IEC61970/Informative/InfOperations/ChangeItem.py new file mode 100755 index 00000000..888591e5 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/ChangeItem.py @@ -0,0 +1,252 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ChangeItem(IdentifiedObject): + """Description for a single change within an ordered list of changes.Description for a single change within an ordered list of changes. + """ + + def __init__(self, sequenceNumber=0, kind="add", GmlSelector=None, Organisation=None, Document=None, Asset=None, status=None, GmlObservation=None, ErpPerson=None, PowerSystemResource=None, ChangeSet=None, Location=None, NetworkDataSet=None, *args, **kw_args): + """Initialises a new 'ChangeItem' instance. + + @param sequenceNumber: Relative order of this ChangeItem in an ordered sequence of changes. + @param kind: Kind of change for the associated object. Values are: "add", "modify", "delete" + @param GmlSelector: + @param Organisation: + @param Document: + @param Asset: + @param status: + @param GmlObservation: + @param ErpPerson: + @param PowerSystemResource: + @param ChangeSet: + @param Location: + @param NetworkDataSet: + """ + #: Relative order of this ChangeItem in an ordered sequence of changes. + self.sequenceNumber = sequenceNumber + + #: Kind of change for the associated object. Values are: "add", "modify", "delete" + self.kind = kind + + self._GmlSelector = None + self.GmlSelector = GmlSelector + + self._Organisation = None + self.Organisation = Organisation + + self._Document = None + self.Document = Document + + self._Asset = None + self.Asset = Asset + + self.status = status + + self._GmlObservation = None + self.GmlObservation = GmlObservation + + self._ErpPerson = None + self.ErpPerson = ErpPerson + + self._PowerSystemResource = None + self.PowerSystemResource = PowerSystemResource + + self._ChangeSet = None + self.ChangeSet = ChangeSet + + self._Location = None + self.Location = Location + + self._NetworkDataSet = None + self.NetworkDataSet = NetworkDataSet + + super(ChangeItem, self).__init__(*args, **kw_args) + + _attrs = ["sequenceNumber", "kind"] + _attr_types = {"sequenceNumber": int, "kind": str} + _defaults = {"sequenceNumber": 0, "kind": "add"} + _enums = {"kind": "ChangeItemKind"} + _refs = ["GmlSelector", "Organisation", "Document", "Asset", "status", "GmlObservation", "ErpPerson", "PowerSystemResource", "ChangeSet", "Location", "NetworkDataSet"] + _many_refs = [] + + def getGmlSelector(self): + + return self._GmlSelector + + def setGmlSelector(self, value): + if self._GmlSelector is not None: + filtered = [x for x in self.GmlSelector.ChangeItems if x != self] + self._GmlSelector._ChangeItems = filtered + + self._GmlSelector = value + if self._GmlSelector is not None: + if self not in self._GmlSelector._ChangeItems: + self._GmlSelector._ChangeItems.append(self) + + GmlSelector = property(getGmlSelector, setGmlSelector) + + def getOrganisation(self): + + return self._Organisation + + def setOrganisation(self, value): + if self._Organisation is not None: + filtered = [x for x in self.Organisation.ChangeItems if x != self] + self._Organisation._ChangeItems = filtered + + self._Organisation = value + if self._Organisation is not None: + if self not in self._Organisation._ChangeItems: + self._Organisation._ChangeItems.append(self) + + Organisation = property(getOrganisation, setOrganisation) + + def getDocument(self): + + return self._Document + + def setDocument(self, value): + if self._Document is not None: + filtered = [x for x in self.Document.ChangeItems if x != self] + self._Document._ChangeItems = filtered + + self._Document = value + if self._Document is not None: + if self not in self._Document._ChangeItems: + self._Document._ChangeItems.append(self) + + Document = property(getDocument, setDocument) + + def getAsset(self): + + return self._Asset + + def setAsset(self, value): + if self._Asset is not None: + filtered = [x for x in self.Asset.ChangeItems if x != self] + self._Asset._ChangeItems = filtered + + self._Asset = value + if self._Asset is not None: + if self not in self._Asset._ChangeItems: + self._Asset._ChangeItems.append(self) + + Asset = property(getAsset, setAsset) + + status = None + + def getGmlObservation(self): + + return self._GmlObservation + + def setGmlObservation(self, value): + if self._GmlObservation is not None: + filtered = [x for x in self.GmlObservation.ChangeItems if x != self] + self._GmlObservation._ChangeItems = filtered + + self._GmlObservation = value + if self._GmlObservation is not None: + if self not in self._GmlObservation._ChangeItems: + self._GmlObservation._ChangeItems.append(self) + + GmlObservation = property(getGmlObservation, setGmlObservation) + + def getErpPerson(self): + + return self._ErpPerson + + def setErpPerson(self, value): + if self._ErpPerson is not None: + filtered = [x for x in self.ErpPerson.ChangeItems if x != self] + self._ErpPerson._ChangeItems = filtered + + self._ErpPerson = value + if self._ErpPerson is not None: + if self not in self._ErpPerson._ChangeItems: + self._ErpPerson._ChangeItems.append(self) + + ErpPerson = property(getErpPerson, setErpPerson) + + def getPowerSystemResource(self): + + return self._PowerSystemResource + + def setPowerSystemResource(self, value): + if self._PowerSystemResource is not None: + filtered = [x for x in self.PowerSystemResource.ChangeItems if x != self] + self._PowerSystemResource._ChangeItems = filtered + + self._PowerSystemResource = value + if self._PowerSystemResource is not None: + if self not in self._PowerSystemResource._ChangeItems: + self._PowerSystemResource._ChangeItems.append(self) + + PowerSystemResource = property(getPowerSystemResource, setPowerSystemResource) + + def getChangeSet(self): + + return self._ChangeSet + + def setChangeSet(self, value): + if self._ChangeSet is not None: + filtered = [x for x in self.ChangeSet.ChangeItems if x != self] + self._ChangeSet._ChangeItems = filtered + + self._ChangeSet = value + if self._ChangeSet is not None: + if self not in self._ChangeSet._ChangeItems: + self._ChangeSet._ChangeItems.append(self) + + ChangeSet = property(getChangeSet, setChangeSet) + + def getLocation(self): + + return self._Location + + def setLocation(self, value): + if self._Location is not None: + filtered = [x for x in self.Location.ChangeItems if x != self] + self._Location._ChangeItems = filtered + + self._Location = value + if self._Location is not None: + if self not in self._Location._ChangeItems: + self._Location._ChangeItems.append(self) + + Location = property(getLocation, setLocation) + + def getNetworkDataSet(self): + + return self._NetworkDataSet + + def setNetworkDataSet(self, value): + if self._NetworkDataSet is not None: + filtered = [x for x in self.NetworkDataSet.ChangeItems if x != self] + self._NetworkDataSet._ChangeItems = filtered + + self._NetworkDataSet = value + if self._NetworkDataSet is not None: + if self not in self._NetworkDataSet._ChangeItems: + self._NetworkDataSet._ChangeItems.append(self) + + NetworkDataSet = property(getNetworkDataSet, setNetworkDataSet) + diff --git a/CIM16/IEC61970/Informative/InfOperations/ChangeSet.py b/CIM16/IEC61970/Informative/InfOperations/ChangeSet.py new file mode 100755 index 00000000..e0858840 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/ChangeSet.py @@ -0,0 +1,131 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ChangeSet(IdentifiedObject): + """The updates required in a transaction for an existing data set are grouped into a single ChangeSet. In data sets (e.g., NetworkDataSet), each major step in the ChangeSet is described through a separate ChangeItem associated with the data set. Within each data set, each inidividual object change is described with a seperate ChangeItem associated with the object.The updates required in a transaction for an existing data set are grouped into a single ChangeSet. In data sets (e.g., NetworkDataSet), each major step in the ChangeSet is described through a separate ChangeItem associated with the data set. Within each data set, each inidividual object change is described with a seperate ChangeItem associated with the object. + """ + + def __init__(self, NetworkDataSets=None, ChangeItems=None, status=None, Documents=None, *args, **kw_args): + """Initialises a new 'ChangeSet' instance. + + @param NetworkDataSets: + @param ChangeItems: + @param status: + @param Documents: + """ + self._NetworkDataSets = [] + self.NetworkDataSets = [] if NetworkDataSets is None else NetworkDataSets + + self._ChangeItems = [] + self.ChangeItems = [] if ChangeItems is None else ChangeItems + + self.status = status + + self._Documents = [] + self.Documents = [] if Documents is None else Documents + + super(ChangeSet, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["NetworkDataSets", "ChangeItems", "status", "Documents"] + _many_refs = ["NetworkDataSets", "ChangeItems", "Documents"] + + def getNetworkDataSets(self): + + return self._NetworkDataSets + + def setNetworkDataSets(self, value): + for p in self._NetworkDataSets: + filtered = [q for q in p.ChangeSets if q != self] + self._NetworkDataSets._ChangeSets = filtered + for r in value: + if self not in r._ChangeSets: + r._ChangeSets.append(self) + self._NetworkDataSets = value + + NetworkDataSets = property(getNetworkDataSets, setNetworkDataSets) + + def addNetworkDataSets(self, *NetworkDataSets): + for obj in NetworkDataSets: + if self not in obj._ChangeSets: + obj._ChangeSets.append(self) + self._NetworkDataSets.append(obj) + + def removeNetworkDataSets(self, *NetworkDataSets): + for obj in NetworkDataSets: + if self in obj._ChangeSets: + obj._ChangeSets.remove(self) + self._NetworkDataSets.remove(obj) + + def getChangeItems(self): + + return self._ChangeItems + + def setChangeItems(self, value): + for x in self._ChangeItems: + x.ChangeSet = None + for y in value: + y._ChangeSet = self + self._ChangeItems = value + + ChangeItems = property(getChangeItems, setChangeItems) + + def addChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.ChangeSet = self + + def removeChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.ChangeSet = None + + status = None + + def getDocuments(self): + + return self._Documents + + def setDocuments(self, value): + for p in self._Documents: + filtered = [q for q in p.ChangeSets if q != self] + self._Documents._ChangeSets = filtered + for r in value: + if self not in r._ChangeSets: + r._ChangeSets.append(self) + self._Documents = value + + Documents = property(getDocuments, setDocuments) + + def addDocuments(self, *Documents): + for obj in Documents: + if self not in obj._ChangeSets: + obj._ChangeSets.append(self) + self._Documents.append(obj) + + def removeDocuments(self, *Documents): + for obj in Documents: + if self in obj._ChangeSets: + obj._ChangeSets.remove(self) + self._Documents.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfOperations/Circuit.py b/CIM16/IEC61970/Informative/InfOperations/Circuit.py new file mode 100755 index 00000000..d56c26e8 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/Circuit.py @@ -0,0 +1,70 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class Circuit(EquipmentContainer): + """EquipmentContainer that will typically include conductors, energy consumers, transformers and transformer windings, switches, shunt compensators, etc., likely at different voltages. Circuit extends from a substation to a set of open points (radial circuit), or to a second substation (looped circuit). It generally starts with a switching device, located in a substation. Membership in a Circuit is based on the nominal or design system configuration, but the electrical connectivity will change during switching operations.EquipmentContainer that will typically include conductors, energy consumers, transformers and transformer windings, switches, shunt compensators, etc., likely at different voltages. Circuit extends from a substation to a set of open points (radial circuit), or to a second substation (looped circuit). It generally starts with a switching device, located in a substation. Membership in a Circuit is based on the nominal or design system configuration, but the electrical connectivity will change during switching operations. + """ + + def __init__(self, CircuitSections=None, *args, **kw_args): + """Initialises a new 'Circuit' instance. + + @param CircuitSections: + """ + self._CircuitSections = [] + self.CircuitSections = [] if CircuitSections is None else CircuitSections + + super(Circuit, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["CircuitSections"] + _many_refs = ["CircuitSections"] + + def getCircuitSections(self): + + return self._CircuitSections + + def setCircuitSections(self, value): + for p in self._CircuitSections: + filtered = [q for q in p.Circuits if q != self] + self._CircuitSections._Circuits = filtered + for r in value: + if self not in r._Circuits: + r._Circuits.append(self) + self._CircuitSections = value + + CircuitSections = property(getCircuitSections, setCircuitSections) + + def addCircuitSections(self, *CircuitSections): + for obj in CircuitSections: + if self not in obj._Circuits: + obj._Circuits.append(self) + self._CircuitSections.append(obj) + + def removeCircuitSections(self, *CircuitSections): + for obj in CircuitSections: + if self in obj._Circuits: + obj._Circuits.remove(self) + self._CircuitSections.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfOperations/CircuitSection.py b/CIM16/IEC61970/Informative/InfOperations/CircuitSection.py new file mode 100755 index 00000000..cc97364b --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/CircuitSection.py @@ -0,0 +1,99 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class CircuitSection(IdentifiedObject): + """Section of circuit located between two sectionalizing devices. It may contain other circuit sections, for example, a lateral tapped off a primary.Section of circuit located between two sectionalizing devices. It may contain other circuit sections, for example, a lateral tapped off a primary. + """ + + def __init__(self, connectionKind="electricallyConnected", ConductorAssets=None, Circuits=None, *args, **kw_args): + """Initialises a new 'CircuitSection' instance. + + @param connectionKind: Kind of this circuit section. Values are: "electricallyConnected", "nominallyConnected", "asBuilt", "other" + @param ConductorAssets: + @param Circuits: + """ + #: Kind of this circuit section. Values are: "electricallyConnected", "nominallyConnected", "asBuilt", "other" + self.connectionKind = connectionKind + + self._ConductorAssets = [] + self.ConductorAssets = [] if ConductorAssets is None else ConductorAssets + + self._Circuits = [] + self.Circuits = [] if Circuits is None else Circuits + + super(CircuitSection, self).__init__(*args, **kw_args) + + _attrs = ["connectionKind"] + _attr_types = {"connectionKind": str} + _defaults = {"connectionKind": "electricallyConnected"} + _enums = {"connectionKind": "CircuitConnectionKind"} + _refs = ["ConductorAssets", "Circuits"] + _many_refs = ["ConductorAssets", "Circuits"] + + def getConductorAssets(self): + + return self._ConductorAssets + + def setConductorAssets(self, value): + for x in self._ConductorAssets: + x.CircuitSection = None + for y in value: + y._CircuitSection = self + self._ConductorAssets = value + + ConductorAssets = property(getConductorAssets, setConductorAssets) + + def addConductorAssets(self, *ConductorAssets): + for obj in ConductorAssets: + obj.CircuitSection = self + + def removeConductorAssets(self, *ConductorAssets): + for obj in ConductorAssets: + obj.CircuitSection = None + + def getCircuits(self): + + return self._Circuits + + def setCircuits(self, value): + for p in self._Circuits: + filtered = [q for q in p.CircuitSections if q != self] + self._Circuits._CircuitSections = filtered + for r in value: + if self not in r._CircuitSections: + r._CircuitSections.append(self) + self._Circuits = value + + Circuits = property(getCircuits, setCircuits) + + def addCircuits(self, *Circuits): + for obj in Circuits: + if self not in obj._CircuitSections: + obj._CircuitSections.append(self) + self._Circuits.append(obj) + + def removeCircuits(self, *Circuits): + for obj in Circuits: + if self in obj._CircuitSections: + obj._CircuitSections.remove(self) + self._Circuits.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfOperations/ErpPersonScheduleStepRole.py b/CIM16/IEC61970/Informative/InfOperations/ErpPersonScheduleStepRole.py new file mode 100755 index 00000000..6a9ca656 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/ErpPersonScheduleStepRole.py @@ -0,0 +1,78 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.Role import Role + +class ErpPersonScheduleStepRole(Role): + """Roles played between Persons and Schedule Steps.Roles played between Persons and Schedule Steps. + """ + + def __init__(self, ErpPerson=None, SwitchingStep=None, *args, **kw_args): + """Initialises a new 'ErpPersonScheduleStepRole' instance. + + @param ErpPerson: + @param SwitchingStep: + """ + self._ErpPerson = None + self.ErpPerson = ErpPerson + + self._SwitchingStep = None + self.SwitchingStep = SwitchingStep + + super(ErpPersonScheduleStepRole, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpPerson", "SwitchingStep"] + _many_refs = [] + + def getErpPerson(self): + + return self._ErpPerson + + def setErpPerson(self, value): + if self._ErpPerson is not None: + filtered = [x for x in self.ErpPerson.SwitchingStepRoles if x != self] + self._ErpPerson._SwitchingStepRoles = filtered + + self._ErpPerson = value + if self._ErpPerson is not None: + if self not in self._ErpPerson._SwitchingStepRoles: + self._ErpPerson._SwitchingStepRoles.append(self) + + ErpPerson = property(getErpPerson, setErpPerson) + + def getSwitchingStep(self): + + return self._SwitchingStep + + def setSwitchingStep(self, value): + if self._SwitchingStep is not None: + self._SwitchingStep._ErpPersonRole = None + + self._SwitchingStep = value + if self._SwitchingStep is not None: + self._SwitchingStep.ErpPersonRole = None + self._SwitchingStep._ErpPersonRole = self + + SwitchingStep = property(getSwitchingStep, setSwitchingStep) + diff --git a/CIM16/IEC61970/Informative/InfOperations/IncidentCode.py b/CIM16/IEC61970/Informative/InfOperations/IncidentCode.py new file mode 100755 index 00000000..85847923 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/IncidentCode.py @@ -0,0 +1,74 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class IncidentCode(IdentifiedObject): + """Classification of incident types. Multiple incident codes may apply to a given incident. The primary overall incident cause is recorded in 'IncidentRecord.category', and the main code in association end 'Names'.Classification of incident types. Multiple incident codes may apply to a given incident. The primary overall incident cause is recorded in 'IncidentRecord.category', and the main code in association end 'Names'. + """ + + def __init__(self, subCode='', IncidentRecords=None, *args, **kw_args): + """Initialises a new 'IncidentCode' instance. + + @param subCode: Additional level of classification detail (as extension to the main code found in association to Name). + @param IncidentRecords: + """ + #: Additional level of classification detail (as extension to the main code found in association to Name). + self.subCode = subCode + + self._IncidentRecords = [] + self.IncidentRecords = [] if IncidentRecords is None else IncidentRecords + + super(IncidentCode, self).__init__(*args, **kw_args) + + _attrs = ["subCode"] + _attr_types = {"subCode": str} + _defaults = {"subCode": ''} + _enums = {} + _refs = ["IncidentRecords"] + _many_refs = ["IncidentRecords"] + + def getIncidentRecords(self): + + return self._IncidentRecords + + def setIncidentRecords(self, value): + for p in self._IncidentRecords: + filtered = [q for q in p.IncidentCodes if q != self] + self._IncidentRecords._IncidentCodes = filtered + for r in value: + if self not in r._IncidentCodes: + r._IncidentCodes.append(self) + self._IncidentRecords = value + + IncidentRecords = property(getIncidentRecords, setIncidentRecords) + + def addIncidentRecords(self, *IncidentRecords): + for obj in IncidentRecords: + if self not in obj._IncidentCodes: + obj._IncidentCodes.append(self) + self._IncidentRecords.append(obj) + + def removeIncidentRecords(self, *IncidentRecords): + for obj in IncidentRecords: + if self in obj._IncidentCodes: + obj._IncidentCodes.remove(self) + self._IncidentRecords.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfOperations/IncidentRecord.py b/CIM16/IEC61970/Informative/InfOperations/IncidentRecord.py new file mode 100755 index 00000000..1b815f58 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/IncidentRecord.py @@ -0,0 +1,101 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class IncidentRecord(Document): + """Document describing the incident reported in a TroubleTicket. If the incident has to do with an outage, this will be associated with an OutageRecord. Primary cause of the incident is captured in 'category'.Document describing the incident reported in a TroubleTicket. If the incident has to do with an outage, this will be associated with an OutageRecord. Primary cause of the incident is captured in 'category'. + """ + + def __init__(self, TroubleTickets=None, period=None, IncidentCodes=None, *args, **kw_args): + """Initialises a new 'IncidentRecord' instance. + + @param TroubleTickets: + @param period: Period between the first customer impacted by the incident and the incident resolution for all customers impacted. + @param IncidentCodes: + """ + self._TroubleTickets = [] + self.TroubleTickets = [] if TroubleTickets is None else TroubleTickets + + self.period = period + + self._IncidentCodes = [] + self.IncidentCodes = [] if IncidentCodes is None else IncidentCodes + + super(IncidentRecord, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TroubleTickets", "period", "IncidentCodes"] + _many_refs = ["TroubleTickets", "IncidentCodes"] + + def getTroubleTickets(self): + + return self._TroubleTickets + + def setTroubleTickets(self, value): + for x in self._TroubleTickets: + x.IncidentRecord = None + for y in value: + y._IncidentRecord = self + self._TroubleTickets = value + + TroubleTickets = property(getTroubleTickets, setTroubleTickets) + + def addTroubleTickets(self, *TroubleTickets): + for obj in TroubleTickets: + obj.IncidentRecord = self + + def removeTroubleTickets(self, *TroubleTickets): + for obj in TroubleTickets: + obj.IncidentRecord = None + + # Period between the first customer impacted by the incident and the incident resolution for all customers impacted. + period = None + + def getIncidentCodes(self): + + return self._IncidentCodes + + def setIncidentCodes(self, value): + for p in self._IncidentCodes: + filtered = [q for q in p.IncidentRecords if q != self] + self._IncidentCodes._IncidentRecords = filtered + for r in value: + if self not in r._IncidentRecords: + r._IncidentRecords.append(self) + self._IncidentCodes = value + + IncidentCodes = property(getIncidentCodes, setIncidentCodes) + + def addIncidentCodes(self, *IncidentCodes): + for obj in IncidentCodes: + if self not in obj._IncidentRecords: + obj._IncidentRecords.append(self) + self._IncidentCodes.append(obj) + + def removeIncidentCodes(self, *IncidentCodes): + for obj in IncidentCodes: + if self in obj._IncidentRecords: + obj._IncidentRecords.remove(self) + self._IncidentCodes.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfOperations/LandBase.py b/CIM16/IEC61970/Informative/InfOperations/LandBase.py new file mode 100755 index 00000000..396c98d9 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/LandBase.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class LandBase(Document): + """Land base data.Land base data. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'LandBase' instance. + + """ + super(LandBase, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfOperations/NetworkDataSet.py b/CIM16/IEC61970/Informative/InfOperations/NetworkDataSet.py new file mode 100755 index 00000000..be685c9c --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/NetworkDataSet.py @@ -0,0 +1,166 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class NetworkDataSet(IdentifiedObject): + """Categorized as a type of document, model of a portion of the electrical network that includes a list of the equipment, along with relevant connectivity, electrical characteristics, geographical location, and various parameters associated with the equipment.Categorized as a type of document, model of a portion of the electrical network that includes a list of the equipment, along with relevant connectivity, electrical characteristics, geographical location, and various parameters associated with the equipment. + """ + + def __init__(self, category='', status=None, Documents=None, ChangeItems=None, ChangeSets=None, PowerSystemResources=None, *args, **kw_args): + """Initialises a new 'NetworkDataSet' instance. + + @param category: Category of network data set. + @param status: + @param Documents: + @param ChangeItems: + @param ChangeSets: + @param PowerSystemResources: + """ + #: Category of network data set. + self.category = category + + self.status = status + + self._Documents = [] + self.Documents = [] if Documents is None else Documents + + self._ChangeItems = [] + self.ChangeItems = [] if ChangeItems is None else ChangeItems + + self._ChangeSets = [] + self.ChangeSets = [] if ChangeSets is None else ChangeSets + + self._PowerSystemResources = [] + self.PowerSystemResources = [] if PowerSystemResources is None else PowerSystemResources + + super(NetworkDataSet, self).__init__(*args, **kw_args) + + _attrs = ["category"] + _attr_types = {"category": str} + _defaults = {"category": ''} + _enums = {} + _refs = ["status", "Documents", "ChangeItems", "ChangeSets", "PowerSystemResources"] + _many_refs = ["Documents", "ChangeItems", "ChangeSets", "PowerSystemResources"] + + status = None + + def getDocuments(self): + + return self._Documents + + def setDocuments(self, value): + for p in self._Documents: + filtered = [q for q in p.NetworkDataSets if q != self] + self._Documents._NetworkDataSets = filtered + for r in value: + if self not in r._NetworkDataSets: + r._NetworkDataSets.append(self) + self._Documents = value + + Documents = property(getDocuments, setDocuments) + + def addDocuments(self, *Documents): + for obj in Documents: + if self not in obj._NetworkDataSets: + obj._NetworkDataSets.append(self) + self._Documents.append(obj) + + def removeDocuments(self, *Documents): + for obj in Documents: + if self in obj._NetworkDataSets: + obj._NetworkDataSets.remove(self) + self._Documents.remove(obj) + + def getChangeItems(self): + + return self._ChangeItems + + def setChangeItems(self, value): + for x in self._ChangeItems: + x.NetworkDataSet = None + for y in value: + y._NetworkDataSet = self + self._ChangeItems = value + + ChangeItems = property(getChangeItems, setChangeItems) + + def addChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.NetworkDataSet = self + + def removeChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.NetworkDataSet = None + + def getChangeSets(self): + + return self._ChangeSets + + def setChangeSets(self, value): + for p in self._ChangeSets: + filtered = [q for q in p.NetworkDataSets if q != self] + self._ChangeSets._NetworkDataSets = filtered + for r in value: + if self not in r._NetworkDataSets: + r._NetworkDataSets.append(self) + self._ChangeSets = value + + ChangeSets = property(getChangeSets, setChangeSets) + + def addChangeSets(self, *ChangeSets): + for obj in ChangeSets: + if self not in obj._NetworkDataSets: + obj._NetworkDataSets.append(self) + self._ChangeSets.append(obj) + + def removeChangeSets(self, *ChangeSets): + for obj in ChangeSets: + if self in obj._NetworkDataSets: + obj._NetworkDataSets.remove(self) + self._ChangeSets.remove(obj) + + def getPowerSystemResources(self): + + return self._PowerSystemResources + + def setPowerSystemResources(self, value): + for p in self._PowerSystemResources: + filtered = [q for q in p.NetworkDataSets if q != self] + self._PowerSystemResources._NetworkDataSets = filtered + for r in value: + if self not in r._NetworkDataSets: + r._NetworkDataSets.append(self) + self._PowerSystemResources = value + + PowerSystemResources = property(getPowerSystemResources, setPowerSystemResources) + + def addPowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + if self not in obj._NetworkDataSets: + obj._NetworkDataSets.append(self) + self._PowerSystemResources.append(obj) + + def removePowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + if self in obj._NetworkDataSets: + obj._NetworkDataSets.remove(self) + self._PowerSystemResources.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfOperations/OperationalRestriction.py b/CIM16/IEC61970/Informative/InfOperations/OperationalRestriction.py new file mode 100755 index 00000000..eaeb1bad --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/OperationalRestriction.py @@ -0,0 +1,45 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class OperationalRestriction(Document): + """A document that can be associated with a device to describe any sort of restrictions compared with the original manufacturer's specification e.g. temporary maximum loadings, maximum switching current, do not operate if bus couplers are open etc etc. Since it is used in the network operations domain, it is associated with ConductingEquipment. In the UK, for example, if a breaker or switch ever mal-operates, this is reported centrally and utilities use their asset systems to identify all the installed devices of the same manufacturer's type. They then apply operational restrictions in the operational systems to warn operators of potential problems. After appropriate inspection and maintenance, the operational restrictions may be removed.A document that can be associated with a device to describe any sort of restrictions compared with the original manufacturer's specification e.g. temporary maximum loadings, maximum switching current, do not operate if bus couplers are open etc etc. Since it is used in the network operations domain, it is associated with ConductingEquipment. In the UK, for example, if a breaker or switch ever mal-operates, this is reported centrally and utilities use their asset systems to identify all the installed devices of the same manufacturer's type. They then apply operational restrictions in the operational systems to warn operators of potential problems. After appropriate inspection and maintenance, the operational restrictions may be removed. + """ + + def __init__(self, activePeriod=None, *args, **kw_args): + """Initialises a new 'OperationalRestriction' instance. + + @param activePeriod: Interval during which the restriction is applied. + """ + self.activePeriod = activePeriod + + super(OperationalRestriction, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["activePeriod"] + _many_refs = [] + + # Interval during which the restriction is applied. + activePeriod = None + diff --git a/CIM16/IEC61970/Informative/InfOperations/OrgPsrRole.py b/CIM16/IEC61970/Informative/InfOperations/OrgPsrRole.py new file mode 100755 index 00000000..0bbb1151 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/OrgPsrRole.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.Role import Role + +class OrgPsrRole(Role): + """Roles played between Organisations and Power System Resources.Roles played between Organisations and Power System Resources. + """ + + def __init__(self, ErpOrganisation=None, PowerSystemResource=None, *args, **kw_args): + """Initialises a new 'OrgPsrRole' instance. + + @param ErpOrganisation: + @param PowerSystemResource: + """ + self._ErpOrganisation = None + self.ErpOrganisation = ErpOrganisation + + self._PowerSystemResource = None + self.PowerSystemResource = PowerSystemResource + + super(OrgPsrRole, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ErpOrganisation", "PowerSystemResource"] + _many_refs = [] + + def getErpOrganisation(self): + + return self._ErpOrganisation + + def setErpOrganisation(self, value): + if self._ErpOrganisation is not None: + filtered = [x for x in self.ErpOrganisation.PowerSystemResourceRoles if x != self] + self._ErpOrganisation._PowerSystemResourceRoles = filtered + + self._ErpOrganisation = value + if self._ErpOrganisation is not None: + if self not in self._ErpOrganisation._PowerSystemResourceRoles: + self._ErpOrganisation._PowerSystemResourceRoles.append(self) + + ErpOrganisation = property(getErpOrganisation, setErpOrganisation) + + def getPowerSystemResource(self): + + return self._PowerSystemResource + + def setPowerSystemResource(self, value): + if self._PowerSystemResource is not None: + filtered = [x for x in self.PowerSystemResource.ErpOrganisationRoles if x != self] + self._PowerSystemResource._ErpOrganisationRoles = filtered + + self._PowerSystemResource = value + if self._PowerSystemResource is not None: + if self not in self._PowerSystemResource._ErpOrganisationRoles: + self._PowerSystemResource._ErpOrganisationRoles.append(self) + + PowerSystemResource = property(getPowerSystemResource, setPowerSystemResource) + diff --git a/CIM16/IEC61970/Informative/InfOperations/OutageCode.py b/CIM16/IEC61970/Informative/InfOperations/OutageCode.py new file mode 100755 index 00000000..e56f3e66 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/OutageCode.py @@ -0,0 +1,105 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class OutageCode(IdentifiedObject): + """Classification of outage types. Multiple outage codes may apply to a given outage or outage step.The primary overall outage type is recorded in 'OutageRecord.outageType'. There may be more than one classification per outage step and/or per outage record. Example codes/subcodes include: weather/ice, weather/lightning, wildlife/squirrel, wildlife/bird, burned/overload, burned/weather, wire down/accident, wire down/tree, wire down/vandalism, etc. The typical outage code is in the inherited association to Name. The code is described in the inherited 'description' attribute.Classification of outage types. Multiple outage codes may apply to a given outage or outage step.The primary overall outage type is recorded in 'OutageRecord.outageType'. There may be more than one classification per outage step and/or per outage record. Example codes/subcodes include: weather/ice, weather/lightning, wildlife/squirrel, wildlife/bird, burned/overload, burned/weather, wire down/accident, wire down/tree, wire down/vandalism, etc. The typical outage code is in the inherited association to Name. The code is described in the inherited 'description' attribute. + """ + + def __init__(self, subCode='', OutageRecords=None, OutageSteps=None, *args, **kw_args): + """Initialises a new 'OutageCode' instance. + + @param subCode: The main code is stored in the inherited association to Name. This sub-code provides an additional level of classification detail. + @param OutageRecords: + @param OutageSteps: + """ + #: The main code is stored in the inherited association to Name. This sub-code provides an additional level of classification detail. + self.subCode = subCode + + self._OutageRecords = [] + self.OutageRecords = [] if OutageRecords is None else OutageRecords + + self._OutageSteps = [] + self.OutageSteps = [] if OutageSteps is None else OutageSteps + + super(OutageCode, self).__init__(*args, **kw_args) + + _attrs = ["subCode"] + _attr_types = {"subCode": str} + _defaults = {"subCode": ''} + _enums = {} + _refs = ["OutageRecords", "OutageSteps"] + _many_refs = ["OutageRecords", "OutageSteps"] + + def getOutageRecords(self): + + return self._OutageRecords + + def setOutageRecords(self, value): + for p in self._OutageRecords: + filtered = [q for q in p.OutageCodes if q != self] + self._OutageRecords._OutageCodes = filtered + for r in value: + if self not in r._OutageCodes: + r._OutageCodes.append(self) + self._OutageRecords = value + + OutageRecords = property(getOutageRecords, setOutageRecords) + + def addOutageRecords(self, *OutageRecords): + for obj in OutageRecords: + if self not in obj._OutageCodes: + obj._OutageCodes.append(self) + self._OutageRecords.append(obj) + + def removeOutageRecords(self, *OutageRecords): + for obj in OutageRecords: + if self in obj._OutageCodes: + obj._OutageCodes.remove(self) + self._OutageRecords.remove(obj) + + def getOutageSteps(self): + + return self._OutageSteps + + def setOutageSteps(self, value): + for p in self._OutageSteps: + filtered = [q for q in p.OutageCodes if q != self] + self._OutageSteps._OutageCodes = filtered + for r in value: + if self not in r._OutageCodes: + r._OutageCodes.append(self) + self._OutageSteps = value + + OutageSteps = property(getOutageSteps, setOutageSteps) + + def addOutageSteps(self, *OutageSteps): + for obj in OutageSteps: + if self not in obj._OutageCodes: + obj._OutageCodes.append(self) + self._OutageSteps.append(obj) + + def removeOutageSteps(self, *OutageSteps): + for obj in OutageSteps: + if self in obj._OutageCodes: + obj._OutageCodes.remove(self) + self._OutageSteps.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfOperations/OutageNotification.py b/CIM16/IEC61970/Informative/InfOperations/OutageNotification.py new file mode 100755 index 00000000..88318dbd --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/OutageNotification.py @@ -0,0 +1,82 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class OutageNotification(Document): + """A document containing information to be sent to customers notifying that an outage will take place. This is used to generate mailing lists for customers.A document containing information to be sent to customers notifying that an outage will take place. This is used to generate mailing lists for customers. + """ + + def __init__(self, expectedInterruptionCount=0, duration=0.0, reason='', CustomerDatas=None, *args, **kw_args): + """Initialises a new 'OutageNotification' instance. + + @param expectedInterruptionCount: Number of possible interruptions that the customer may expect for this event. + @param duration: Likely duration of the interruption(s). + @param reason: Details of the outage 'reason'. + @param CustomerDatas: + """ + #: Number of possible interruptions that the customer may expect for this event. + self.expectedInterruptionCount = expectedInterruptionCount + + #: Likely duration of the interruption(s). + self.duration = duration + + #: Details of the outage 'reason'. + self.reason = reason + + self._CustomerDatas = [] + self.CustomerDatas = [] if CustomerDatas is None else CustomerDatas + + super(OutageNotification, self).__init__(*args, **kw_args) + + _attrs = ["expectedInterruptionCount", "duration", "reason"] + _attr_types = {"expectedInterruptionCount": int, "duration": float, "reason": str} + _defaults = {"expectedInterruptionCount": 0, "duration": 0.0, "reason": ''} + _enums = {} + _refs = ["CustomerDatas"] + _many_refs = ["CustomerDatas"] + + def getCustomerDatas(self): + + return self._CustomerDatas + + def setCustomerDatas(self, value): + for p in self._CustomerDatas: + filtered = [q for q in p.OutageNotifications if q != self] + self._CustomerDatas._OutageNotifications = filtered + for r in value: + if self not in r._OutageNotifications: + r._OutageNotifications.append(self) + self._CustomerDatas = value + + CustomerDatas = property(getCustomerDatas, setCustomerDatas) + + def addCustomerDatas(self, *CustomerDatas): + for obj in CustomerDatas: + if self not in obj._OutageNotifications: + obj._OutageNotifications.append(self) + self._CustomerDatas.append(obj) + + def removeCustomerDatas(self, *CustomerDatas): + for obj in CustomerDatas: + if self in obj._OutageNotifications: + obj._OutageNotifications.remove(self) + self._CustomerDatas.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfOperations/OutageRecord.py b/CIM16/IEC61970/Informative/InfOperations/OutageRecord.py new file mode 100755 index 00000000..3371c565 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/OutageRecord.py @@ -0,0 +1,135 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class OutageRecord(Document): + """A document describing details of an outage in part of the electrical network, typically produced by a SCADA system following a breaker trip, or within a trouble call system by grouping customer calls. This has an associated outage step for each supply point. Primary cause of the outage is captured in 'category'. In some countries all outage restoration is performed using a switching schedule which complements the outage record and records the crew and any planned work. In other systems, it may be acceptable to manage outages including new work tasks without switching schedules. Note: The relationship between OutageRecord and ErpPerson and Crew is inherited as each is a type of Document.A document describing details of an outage in part of the electrical network, typically produced by a SCADA system following a breaker trip, or within a trouble call system by grouping customer calls. This has an associated outage step for each supply point. Primary cause of the outage is captured in 'category'. In some countries all outage restoration is performed using a switching schedule which complements the outage record and records the crew and any planned work. In other systems, it may be acceptable to manage outages including new work tasks without switching schedules. Note: The relationship between OutageRecord and ErpPerson and Crew is inherited as each is a type of Document. + """ + + def __init__(self, endDateTime='', isPlanned=False, damageCode='', actionTaken='', mode='', OutageCodes=None, OutageReport=None, OutageSteps=None, *args, **kw_args): + """Initialises a new 'OutageRecord' instance. + + @param endDateTime: Date and time restoration was completed for all customers impacted by this outage. + @param isPlanned: True if planned, false otherwise (for example due to a breaker trip). + @param damageCode: The damage code relative to the associated PowerSystemResource(s) and/or Asset(s). Examples include broken, burnout, failure, flashed (burned), manually operated, wire down, no damage - rolling blackout, none. + @param actionTaken: Overall action taken to resolve outage (details are in 'WorkTasks'). + @param mode: Value of ErpOrganisation.mode at the time of OutageRecord.startDateTime. + @param OutageCodes: Multiple outage codes may apply to an outage record. + @param OutageReport: + @param OutageSteps: + """ + #: Date and time restoration was completed for all customers impacted by this outage. + self.endDateTime = endDateTime + + #: True if planned, false otherwise (for example due to a breaker trip). + self.isPlanned = isPlanned + + #: The damage code relative to the associated PowerSystemResource(s) and/or Asset(s). Examples include broken, burnout, failure, flashed (burned), manually operated, wire down, no damage - rolling blackout, none. + self.damageCode = damageCode + + #: Overall action taken to resolve outage (details are in 'WorkTasks'). + self.actionTaken = actionTaken + + #: Value of ErpOrganisation.mode at the time of OutageRecord.startDateTime. + self.mode = mode + + self._OutageCodes = [] + self.OutageCodes = [] if OutageCodes is None else OutageCodes + + self._OutageReport = None + self.OutageReport = OutageReport + + self._OutageSteps = [] + self.OutageSteps = [] if OutageSteps is None else OutageSteps + + super(OutageRecord, self).__init__(*args, **kw_args) + + _attrs = ["endDateTime", "isPlanned", "damageCode", "actionTaken", "mode"] + _attr_types = {"endDateTime": str, "isPlanned": bool, "damageCode": str, "actionTaken": str, "mode": str} + _defaults = {"endDateTime": '', "isPlanned": False, "damageCode": '', "actionTaken": '', "mode": ''} + _enums = {} + _refs = ["OutageCodes", "OutageReport", "OutageSteps"] + _many_refs = ["OutageCodes", "OutageSteps"] + + def getOutageCodes(self): + """Multiple outage codes may apply to an outage record. + """ + return self._OutageCodes + + def setOutageCodes(self, value): + for p in self._OutageCodes: + filtered = [q for q in p.OutageRecords if q != self] + self._OutageCodes._OutageRecords = filtered + for r in value: + if self not in r._OutageRecords: + r._OutageRecords.append(self) + self._OutageCodes = value + + OutageCodes = property(getOutageCodes, setOutageCodes) + + def addOutageCodes(self, *OutageCodes): + for obj in OutageCodes: + if self not in obj._OutageRecords: + obj._OutageRecords.append(self) + self._OutageCodes.append(obj) + + def removeOutageCodes(self, *OutageCodes): + for obj in OutageCodes: + if self in obj._OutageRecords: + obj._OutageRecords.remove(self) + self._OutageCodes.remove(obj) + + def getOutageReport(self): + + return self._OutageReport + + def setOutageReport(self, value): + if self._OutageReport is not None: + self._OutageReport._OutageRecord = None + + self._OutageReport = value + if self._OutageReport is not None: + self._OutageReport.OutageRecord = None + self._OutageReport._OutageRecord = self + + OutageReport = property(getOutageReport, setOutageReport) + + def getOutageSteps(self): + + return self._OutageSteps + + def setOutageSteps(self, value): + for x in self._OutageSteps: + x.OutageRecord = None + for y in value: + y._OutageRecord = self + self._OutageSteps = value + + OutageSteps = property(getOutageSteps, setOutageSteps) + + def addOutageSteps(self, *OutageSteps): + for obj in OutageSteps: + obj.OutageRecord = self + + def removeOutageSteps(self, *OutageSteps): + for obj in OutageSteps: + obj.OutageRecord = None + diff --git a/CIM16/IEC61970/Informative/InfOperations/OutageReport.py b/CIM16/IEC61970/Informative/InfOperations/OutageReport.py new file mode 100755 index 00000000..e0cd8c69 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/OutageReport.py @@ -0,0 +1,96 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class OutageReport(Document): + """Document with statistics of an outage.Document with statistics of an outage. + """ + + def __init__(self, customerCount=0, averageCml=0.0, outageDuration=0.0, totalCml=0.0, OutageRecord=None, OutageHistory=None, *args, **kw_args): + """Initialises a new 'OutageReport' instance. + + @param customerCount: Total number of outaged customers. + @param averageCml: Average Customer Minutes Lost (CML) for this outage. + @param outageDuration: Total outage duration. + @param totalCml: Total Customer Minutes Lost (CML). + @param OutageRecord: reference to related document + @param OutageHistory: OutageHistory of a customer, which may include this OutageReport. + """ + #: Total number of outaged customers. + self.customerCount = customerCount + + #: Average Customer Minutes Lost (CML) for this outage. + self.averageCml = averageCml + + #: Total outage duration. + self.outageDuration = outageDuration + + #: Total Customer Minutes Lost (CML). + self.totalCml = totalCml + + self._OutageRecord = None + self.OutageRecord = OutageRecord + + self._OutageHistory = None + self.OutageHistory = OutageHistory + + super(OutageReport, self).__init__(*args, **kw_args) + + _attrs = ["customerCount", "averageCml", "outageDuration", "totalCml"] + _attr_types = {"customerCount": int, "averageCml": float, "outageDuration": float, "totalCml": float} + _defaults = {"customerCount": 0, "averageCml": 0.0, "outageDuration": 0.0, "totalCml": 0.0} + _enums = {} + _refs = ["OutageRecord", "OutageHistory"] + _many_refs = [] + + def getOutageRecord(self): + """reference to related document + """ + return self._OutageRecord + + def setOutageRecord(self, value): + if self._OutageRecord is not None: + self._OutageRecord._OutageReport = None + + self._OutageRecord = value + if self._OutageRecord is not None: + self._OutageRecord.OutageReport = None + self._OutageRecord._OutageReport = self + + OutageRecord = property(getOutageRecord, setOutageRecord) + + def getOutageHistory(self): + """OutageHistory of a customer, which may include this OutageReport. + """ + return self._OutageHistory + + def setOutageHistory(self, value): + if self._OutageHistory is not None: + filtered = [x for x in self.OutageHistory.OutageReports if x != self] + self._OutageHistory._OutageReports = filtered + + self._OutageHistory = value + if self._OutageHistory is not None: + if self not in self._OutageHistory._OutageReports: + self._OutageHistory._OutageReports.append(self) + + OutageHistory = property(getOutageHistory, setOutageHistory) + diff --git a/CIM16/IEC61970/Informative/InfOperations/OutageStep.py b/CIM16/IEC61970/Informative/InfOperations/OutageStep.py new file mode 100755 index 00000000..04d464a1 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/OutageStep.py @@ -0,0 +1,206 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class OutageStep(IdentifiedObject): + """Holds an outage start and end time for each supply point of an outage record. The supply point for a given step is the associated PowerSystemResource instance.Holds an outage start and end time for each supply point of an outage record. The supply point for a given step is the associated PowerSystemResource instance. + """ + + def __init__(self, averageCml=0.0, damage=False, specialCustomerCount=0, criticalCustomerCount=0, estimatedRestoreDateTime='', shockReported=False, callerCount=0, fatality=False, jobPriority='', totalCustomerCount=0, injury=False, totalCml=0.0, Crews=None, noPowerInterval=None, ConductingEquipmentRoles=None, status=None, OutageRecord=None, OutageCodes=None, *args, **kw_args): + """Initialises a new 'OutageStep' instance. + + @param averageCml: Average Customer Minutes Lost (CML) for this supply point for this outage. + @param damage: True if damage reported by caller or engineer. + @param specialCustomerCount: Number of customers with high reliability required. + @param criticalCustomerCount: Number of customers with critical needs, e.g., with a dialysis machine. + @param estimatedRestoreDateTime: Estimated time of restoration. + @param shockReported: True if shocks reported by caller or engineer. + @param callerCount: Number of customers phoning in. + @param fatality: True if fatalities reported by caller or engineer. + @param jobPriority: + @param totalCustomerCount: Number of customers connected to the PowerSystemResource. + @param injury: True if injuries reported by caller or engineer. + @param totalCml: Total Customer Minutes Lost (CML) for this supply point for this outage. + @param Crews: + @param noPowerInterval: Date and time interval between loss and restoration of power. + @param ConductingEquipmentRoles: + @param status: + @param OutageRecord: + @param OutageCodes: Multiple outage codes may apply to an outage step. + """ + #: Average Customer Minutes Lost (CML) for this supply point for this outage. + self.averageCml = averageCml + + #: True if damage reported by caller or engineer. + self.damage = damage + + #: Number of customers with high reliability required. + self.specialCustomerCount = specialCustomerCount + + #: Number of customers with critical needs, e.g., with a dialysis machine. + self.criticalCustomerCount = criticalCustomerCount + + #: Estimated time of restoration. + self.estimatedRestoreDateTime = estimatedRestoreDateTime + + #: True if shocks reported by caller or engineer. + self.shockReported = shockReported + + #: Number of customers phoning in. + self.callerCount = callerCount + + #: True if fatalities reported by caller or engineer. + self.fatality = fatality + + + self.jobPriority = jobPriority + + #: Number of customers connected to the PowerSystemResource. + self.totalCustomerCount = totalCustomerCount + + #: True if injuries reported by caller or engineer. + self.injury = injury + + #: Total Customer Minutes Lost (CML) for this supply point for this outage. + self.totalCml = totalCml + + self._Crews = [] + self.Crews = [] if Crews is None else Crews + + self.noPowerInterval = noPowerInterval + + self._ConductingEquipmentRoles = [] + self.ConductingEquipmentRoles = [] if ConductingEquipmentRoles is None else ConductingEquipmentRoles + + self.status = status + + self._OutageRecord = None + self.OutageRecord = OutageRecord + + self._OutageCodes = [] + self.OutageCodes = [] if OutageCodes is None else OutageCodes + + super(OutageStep, self).__init__(*args, **kw_args) + + _attrs = ["averageCml", "damage", "specialCustomerCount", "criticalCustomerCount", "estimatedRestoreDateTime", "shockReported", "callerCount", "fatality", "jobPriority", "totalCustomerCount", "injury", "totalCml"] + _attr_types = {"averageCml": float, "damage": bool, "specialCustomerCount": int, "criticalCustomerCount": int, "estimatedRestoreDateTime": str, "shockReported": bool, "callerCount": int, "fatality": bool, "jobPriority": str, "totalCustomerCount": int, "injury": bool, "totalCml": float} + _defaults = {"averageCml": 0.0, "damage": False, "specialCustomerCount": 0, "criticalCustomerCount": 0, "estimatedRestoreDateTime": '', "shockReported": False, "callerCount": 0, "fatality": False, "jobPriority": '', "totalCustomerCount": 0, "injury": False, "totalCml": 0.0} + _enums = {} + _refs = ["Crews", "noPowerInterval", "ConductingEquipmentRoles", "status", "OutageRecord", "OutageCodes"] + _many_refs = ["Crews", "ConductingEquipmentRoles", "OutageCodes"] + + def getCrews(self): + + return self._Crews + + def setCrews(self, value): + for p in self._Crews: + filtered = [q for q in p.OutageSteps if q != self] + self._Crews._OutageSteps = filtered + for r in value: + if self not in r._OutageSteps: + r._OutageSteps.append(self) + self._Crews = value + + Crews = property(getCrews, setCrews) + + def addCrews(self, *Crews): + for obj in Crews: + if self not in obj._OutageSteps: + obj._OutageSteps.append(self) + self._Crews.append(obj) + + def removeCrews(self, *Crews): + for obj in Crews: + if self in obj._OutageSteps: + obj._OutageSteps.remove(self) + self._Crews.remove(obj) + + # Date and time interval between loss and restoration of power. + noPowerInterval = None + + def getConductingEquipmentRoles(self): + + return self._ConductingEquipmentRoles + + def setConductingEquipmentRoles(self, value): + for x in self._ConductingEquipmentRoles: + x.OutageStep = None + for y in value: + y._OutageStep = self + self._ConductingEquipmentRoles = value + + ConductingEquipmentRoles = property(getConductingEquipmentRoles, setConductingEquipmentRoles) + + def addConductingEquipmentRoles(self, *ConductingEquipmentRoles): + for obj in ConductingEquipmentRoles: + obj.OutageStep = self + + def removeConductingEquipmentRoles(self, *ConductingEquipmentRoles): + for obj in ConductingEquipmentRoles: + obj.OutageStep = None + + status = None + + def getOutageRecord(self): + + return self._OutageRecord + + def setOutageRecord(self, value): + if self._OutageRecord is not None: + filtered = [x for x in self.OutageRecord.OutageSteps if x != self] + self._OutageRecord._OutageSteps = filtered + + self._OutageRecord = value + if self._OutageRecord is not None: + if self not in self._OutageRecord._OutageSteps: + self._OutageRecord._OutageSteps.append(self) + + OutageRecord = property(getOutageRecord, setOutageRecord) + + def getOutageCodes(self): + """Multiple outage codes may apply to an outage step. + """ + return self._OutageCodes + + def setOutageCodes(self, value): + for p in self._OutageCodes: + filtered = [q for q in p.OutageSteps if q != self] + self._OutageCodes._OutageSteps = filtered + for r in value: + if self not in r._OutageSteps: + r._OutageSteps.append(self) + self._OutageCodes = value + + OutageCodes = property(getOutageCodes, setOutageCodes) + + def addOutageCodes(self, *OutageCodes): + for obj in OutageCodes: + if self not in obj._OutageSteps: + obj._OutageSteps.append(self) + self._OutageCodes.append(obj) + + def removeOutageCodes(self, *OutageCodes): + for obj in OutageCodes: + if self in obj._OutageSteps: + obj._OutageSteps.remove(self) + self._OutageCodes.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfOperations/OutageStepPsrRole.py b/CIM16/IEC61970/Informative/InfOperations/OutageStepPsrRole.py new file mode 100755 index 00000000..2b910ecb --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/OutageStepPsrRole.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.Role import Role + +class OutageStepPsrRole(Role): + """Roles played between Power System Resources and Outage Steps. Examples roles include: normal supply, actual supply, interrupting device, restoration device.Roles played between Power System Resources and Outage Steps. Examples roles include: normal supply, actual supply, interrupting device, restoration device. + """ + + def __init__(self, OutageStep=None, ConductingEquipment=None, *args, **kw_args): + """Initialises a new 'OutageStepPsrRole' instance. + + @param OutageStep: + @param ConductingEquipment: + """ + self._OutageStep = None + self.OutageStep = OutageStep + + self._ConductingEquipment = None + self.ConductingEquipment = ConductingEquipment + + super(OutageStepPsrRole, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["OutageStep", "ConductingEquipment"] + _many_refs = [] + + def getOutageStep(self): + + return self._OutageStep + + def setOutageStep(self, value): + if self._OutageStep is not None: + filtered = [x for x in self.OutageStep.ConductingEquipmentRoles if x != self] + self._OutageStep._ConductingEquipmentRoles = filtered + + self._OutageStep = value + if self._OutageStep is not None: + if self not in self._OutageStep._ConductingEquipmentRoles: + self._OutageStep._ConductingEquipmentRoles.append(self) + + OutageStep = property(getOutageStep, setOutageStep) + + def getConductingEquipment(self): + + return self._ConductingEquipment + + def setConductingEquipment(self, value): + if self._ConductingEquipment is not None: + filtered = [x for x in self.ConductingEquipment.OutageStepRoles if x != self] + self._ConductingEquipment._OutageStepRoles = filtered + + self._ConductingEquipment = value + if self._ConductingEquipment is not None: + if self not in self._ConductingEquipment._OutageStepRoles: + self._ConductingEquipment._OutageStepRoles.append(self) + + ConductingEquipment = property(getConductingEquipment, setConductingEquipment) + diff --git a/CIM16/IEC61970/Informative/InfOperations/PSREvent.py b/CIM16/IEC61970/Informative/InfOperations/PSREvent.py new file mode 100755 index 00000000..b3417487 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/PSREvent.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.ActivityRecord import ActivityRecord + +class PSREvent(ActivityRecord): + """Event recording the change in operational status of a PowerSystemResource.Event recording the change in operational status of a PowerSystemResource. + """ + + def __init__(self, kind="pendingRemove", PowerSystemResource=None, *args, **kw_args): + """Initialises a new 'PSREvent' instance. + + @param kind: Kind of event. Values are: "pendingRemove", "pendingReplace", "outOfService", "pendingAdd", "unknown", "inService", "other" + @param PowerSystemResource: Power system resource that generated this event. + """ + #: Kind of event. Values are: "pendingRemove", "pendingReplace", "outOfService", "pendingAdd", "unknown", "inService", "other" + self.kind = kind + + self._PowerSystemResource = None + self.PowerSystemResource = PowerSystemResource + + super(PSREvent, self).__init__(*args, **kw_args) + + _attrs = ["kind"] + _attr_types = {"kind": str} + _defaults = {"kind": "pendingRemove"} + _enums = {"kind": "PSREventKind"} + _refs = ["PowerSystemResource"] + _many_refs = [] + + def getPowerSystemResource(self): + """Power system resource that generated this event. + """ + return self._PowerSystemResource + + def setPowerSystemResource(self, value): + if self._PowerSystemResource is not None: + filtered = [x for x in self.PowerSystemResource.PSREvent if x != self] + self._PowerSystemResource._PSREvent = filtered + + self._PowerSystemResource = value + if self._PowerSystemResource is not None: + if self not in self._PowerSystemResource._PSREvent: + self._PowerSystemResource._PSREvent.append(self) + + PowerSystemResource = property(getPowerSystemResource, setPowerSystemResource) + diff --git a/CIM16/IEC61970/Informative/InfOperations/PlannedOutage.py b/CIM16/IEC61970/Informative/InfOperations/PlannedOutage.py new file mode 100755 index 00000000..5fc826d1 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/PlannedOutage.py @@ -0,0 +1,94 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class PlannedOutage(Document): + """Planned outage involves network operations which will affect the supply of power to customers. Note that the list of Power System Resources for the PlannedOutage may be the same or a superset of the ones per OutageStep.Planned outage involves network operations which will affect the supply of power to customers. Note that the list of Power System Resources for the PlannedOutage may be the same or a superset of the ones per OutageStep. + """ + + def __init__(self, kind="fixed", CustomerDatas=None, OutageSchedules=None, *args, **kw_args): + """Initialises a new 'PlannedOutage' instance. + + @param kind: Kind of outage. Values are: "fixed", "flexible", "forced" + @param CustomerDatas: All customers affected by this work. Derived from WorkOrder.connectedCustomers + @param OutageSchedules: + """ + #: Kind of outage. Values are: "fixed", "flexible", "forced" + self.kind = kind + + self._CustomerDatas = [] + self.CustomerDatas = [] if CustomerDatas is None else CustomerDatas + + self._OutageSchedules = [] + self.OutageSchedules = [] if OutageSchedules is None else OutageSchedules + + super(PlannedOutage, self).__init__(*args, **kw_args) + + _attrs = ["kind"] + _attr_types = {"kind": str} + _defaults = {"kind": "fixed"} + _enums = {"kind": "OutageKind"} + _refs = ["CustomerDatas", "OutageSchedules"] + _many_refs = ["CustomerDatas", "OutageSchedules"] + + def getCustomerDatas(self): + """All customers affected by this work. Derived from WorkOrder.connectedCustomers + """ + return self._CustomerDatas + + def setCustomerDatas(self, value): + for x in self._CustomerDatas: + x.PlannedOutage = None + for y in value: + y._PlannedOutage = self + self._CustomerDatas = value + + CustomerDatas = property(getCustomerDatas, setCustomerDatas) + + def addCustomerDatas(self, *CustomerDatas): + for obj in CustomerDatas: + obj.PlannedOutage = self + + def removeCustomerDatas(self, *CustomerDatas): + for obj in CustomerDatas: + obj.PlannedOutage = None + + def getOutageSchedules(self): + + return self._OutageSchedules + + def setOutageSchedules(self, value): + for x in self._OutageSchedules: + x.PlannedOutage = None + for y in value: + y._PlannedOutage = self + self._OutageSchedules = value + + OutageSchedules = property(getOutageSchedules, setOutageSchedules) + + def addOutageSchedules(self, *OutageSchedules): + for obj in OutageSchedules: + obj.PlannedOutage = self + + def removeOutageSchedules(self, *OutageSchedules): + for obj in OutageSchedules: + obj.PlannedOutage = None + diff --git a/CIM16/IEC61970/Informative/InfOperations/SafetyDocument.py b/CIM16/IEC61970/Informative/InfOperations/SafetyDocument.py new file mode 100755 index 00000000..35b0be54 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/SafetyDocument.py @@ -0,0 +1,109 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class SafetyDocument(Document): + """A document restricting or authorising works on electrical equipment (for example a permit to work, sanction for test, limitation of access, or certificate of isolation), defined based upon organisational practices. Note: SafetyDocument may refer to ClearanceTag-s associated with ConductingEquipment for which the SafetyDocument is issued.A document restricting or authorising works on electrical equipment (for example a permit to work, sanction for test, limitation of access, or certificate of isolation), defined based upon organisational practices. Note: SafetyDocument may refer to ClearanceTag-s associated with ConductingEquipment for which the SafetyDocument is issued. + """ + + def __init__(self, ClearanceTags=None, ScheduleSteps=None, PowerSystemResource=None, *args, **kw_args): + """Initialises a new 'SafetyDocument' instance. + + @param ClearanceTags: + @param ScheduleSteps: + @param PowerSystemResource: + """ + self._ClearanceTags = [] + self.ClearanceTags = [] if ClearanceTags is None else ClearanceTags + + self._ScheduleSteps = [] + self.ScheduleSteps = [] if ScheduleSteps is None else ScheduleSteps + + self._PowerSystemResource = None + self.PowerSystemResource = PowerSystemResource + + super(SafetyDocument, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ClearanceTags", "ScheduleSteps", "PowerSystemResource"] + _many_refs = ["ClearanceTags", "ScheduleSteps"] + + def getClearanceTags(self): + + return self._ClearanceTags + + def setClearanceTags(self, value): + for x in self._ClearanceTags: + x.SafetyDocument = None + for y in value: + y._SafetyDocument = self + self._ClearanceTags = value + + ClearanceTags = property(getClearanceTags, setClearanceTags) + + def addClearanceTags(self, *ClearanceTags): + for obj in ClearanceTags: + obj.SafetyDocument = self + + def removeClearanceTags(self, *ClearanceTags): + for obj in ClearanceTags: + obj.SafetyDocument = None + + def getScheduleSteps(self): + + return self._ScheduleSteps + + def setScheduleSteps(self, value): + for x in self._ScheduleSteps: + x.SafetyDocument = None + for y in value: + y._SafetyDocument = self + self._ScheduleSteps = value + + ScheduleSteps = property(getScheduleSteps, setScheduleSteps) + + def addScheduleSteps(self, *ScheduleSteps): + for obj in ScheduleSteps: + obj.SafetyDocument = self + + def removeScheduleSteps(self, *ScheduleSteps): + for obj in ScheduleSteps: + obj.SafetyDocument = None + + def getPowerSystemResource(self): + + return self._PowerSystemResource + + def setPowerSystemResource(self, value): + if self._PowerSystemResource is not None: + filtered = [x for x in self.PowerSystemResource.SafetyDocuments if x != self] + self._PowerSystemResource._SafetyDocuments = filtered + + self._PowerSystemResource = value + if self._PowerSystemResource is not None: + if self not in self._PowerSystemResource._SafetyDocuments: + self._PowerSystemResource._SafetyDocuments.append(self) + + PowerSystemResource = property(getPowerSystemResource, setPowerSystemResource) + diff --git a/CIM16/IEC61970/Informative/InfOperations/SwitchingSchedule.py b/CIM16/IEC61970/Informative/InfOperations/SwitchingSchedule.py new file mode 100755 index 00000000..f90d924a --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/SwitchingSchedule.py @@ -0,0 +1,126 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class SwitchingSchedule(Document): + """Document describing a sequence of steps to perform an item of work, for example to isolate some plant with regard to safety, equipment ratings, and standards of customer service. Note 1: SwitchingSchedule is intended to describe the full operational details for switching for real time operation which includes other operations such as grounding, applying safety documents etc. Note 2: The association to ErpPerson suits the UK practice of quoting specific names (e.g the crew foreman). The association to Crew is for US practice.Document describing a sequence of steps to perform an item of work, for example to isolate some plant with regard to safety, equipment ratings, and standards of customer service. Note 1: SwitchingSchedule is intended to describe the full operational details for switching for real time operation which includes other operations such as grounding, applying safety documents etc. Note 2: The association to ErpPerson suits the UK practice of quoting specific names (e.g the crew foreman). The association to Crew is for US practice. + """ + + def __init__(self, reason='', ScheduleSteps=None, WorkTask=None, Crews=None, interval=None, *args, **kw_args): + """Initialises a new 'SwitchingSchedule' instance. + + @param reason: Reason for switching. + @param ScheduleSteps: + @param WorkTask: + @param Crews: All Crews executing this SwitchingSchedule. + @param interval: Interval between starting and completion of the switching. + """ + #: Reason for switching. + self.reason = reason + + self._ScheduleSteps = [] + self.ScheduleSteps = [] if ScheduleSteps is None else ScheduleSteps + + self._WorkTask = None + self.WorkTask = WorkTask + + self._Crews = [] + self.Crews = [] if Crews is None else Crews + + self.interval = interval + + super(SwitchingSchedule, self).__init__(*args, **kw_args) + + _attrs = ["reason"] + _attr_types = {"reason": str} + _defaults = {"reason": ''} + _enums = {} + _refs = ["ScheduleSteps", "WorkTask", "Crews", "interval"] + _many_refs = ["ScheduleSteps", "Crews"] + + def getScheduleSteps(self): + + return self._ScheduleSteps + + def setScheduleSteps(self, value): + for x in self._ScheduleSteps: + x.SwitchingSchedule = None + for y in value: + y._SwitchingSchedule = self + self._ScheduleSteps = value + + ScheduleSteps = property(getScheduleSteps, setScheduleSteps) + + def addScheduleSteps(self, *ScheduleSteps): + for obj in ScheduleSteps: + obj.SwitchingSchedule = self + + def removeScheduleSteps(self, *ScheduleSteps): + for obj in ScheduleSteps: + obj.SwitchingSchedule = None + + def getWorkTask(self): + + return self._WorkTask + + def setWorkTask(self, value): + if self._WorkTask is not None: + filtered = [x for x in self.WorkTask.SwitchingSchedules if x != self] + self._WorkTask._SwitchingSchedules = filtered + + self._WorkTask = value + if self._WorkTask is not None: + if self not in self._WorkTask._SwitchingSchedules: + self._WorkTask._SwitchingSchedules.append(self) + + WorkTask = property(getWorkTask, setWorkTask) + + def getCrews(self): + """All Crews executing this SwitchingSchedule. + """ + return self._Crews + + def setCrews(self, value): + for p in self._Crews: + filtered = [q for q in p.SwitchingSchedules if q != self] + self._Crews._SwitchingSchedules = filtered + for r in value: + if self not in r._SwitchingSchedules: + r._SwitchingSchedules.append(self) + self._Crews = value + + Crews = property(getCrews, setCrews) + + def addCrews(self, *Crews): + for obj in Crews: + if self not in obj._SwitchingSchedules: + obj._SwitchingSchedules.append(self) + self._Crews.append(obj) + + def removeCrews(self, *Crews): + for obj in Crews: + if self in obj._SwitchingSchedules: + obj._SwitchingSchedules.remove(self) + self._Crews.remove(obj) + + # Interval between starting and completion of the switching. + interval = None + diff --git a/CIM16/IEC61970/Informative/InfOperations/SwitchingStep.py b/CIM16/IEC61970/Informative/InfOperations/SwitchingStep.py new file mode 100755 index 00000000..c52336ba --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/SwitchingStep.py @@ -0,0 +1,151 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class SwitchingStep(IdentifiedObject): + """A single step within a SwitchingSchedule. Could be a switching operation (applying a network alteration), or issuing a safety document. Note: Inherited attribute IdentifiedObject.name is used to hold the sequence number.A single step within a SwitchingSchedule. Could be a switching operation (applying a network alteration), or issuing a safety document. Note: Inherited attribute IdentifiedObject.name is used to hold the sequence number. + """ + + def __init__(self, statusKind="instructed", text='', requiredControlAction='', desiredEndState='', SafetyDocument=None, requiredControlActionInterval=None, SwitchingSchedule=None, PowerSystemResources=None, ErpPersonRole=None, *args, **kw_args): + """Initialises a new 'SwitchingStep' instance. + + @param statusKind: Status of this SwitchingStep. Values are: "instructed", "confirmed", "proposed", "aborted", "skipped" + @param text: Information regarding this switching schedule step. + @param requiredControlAction: Control actions required to perform this step. + @param desiredEndState: Desired end state for the associated PowerSystemResource as a result of this schedule step. + @param SafetyDocument: + @param requiredControlActionInterval: Interval between 'requiredControlAction' was issued and completed. + @param SwitchingSchedule: + @param PowerSystemResources: + @param ErpPersonRole: + """ + #: Status of this SwitchingStep. Values are: "instructed", "confirmed", "proposed", "aborted", "skipped" + self.statusKind = statusKind + + #: Information regarding this switching schedule step. + self.text = text + + #: Control actions required to perform this step. + self.requiredControlAction = requiredControlAction + + #: Desired end state for the associated PowerSystemResource as a result of this schedule step. + self.desiredEndState = desiredEndState + + self._SafetyDocument = None + self.SafetyDocument = SafetyDocument + + self.requiredControlActionInterval = requiredControlActionInterval + + self._SwitchingSchedule = None + self.SwitchingSchedule = SwitchingSchedule + + self._PowerSystemResources = [] + self.PowerSystemResources = [] if PowerSystemResources is None else PowerSystemResources + + self._ErpPersonRole = None + self.ErpPersonRole = ErpPersonRole + + super(SwitchingStep, self).__init__(*args, **kw_args) + + _attrs = ["statusKind", "text", "requiredControlAction", "desiredEndState"] + _attr_types = {"statusKind": str, "text": str, "requiredControlAction": str, "desiredEndState": str} + _defaults = {"statusKind": "instructed", "text": '', "requiredControlAction": '', "desiredEndState": ''} + _enums = {"statusKind": "SwitchingStepStatusKind"} + _refs = ["SafetyDocument", "requiredControlActionInterval", "SwitchingSchedule", "PowerSystemResources", "ErpPersonRole"] + _many_refs = ["PowerSystemResources"] + + def getSafetyDocument(self): + + return self._SafetyDocument + + def setSafetyDocument(self, value): + if self._SafetyDocument is not None: + filtered = [x for x in self.SafetyDocument.ScheduleSteps if x != self] + self._SafetyDocument._ScheduleSteps = filtered + + self._SafetyDocument = value + if self._SafetyDocument is not None: + if self not in self._SafetyDocument._ScheduleSteps: + self._SafetyDocument._ScheduleSteps.append(self) + + SafetyDocument = property(getSafetyDocument, setSafetyDocument) + + # Interval between 'requiredControlAction' was issued and completed. + requiredControlActionInterval = None + + def getSwitchingSchedule(self): + + return self._SwitchingSchedule + + def setSwitchingSchedule(self, value): + if self._SwitchingSchedule is not None: + filtered = [x for x in self.SwitchingSchedule.ScheduleSteps if x != self] + self._SwitchingSchedule._ScheduleSteps = filtered + + self._SwitchingSchedule = value + if self._SwitchingSchedule is not None: + if self not in self._SwitchingSchedule._ScheduleSteps: + self._SwitchingSchedule._ScheduleSteps.append(self) + + SwitchingSchedule = property(getSwitchingSchedule, setSwitchingSchedule) + + def getPowerSystemResources(self): + + return self._PowerSystemResources + + def setPowerSystemResources(self, value): + for p in self._PowerSystemResources: + filtered = [q for q in p.ScheduleSteps if q != self] + self._PowerSystemResources._ScheduleSteps = filtered + for r in value: + if self not in r._ScheduleSteps: + r._ScheduleSteps.append(self) + self._PowerSystemResources = value + + PowerSystemResources = property(getPowerSystemResources, setPowerSystemResources) + + def addPowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + if self not in obj._ScheduleSteps: + obj._ScheduleSteps.append(self) + self._PowerSystemResources.append(obj) + + def removePowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + if self in obj._ScheduleSteps: + obj._ScheduleSteps.remove(self) + self._PowerSystemResources.remove(obj) + + def getErpPersonRole(self): + + return self._ErpPersonRole + + def setErpPersonRole(self, value): + if self._ErpPersonRole is not None: + self._ErpPersonRole._SwitchingStep = None + + self._ErpPersonRole = value + if self._ErpPersonRole is not None: + self._ErpPersonRole.SwitchingStep = None + self._ErpPersonRole._SwitchingStep = self + + ErpPersonRole = property(getErpPersonRole, setErpPersonRole) + diff --git a/CIM16/IEC61970/Informative/InfOperations/TroubleTicket.py b/CIM16/IEC61970/Informative/InfOperations/TroubleTicket.py new file mode 100755 index 00000000..bb894b96 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/TroubleTicket.py @@ -0,0 +1,152 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class TroubleTicket(Document): + """A document used to report electrical trouble. The trouble may either be an outage or non-outage problem, such as power quality. It must always be associated with an incident record. Note that a separate activity record is created for each call associated with an instance of trouble ticket. The time of a call is stored in 'ActivityRecord.createdOn' and comments are recorded in 'ActivityRecord.remarks'.A document used to report electrical trouble. The trouble may either be an outage or non-outage problem, such as power quality. It must always be associated with an incident record. Note that a separate activity record is created for each call associated with an instance of trouble ticket. The time of a call is stored in 'ActivityRecord.createdOn' and comments are recorded in 'ActivityRecord.remarks'. + """ + + def __init__(self, firstCallDateTime='', estimatedRestoreDateTime='', informBeforeRestored=False, reportingKind="email", priority='', informAfterRestored=False, advice='', hazardCode='', callBack=False, CallBacks=None, troublePeriod=None, CustomerData=None, IncidentRecord=None, *args, **kw_args): + """Initialises a new 'TroubleTicket' instance. + + @param firstCallDateTime: Date and time trouble call first received. The date and time of subsequent calls by the same customer for the same trouble are recorded in associated Activity Records. + @param estimatedRestoreDateTime: Estimated restoration date and time last provided to the customer. + @param informBeforeRestored: True if person reporting trouble requested a call back when sigificant information became available about cause of the outage and the estimated restoration time. The person and their contact information are maintained in the assoicated Customer information. Call back results are recorded in assoicated 'ActivityRecord.Status.remarks'. + @param reportingKind: Means the customer used to report trouble (default is 'call'). Values are: "email", "call", "letter", "other" + @param priority: Priority of trouble call. + @param informAfterRestored: True if person reporting trouble requested a call back to confirm power has been restored. The person and their contact information is maintained in the assoicated Customer informaiton. Call back results are recorded in assoicated 'ActivityRecord.Status.remarks'. + @param advice: True if advice already given to the customer at time when trouble was first reported. + @param hazardCode: Code for a reported hazard condition. + @param callBack: True if requested to customer when someone is about to arrive at their premises. + @param CallBacks: + @param troublePeriod: Period between this source of trouble started and was resolved. + @param CustomerData: + @param IncidentRecord: + """ + #: Date and time trouble call first received. The date and time of subsequent calls by the same customer for the same trouble are recorded in associated Activity Records. + self.firstCallDateTime = firstCallDateTime + + #: Estimated restoration date and time last provided to the customer. + self.estimatedRestoreDateTime = estimatedRestoreDateTime + + #: True if person reporting trouble requested a call back when sigificant information became available about cause of the outage and the estimated restoration time. The person and their contact information are maintained in the assoicated Customer information. Call back results are recorded in assoicated 'ActivityRecord.Status.remarks'. + self.informBeforeRestored = informBeforeRestored + + #: Means the customer used to report trouble (default is 'call'). Values are: "email", "call", "letter", "other" + self.reportingKind = reportingKind + + #: Priority of trouble call. + self.priority = priority + + #: True if person reporting trouble requested a call back to confirm power has been restored. The person and their contact information is maintained in the assoicated Customer informaiton. Call back results are recorded in assoicated 'ActivityRecord.Status.remarks'. + self.informAfterRestored = informAfterRestored + + #: True if advice already given to the customer at time when trouble was first reported. + self.advice = advice + + #: Code for a reported hazard condition. + self.hazardCode = hazardCode + + #: True if requested to customer when someone is about to arrive at their premises. + self.callBack = callBack + + self._CallBacks = [] + self.CallBacks = [] if CallBacks is None else CallBacks + + self.troublePeriod = troublePeriod + + self._CustomerData = None + self.CustomerData = CustomerData + + self._IncidentRecord = None + self.IncidentRecord = IncidentRecord + + super(TroubleTicket, self).__init__(*args, **kw_args) + + _attrs = ["firstCallDateTime", "estimatedRestoreDateTime", "informBeforeRestored", "reportingKind", "priority", "informAfterRestored", "advice", "hazardCode", "callBack"] + _attr_types = {"firstCallDateTime": str, "estimatedRestoreDateTime": str, "informBeforeRestored": bool, "reportingKind": str, "priority": str, "informAfterRestored": bool, "advice": str, "hazardCode": str, "callBack": bool} + _defaults = {"firstCallDateTime": '', "estimatedRestoreDateTime": '', "informBeforeRestored": False, "reportingKind": "email", "priority": '', "informAfterRestored": False, "advice": '', "hazardCode": '', "callBack": False} + _enums = {"reportingKind": "TroubleReportingKind"} + _refs = ["CallBacks", "troublePeriod", "CustomerData", "IncidentRecord"] + _many_refs = ["CallBacks"] + + def getCallBacks(self): + + return self._CallBacks + + def setCallBacks(self, value): + for p in self._CallBacks: + filtered = [q for q in p.TroubleTickets if q != self] + self._CallBacks._TroubleTickets = filtered + for r in value: + if self not in r._TroubleTickets: + r._TroubleTickets.append(self) + self._CallBacks = value + + CallBacks = property(getCallBacks, setCallBacks) + + def addCallBacks(self, *CallBacks): + for obj in CallBacks: + if self not in obj._TroubleTickets: + obj._TroubleTickets.append(self) + self._CallBacks.append(obj) + + def removeCallBacks(self, *CallBacks): + for obj in CallBacks: + if self in obj._TroubleTickets: + obj._TroubleTickets.remove(self) + self._CallBacks.remove(obj) + + # Period between this source of trouble started and was resolved. + troublePeriod = None + + def getCustomerData(self): + + return self._CustomerData + + def setCustomerData(self, value): + if self._CustomerData is not None: + filtered = [x for x in self.CustomerData.TroubleTickets if x != self] + self._CustomerData._TroubleTickets = filtered + + self._CustomerData = value + if self._CustomerData is not None: + if self not in self._CustomerData._TroubleTickets: + self._CustomerData._TroubleTickets.append(self) + + CustomerData = property(getCustomerData, setCustomerData) + + def getIncidentRecord(self): + + return self._IncidentRecord + + def setIncidentRecord(self, value): + if self._IncidentRecord is not None: + filtered = [x for x in self.IncidentRecord.TroubleTickets if x != self] + self._IncidentRecord._TroubleTickets = filtered + + self._IncidentRecord = value + if self._IncidentRecord is not None: + if self not in self._IncidentRecord._TroubleTickets: + self._IncidentRecord._TroubleTickets.append(self) + + IncidentRecord = property(getIncidentRecord, setIncidentRecord) + diff --git a/CIM16/IEC61970/Informative/InfOperations/__init__.py b/CIM16/IEC61970/Informative/InfOperations/__init__.py new file mode 100755 index 00000000..cdef03aa --- /dev/null +++ b/CIM16/IEC61970/Informative/InfOperations/__init__.py @@ -0,0 +1,81 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""TODO: The following has been copied from a very old version of draft Part 11, so the references are wrong, but we store the knowledge here to reuse later: 'The Documentation package is used for the modeling of business documents. Some of these may be electronic realizations of legacy paper document, and some may be electronic information exchanges or collections. Documents will typically reference or describe one or more CIM objects. The DataSets package is used to describe documents tyically used for exchange of collections of object descriptions (e.g., NetworkDataSet). The operational package is used to define documents related to distribution operations business processes (e.g., OperationalRestriction, SwitchingSchedule). TroubleTickets are used by Customers to report problems related to the elctrical distribution network. TroubleTickets may be grouped and be related to a PlannedOutage, OutageNotification and/or PowerSystemResource. The Outage package defines classes related to outage management (OutageStep, OutageRecord, OutageReport).' +""" + +from CIM16.IEC61970.Informative.InfOperations.OutageRecord import OutageRecord +from CIM16.IEC61970.Informative.InfOperations.OutageReport import OutageReport +from CIM16.IEC61970.Informative.InfOperations.ChangeItem import ChangeItem +from CIM16.IEC61970.Informative.InfOperations.PSREvent import PSREvent +from CIM16.IEC61970.Informative.InfOperations.PlannedOutage import PlannedOutage +from CIM16.IEC61970.Informative.InfOperations.CircuitSection import CircuitSection +from CIM16.IEC61970.Informative.InfOperations.SafetyDocument import SafetyDocument +from CIM16.IEC61970.Informative.InfOperations.OperationalRestriction import OperationalRestriction +from CIM16.IEC61970.Informative.InfOperations.ChangeSet import ChangeSet +from CIM16.IEC61970.Informative.InfOperations.SwitchingSchedule import SwitchingSchedule +from CIM16.IEC61970.Informative.InfOperations.Circuit import Circuit +from CIM16.IEC61970.Informative.InfOperations.NetworkDataSet import NetworkDataSet +from CIM16.IEC61970.Informative.InfOperations.OutageStep import OutageStep +from CIM16.IEC61970.Informative.InfOperations.OrgPsrRole import OrgPsrRole +from CIM16.IEC61970.Informative.InfOperations.OutageCode import OutageCode +from CIM16.IEC61970.Informative.InfOperations.IncidentCode import IncidentCode +from CIM16.IEC61970.Informative.InfOperations.LandBase import LandBase +from CIM16.IEC61970.Informative.InfOperations.ErpPersonScheduleStepRole import ErpPersonScheduleStepRole +from CIM16.IEC61970.Informative.InfOperations.SwitchingStep import SwitchingStep +from CIM16.IEC61970.Informative.InfOperations.CallBack import CallBack +from CIM16.IEC61970.Informative.InfOperations.TroubleTicket import TroubleTicket +from CIM16.IEC61970.Informative.InfOperations.IncidentRecord import IncidentRecord +from CIM16.IEC61970.Informative.InfOperations.OutageNotification import OutageNotification +from CIM16.IEC61970.Informative.InfOperations.OutageStepPsrRole import OutageStepPsrRole + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#InfOperations" +nsPrefix = "cimInfOperations" + + +class SwitchingStepStatusKind(str): + """Values are: instructed, confirmed, proposed, aborted, skipped + """ + pass + +class CircuitConnectionKind(str): + """Values are: electricallyConnected, nominallyConnected, asBuilt, other + """ + pass + +class PSREventKind(str): + """Values are: pendingRemove, pendingReplace, outOfService, pendingAdd, unknown, inService, other + """ + pass + +class TroubleReportingKind(str): + """Values are: email, call, letter, other + """ + pass + +class ChangeItemKind(str): + """Values are: add, modify, delete + """ + pass + +class OutageKind(str): + """Values are: fixed, flexible, forced + """ + pass diff --git a/CIM16/IEC61970/Informative/InfTypeAsset/GeneratorTypeAsset.py b/CIM16/IEC61970/Informative/InfTypeAsset/GeneratorTypeAsset.py new file mode 100755 index 00000000..b76044da --- /dev/null +++ b/CIM16/IEC61970/Informative/InfTypeAsset/GeneratorTypeAsset.py @@ -0,0 +1,103 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfAssets.GenericAssetModelOrMaterial import GenericAssetModelOrMaterial + +class GeneratorTypeAsset(GenericAssetModelOrMaterial): + """Documentation for generic generation equipment that may be used for various purposes such as work planning. It defines both the Real and Reactive power properties (modelled at the PSR level as a GeneratingUnit + SynchronousMachine)Documentation for generic generation equipment that may be used for various purposes such as work planning. It defines both the Real and Reactive power properties (modelled at the PSR level as a GeneratingUnit + SynchronousMachine) + """ + + def __init__(self, xDirectSync=0.0, rQuadSubtrans=0.0, rDirectSync=0.0, rDirectSubtrans=0.0, maxQ=0.0, xQuadSync=0.0, minQ=0.0, minP=0.0, maxP=0.0, rQuadSync=0.0, xQuadSubtrans=0.0, rDirectTrans=0.0, rQuadTrans=0.0, xDirectSubtrans=0.0, xDirectTrans=0.0, xQuadTrans=0.0, *args, **kw_args): + """Initialises a new 'GeneratorTypeAsset' instance. + + @param xDirectSync: Direct-axis synchronous reactance + @param rQuadSubtrans: Quadrature-axis subtransient resistance + @param rDirectSync: Direct-axis synchronous resistance + @param rDirectSubtrans: Direct-axis subtransient resistance + @param maxQ: Maximum reactive power limit. + @param xQuadSync: Quadrature-axis synchronous reactance + @param minQ: Minimum reactive power generated. + @param minP: Minimum real power generated. + @param maxP: Maximum real power limit. + @param rQuadSync: Quadrature-axis synchronous resistance + @param xQuadSubtrans: Quadrature-axis subtransient reactance + @param rDirectTrans: Direct-axis Transient resistance + @param rQuadTrans: Quadrature-axis Transient resistance + @param xDirectSubtrans: Direct-axis subtransient reactance + @param xDirectTrans: Direct-axis Transient reactance + @param xQuadTrans: Quadrature-axis transient reactance. + """ + #: Direct-axis synchronous reactance + self.xDirectSync = xDirectSync + + #: Quadrature-axis subtransient resistance + self.rQuadSubtrans = rQuadSubtrans + + #: Direct-axis synchronous resistance + self.rDirectSync = rDirectSync + + #: Direct-axis subtransient resistance + self.rDirectSubtrans = rDirectSubtrans + + #: Maximum reactive power limit. + self.maxQ = maxQ + + #: Quadrature-axis synchronous reactance + self.xQuadSync = xQuadSync + + #: Minimum reactive power generated. + self.minQ = minQ + + #: Minimum real power generated. + self.minP = minP + + #: Maximum real power limit. + self.maxP = maxP + + #: Quadrature-axis synchronous resistance + self.rQuadSync = rQuadSync + + #: Quadrature-axis subtransient reactance + self.xQuadSubtrans = xQuadSubtrans + + #: Direct-axis Transient resistance + self.rDirectTrans = rDirectTrans + + #: Quadrature-axis Transient resistance + self.rQuadTrans = rQuadTrans + + #: Direct-axis subtransient reactance + self.xDirectSubtrans = xDirectSubtrans + + #: Direct-axis Transient reactance + self.xDirectTrans = xDirectTrans + + #: Quadrature-axis transient reactance. + self.xQuadTrans = xQuadTrans + + super(GeneratorTypeAsset, self).__init__(*args, **kw_args) + + _attrs = ["xDirectSync", "rQuadSubtrans", "rDirectSync", "rDirectSubtrans", "maxQ", "xQuadSync", "minQ", "minP", "maxP", "rQuadSync", "xQuadSubtrans", "rDirectTrans", "rQuadTrans", "xDirectSubtrans", "xDirectTrans", "xQuadTrans"] + _attr_types = {"xDirectSync": float, "rQuadSubtrans": float, "rDirectSync": float, "rDirectSubtrans": float, "maxQ": float, "xQuadSync": float, "minQ": float, "minP": float, "maxP": float, "rQuadSync": float, "xQuadSubtrans": float, "rDirectTrans": float, "rQuadTrans": float, "xDirectSubtrans": float, "xDirectTrans": float, "xQuadTrans": float} + _defaults = {"xDirectSync": 0.0, "rQuadSubtrans": 0.0, "rDirectSync": 0.0, "rDirectSubtrans": 0.0, "maxQ": 0.0, "xQuadSync": 0.0, "minQ": 0.0, "minP": 0.0, "maxP": 0.0, "rQuadSync": 0.0, "xQuadSubtrans": 0.0, "rDirectTrans": 0.0, "rQuadTrans": 0.0, "xDirectSubtrans": 0.0, "xDirectTrans": 0.0, "xQuadTrans": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfTypeAsset/TypeAssetCatalogue.py b/CIM16/IEC61970/Informative/InfTypeAsset/TypeAssetCatalogue.py new file mode 100755 index 00000000..1d08f814 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfTypeAsset/TypeAssetCatalogue.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TypeAssetCatalogue(IdentifiedObject): + """Catalogue of generic types of assets (TypeAsset) that may be used for design purposes. It is not associated with a particular manufacturer.Catalogue of generic types of assets (TypeAsset) that may be used for design purposes. It is not associated with a particular manufacturer. + """ + + def __init__(self, TypeAssets=None, status=None, *args, **kw_args): + """Initialises a new 'TypeAssetCatalogue' instance. + + @param TypeAssets: + @param status: + """ + self._TypeAssets = [] + self.TypeAssets = [] if TypeAssets is None else TypeAssets + + self.status = status + + super(TypeAssetCatalogue, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TypeAssets", "status"] + _many_refs = ["TypeAssets"] + + def getTypeAssets(self): + + return self._TypeAssets + + def setTypeAssets(self, value): + for x in self._TypeAssets: + x.TypeAssetCatalogue = None + for y in value: + y._TypeAssetCatalogue = self + self._TypeAssets = value + + TypeAssets = property(getTypeAssets, setTypeAssets) + + def addTypeAssets(self, *TypeAssets): + for obj in TypeAssets: + obj.TypeAssetCatalogue = self + + def removeTypeAssets(self, *TypeAssets): + for obj in TypeAssets: + obj.TypeAssetCatalogue = None + + status = None + diff --git a/CIM16/IEC61970/Informative/InfTypeAsset/__init__.py b/CIM16/IEC61970/Informative/InfTypeAsset/__init__.py new file mode 100755 index 00000000..c2eaaf58 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfTypeAsset/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +from CIM16.IEC61970.Informative.InfTypeAsset.TypeAssetCatalogue import TypeAssetCatalogue +from CIM16.IEC61970.Informative.InfTypeAsset.GeneratorTypeAsset import GeneratorTypeAsset + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#InfTypeAsset" +nsPrefix = "cimInfTypeAsset" + diff --git a/CIM16/IEC61970/Informative/InfWork/AccessPermit.py b/CIM16/IEC61970/Informative/InfWork/AccessPermit.py new file mode 100755 index 00000000..7283a7ff --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/AccessPermit.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class AccessPermit(Document): + """A permit is sometimes needed to provide legal access to land or equipment. For example, local authority permission for road works.A permit is sometimes needed to provide legal access to land or equipment. For example, local authority permission for road works. + """ + + def __init__(self, applicationNumber='', payment=0.0, effectiveDate='', expirationDate='', permitID='', *args, **kw_args): + """Initialises a new 'AccessPermit' instance. + + @param applicationNumber: Permit application number that is used by municipality, state, province, etc. + @param payment: Total cost of permit. + @param effectiveDate: Date that permit became official. + @param expirationDate: Permit expiration date. + @param permitID: Permit identifier. + """ + #: Permit application number that is used by municipality, state, province, etc. + self.applicationNumber = applicationNumber + + #: Total cost of permit. + self.payment = payment + + #: Date that permit became official. + self.effectiveDate = effectiveDate + + #: Permit expiration date. + self.expirationDate = expirationDate + + #: Permit identifier. + self.permitID = permitID + + super(AccessPermit, self).__init__(*args, **kw_args) + + _attrs = ["applicationNumber", "payment", "effectiveDate", "expirationDate", "permitID"] + _attr_types = {"applicationNumber": str, "payment": float, "effectiveDate": str, "expirationDate": str, "permitID": str} + _defaults = {"applicationNumber": '', "payment": 0.0, "effectiveDate": '', "expirationDate": '', "permitID": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfWork/Appointment.py b/CIM16/IEC61970/Informative/InfWork/Appointment.py new file mode 100755 index 00000000..66acba09 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/Appointment.py @@ -0,0 +1,110 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfCommon.ScheduledEvent import ScheduledEvent + +class Appointment(ScheduledEvent): + """Meeting time and location.Meeting time and location. + """ + + def __init__(self, callAhead=False, remark='', address=None, ErpPersons=None, meetingInterval=None, CallBack=None, *args, **kw_args): + """Initialises a new 'Appointment' instance. + + @param callAhead: True if requested to call customer when someone is about to arrive at their premises. + @param remark: Information about the appointment. + @param address: Address for appointment. + @param ErpPersons: + @param meetingInterval: Date and time reserved for appointment. + @param CallBack: + """ + #: True if requested to call customer when someone is about to arrive at their premises. + self.callAhead = callAhead + + #: Information about the appointment. + self.remark = remark + + self.address = address + + self._ErpPersons = [] + self.ErpPersons = [] if ErpPersons is None else ErpPersons + + self.meetingInterval = meetingInterval + + self._CallBack = None + self.CallBack = CallBack + + super(Appointment, self).__init__(*args, **kw_args) + + _attrs = ["callAhead", "remark"] + _attr_types = {"callAhead": bool, "remark": str} + _defaults = {"callAhead": False, "remark": ''} + _enums = {} + _refs = ["address", "ErpPersons", "meetingInterval", "CallBack"] + _many_refs = ["ErpPersons"] + + # Address for appointment. + address = None + + def getErpPersons(self): + + return self._ErpPersons + + def setErpPersons(self, value): + for p in self._ErpPersons: + filtered = [q for q in p.Appointments if q != self] + self._ErpPersons._Appointments = filtered + for r in value: + if self not in r._Appointments: + r._Appointments.append(self) + self._ErpPersons = value + + ErpPersons = property(getErpPersons, setErpPersons) + + def addErpPersons(self, *ErpPersons): + for obj in ErpPersons: + if self not in obj._Appointments: + obj._Appointments.append(self) + self._ErpPersons.append(obj) + + def removeErpPersons(self, *ErpPersons): + for obj in ErpPersons: + if self in obj._Appointments: + obj._Appointments.remove(self) + self._ErpPersons.remove(obj) + + # Date and time reserved for appointment. + meetingInterval = None + + def getCallBack(self): + + return self._CallBack + + def setCallBack(self, value): + if self._CallBack is not None: + filtered = [x for x in self.CallBack.Appointments if x != self] + self._CallBack._Appointments = filtered + + self._CallBack = value + if self._CallBack is not None: + if self not in self._CallBack._Appointments: + self._CallBack._Appointments.append(self) + + CallBack = property(getCallBack, setCallBack) + diff --git a/CIM16/IEC61970/Informative/InfWork/Assignment.py b/CIM16/IEC61970/Informative/InfWork/Assignment.py new file mode 100755 index 00000000..f6a020ff --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/Assignment.py @@ -0,0 +1,77 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class Assignment(Document): + """An assignment is given to an ErpPerson, Crew, Organisation, Equipment Item, Tool, etc. and may be used to perform Work, WorkTasks, Procedures, etc. TimeSchedules may be set up directly for Assignments or indirectly via the associated WorkTask. Note that these associations are all inherited through the recursive relationship on Document.An assignment is given to an ErpPerson, Crew, Organisation, Equipment Item, Tool, etc. and may be used to perform Work, WorkTasks, Procedures, etc. TimeSchedules may be set up directly for Assignments or indirectly via the associated WorkTask. Note that these associations are all inherited through the recursive relationship on Document. + """ + + def __init__(self, Crews=None, effectivePeriod=None, *args, **kw_args): + """Initialises a new 'Assignment' instance. + + @param Crews: All Crews having this Assignment. + @param effectivePeriod: Period between the assignment becoming effective and its expiration. + """ + self._Crews = [] + self.Crews = [] if Crews is None else Crews + + self.effectivePeriod = effectivePeriod + + super(Assignment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Crews", "effectivePeriod"] + _many_refs = ["Crews"] + + def getCrews(self): + """All Crews having this Assignment. + """ + return self._Crews + + def setCrews(self, value): + for p in self._Crews: + filtered = [q for q in p.Assignments if q != self] + self._Crews._Assignments = filtered + for r in value: + if self not in r._Assignments: + r._Assignments.append(self) + self._Crews = value + + Crews = property(getCrews, setCrews) + + def addCrews(self, *Crews): + for obj in Crews: + if self not in obj._Assignments: + obj._Assignments.append(self) + self._Crews.append(obj) + + def removeCrews(self, *Crews): + for obj in Crews: + if self in obj._Assignments: + obj._Assignments.remove(self) + self._Crews.remove(obj) + + # Period between the assignment becoming effective and its expiration. + effectivePeriod = None + diff --git a/CIM16/IEC61970/Informative/InfWork/BusinessCase.py b/CIM16/IEC61970/Informative/InfWork/BusinessCase.py new file mode 100755 index 00000000..2a037eb9 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/BusinessCase.py @@ -0,0 +1,93 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class BusinessCase(Document): + """Business justification for capital expenditures, usually addressing operations and maintenance costs as well.Business justification for capital expenditures, usually addressing operations and maintenance costs as well. + """ + + def __init__(self, corporateCode='', Projects=None, Works=None, *args, **kw_args): + """Initialises a new 'BusinessCase' instance. + + @param corporateCode: A codified representation of the business case (i.e., codes for highway relocation, replace substation transformers, etc.). + @param Projects: + @param Works: + """ + #: A codified representation of the business case (i.e., codes for highway relocation, replace substation transformers, etc.). + self.corporateCode = corporateCode + + self._Projects = [] + self.Projects = [] if Projects is None else Projects + + self._Works = [] + self.Works = [] if Works is None else Works + + super(BusinessCase, self).__init__(*args, **kw_args) + + _attrs = ["corporateCode"] + _attr_types = {"corporateCode": str} + _defaults = {"corporateCode": ''} + _enums = {} + _refs = ["Projects", "Works"] + _many_refs = ["Projects", "Works"] + + def getProjects(self): + + return self._Projects + + def setProjects(self, value): + for x in self._Projects: + x.BusinessCase = None + for y in value: + y._BusinessCase = self + self._Projects = value + + Projects = property(getProjects, setProjects) + + def addProjects(self, *Projects): + for obj in Projects: + obj.BusinessCase = self + + def removeProjects(self, *Projects): + for obj in Projects: + obj.BusinessCase = None + + def getWorks(self): + + return self._Works + + def setWorks(self, value): + for x in self._Works: + x.BusinessCase = None + for y in value: + y._BusinessCase = self + self._Works = value + + Works = property(getWorks, setWorks) + + def addWorks(self, *Works): + for obj in Works: + obj.BusinessCase = self + + def removeWorks(self, *Works): + for obj in Works: + obj.BusinessCase = None + diff --git a/CIM16/IEC61970/Informative/InfWork/CUAllowableAction.py b/CIM16/IEC61970/Informative/InfWork/CUAllowableAction.py new file mode 100755 index 00000000..f830557a --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/CUAllowableAction.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class CUAllowableAction(IdentifiedObject): + """Allowed actions: Install, Remove, Transfer, Abandon, etc.Allowed actions: Install, Remove, Transfer, Abandon, etc. + """ + + def __init__(self, CompatibleUnits=None, status=None, *args, **kw_args): + """Initialises a new 'CUAllowableAction' instance. + + @param CompatibleUnits: + @param status: + """ + self._CompatibleUnits = [] + self.CompatibleUnits = [] if CompatibleUnits is None else CompatibleUnits + + self.status = status + + super(CUAllowableAction, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["CompatibleUnits", "status"] + _many_refs = ["CompatibleUnits"] + + def getCompatibleUnits(self): + + return self._CompatibleUnits + + def setCompatibleUnits(self, value): + for x in self._CompatibleUnits: + x.CUAllowableAction = None + for y in value: + y._CUAllowableAction = self + self._CompatibleUnits = value + + CompatibleUnits = property(getCompatibleUnits, setCompatibleUnits) + + def addCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + obj.CUAllowableAction = self + + def removeCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + obj.CUAllowableAction = None + + status = None + diff --git a/CIM16/IEC61970/Informative/InfWork/CUAsset.py b/CIM16/IEC61970/Informative/InfWork/CUAsset.py new file mode 100755 index 00000000..71c77d75 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/CUAsset.py @@ -0,0 +1,102 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class CUAsset(IdentifiedObject): + """Compatible unit for various types of assets such as transformers switches, substation fences, poles, etc..Compatible unit for various types of assets such as transformers switches, substation fences, poles, etc.. + """ + + def __init__(self, quantity="", typeAssetCode='', CompatibleUnits=None, TypeAsset=None, status=None, *args, **kw_args): + """Initialises a new 'CUAsset' instance. + + @param quantity: Quantity of the type asset within the CU. + @param typeAssetCode: The code for this type of asset. + @param CompatibleUnits: + @param TypeAsset: + @param status: + """ + #: Quantity of the type asset within the CU. + self.quantity = quantity + + #: The code for this type of asset. + self.typeAssetCode = typeAssetCode + + self._CompatibleUnits = [] + self.CompatibleUnits = [] if CompatibleUnits is None else CompatibleUnits + + self._TypeAsset = None + self.TypeAsset = TypeAsset + + self.status = status + + super(CUAsset, self).__init__(*args, **kw_args) + + _attrs = ["quantity", "typeAssetCode"] + _attr_types = {"quantity": str, "typeAssetCode": str} + _defaults = {"quantity": "", "typeAssetCode": ''} + _enums = {} + _refs = ["CompatibleUnits", "TypeAsset", "status"] + _many_refs = ["CompatibleUnits"] + + def getCompatibleUnits(self): + + return self._CompatibleUnits + + def setCompatibleUnits(self, value): + for p in self._CompatibleUnits: + filtered = [q for q in p.CUAssets if q != self] + self._CompatibleUnits._CUAssets = filtered + for r in value: + if self not in r._CUAssets: + r._CUAssets.append(self) + self._CompatibleUnits = value + + CompatibleUnits = property(getCompatibleUnits, setCompatibleUnits) + + def addCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + if self not in obj._CUAssets: + obj._CUAssets.append(self) + self._CompatibleUnits.append(obj) + + def removeCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + if self in obj._CUAssets: + obj._CUAssets.remove(self) + self._CompatibleUnits.remove(obj) + + def getTypeAsset(self): + + return self._TypeAsset + + def setTypeAsset(self, value): + if self._TypeAsset is not None: + self._TypeAsset._CUAsset = None + + self._TypeAsset = value + if self._TypeAsset is not None: + self._TypeAsset.CUAsset = None + self._TypeAsset._CUAsset = self + + TypeAsset = property(getTypeAsset, setTypeAsset) + + status = None + diff --git a/CIM16/IEC61970/Informative/InfWork/CUContractorItem.py b/CIM16/IEC61970/Informative/InfWork/CUContractorItem.py new file mode 100755 index 00000000..b293b712 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/CUContractorItem.py @@ -0,0 +1,83 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class CUContractorItem(IdentifiedObject): + """Compatible unit contractor item.Compatible unit contractor item. + """ + + def __init__(self, bidAmount=0.0, activityCode='', CompatibleUnits=None, status=None, *args, **kw_args): + """Initialises a new 'CUContractorItem' instance. + + @param bidAmount: The amount that a given contractor will charge for performing this unit of work. + @param activityCode: Activity code identifies a specific and distinguishable unit of work. + @param CompatibleUnits: + @param status: + """ + #: The amount that a given contractor will charge for performing this unit of work. + self.bidAmount = bidAmount + + #: Activity code identifies a specific and distinguishable unit of work. + self.activityCode = activityCode + + self._CompatibleUnits = [] + self.CompatibleUnits = [] if CompatibleUnits is None else CompatibleUnits + + self.status = status + + super(CUContractorItem, self).__init__(*args, **kw_args) + + _attrs = ["bidAmount", "activityCode"] + _attr_types = {"bidAmount": float, "activityCode": str} + _defaults = {"bidAmount": 0.0, "activityCode": ''} + _enums = {} + _refs = ["CompatibleUnits", "status"] + _many_refs = ["CompatibleUnits"] + + def getCompatibleUnits(self): + + return self._CompatibleUnits + + def setCompatibleUnits(self, value): + for p in self._CompatibleUnits: + filtered = [q for q in p.CUContractorItems if q != self] + self._CompatibleUnits._CUContractorItems = filtered + for r in value: + if self not in r._CUContractorItems: + r._CUContractorItems.append(self) + self._CompatibleUnits = value + + CompatibleUnits = property(getCompatibleUnits, setCompatibleUnits) + + def addCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + if self not in obj._CUContractorItems: + obj._CUContractorItems.append(self) + self._CompatibleUnits.append(obj) + + def removeCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + if self in obj._CUContractorItems: + obj._CUContractorItems.remove(self) + self._CompatibleUnits.remove(obj) + + status = None + diff --git a/CIM16/IEC61970/Informative/InfWork/CUGroup.py b/CIM16/IEC61970/Informative/InfWork/CUGroup.py new file mode 100755 index 00000000..5955ab44 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/CUGroup.py @@ -0,0 +1,162 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class CUGroup(IdentifiedObject): + """A Compatible Unit Group identifies a set of compatible units which may be jointly utilized for estimating and designating jobs.A Compatible Unit Group identifies a set of compatible units which may be jointly utilized for estimating and designating jobs. + """ + + def __init__(self, CompatibleUnits=None, ParentCUGroups=None, ChildCUGroups=None, status=None, DesignLocationCUs=None, *args, **kw_args): + """Initialises a new 'CUGroup' instance. + + @param CompatibleUnits: + @param ParentCUGroups: + @param ChildCUGroups: + @param status: + @param DesignLocationCUs: + """ + self._CompatibleUnits = [] + self.CompatibleUnits = [] if CompatibleUnits is None else CompatibleUnits + + self._ParentCUGroups = [] + self.ParentCUGroups = [] if ParentCUGroups is None else ParentCUGroups + + self._ChildCUGroups = [] + self.ChildCUGroups = [] if ChildCUGroups is None else ChildCUGroups + + self.status = status + + self._DesignLocationCUs = [] + self.DesignLocationCUs = [] if DesignLocationCUs is None else DesignLocationCUs + + super(CUGroup, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["CompatibleUnits", "ParentCUGroups", "ChildCUGroups", "status", "DesignLocationCUs"] + _many_refs = ["CompatibleUnits", "ParentCUGroups", "ChildCUGroups", "DesignLocationCUs"] + + def getCompatibleUnits(self): + + return self._CompatibleUnits + + def setCompatibleUnits(self, value): + for x in self._CompatibleUnits: + x.CUGroup = None + for y in value: + y._CUGroup = self + self._CompatibleUnits = value + + CompatibleUnits = property(getCompatibleUnits, setCompatibleUnits) + + def addCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + obj.CUGroup = self + + def removeCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + obj.CUGroup = None + + def getParentCUGroups(self): + + return self._ParentCUGroups + + def setParentCUGroups(self, value): + for p in self._ParentCUGroups: + filtered = [q for q in p.ChildCUGroups if q != self] + self._ParentCUGroups._ChildCUGroups = filtered + for r in value: + if self not in r._ChildCUGroups: + r._ChildCUGroups.append(self) + self._ParentCUGroups = value + + ParentCUGroups = property(getParentCUGroups, setParentCUGroups) + + def addParentCUGroups(self, *ParentCUGroups): + for obj in ParentCUGroups: + if self not in obj._ChildCUGroups: + obj._ChildCUGroups.append(self) + self._ParentCUGroups.append(obj) + + def removeParentCUGroups(self, *ParentCUGroups): + for obj in ParentCUGroups: + if self in obj._ChildCUGroups: + obj._ChildCUGroups.remove(self) + self._ParentCUGroups.remove(obj) + + def getChildCUGroups(self): + + return self._ChildCUGroups + + def setChildCUGroups(self, value): + for p in self._ChildCUGroups: + filtered = [q for q in p.ParentCUGroups if q != self] + self._ChildCUGroups._ParentCUGroups = filtered + for r in value: + if self not in r._ParentCUGroups: + r._ParentCUGroups.append(self) + self._ChildCUGroups = value + + ChildCUGroups = property(getChildCUGroups, setChildCUGroups) + + def addChildCUGroups(self, *ChildCUGroups): + for obj in ChildCUGroups: + if self not in obj._ParentCUGroups: + obj._ParentCUGroups.append(self) + self._ChildCUGroups.append(obj) + + def removeChildCUGroups(self, *ChildCUGroups): + for obj in ChildCUGroups: + if self in obj._ParentCUGroups: + obj._ParentCUGroups.remove(self) + self._ChildCUGroups.remove(obj) + + status = None + + def getDesignLocationCUs(self): + + return self._DesignLocationCUs + + def setDesignLocationCUs(self, value): + for p in self._DesignLocationCUs: + filtered = [q for q in p.CUGroups if q != self] + self._DesignLocationCUs._CUGroups = filtered + for r in value: + if self not in r._CUGroups: + r._CUGroups.append(self) + self._DesignLocationCUs = value + + DesignLocationCUs = property(getDesignLocationCUs, setDesignLocationCUs) + + def addDesignLocationCUs(self, *DesignLocationCUs): + for obj in DesignLocationCUs: + if self not in obj._CUGroups: + obj._CUGroups.append(self) + self._DesignLocationCUs.append(obj) + + def removeDesignLocationCUs(self, *DesignLocationCUs): + for obj in DesignLocationCUs: + if self in obj._CUGroups: + obj._CUGroups.remove(self) + self._DesignLocationCUs.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfWork/CULaborCode.py b/CIM16/IEC61970/Informative/InfWork/CULaborCode.py new file mode 100755 index 00000000..379465a4 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/CULaborCode.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class CULaborCode(IdentifiedObject): + """Labor code associated with various compatible unit labor items.Labor code associated with various compatible unit labor items. + """ + + def __init__(self, code='', CULaborItems=None, status=None, *args, **kw_args): + """Initialises a new 'CULaborCode' instance. + + @param code: Labor code. + @param CULaborItems: + @param status: + """ + #: Labor code. + self.code = code + + self._CULaborItems = [] + self.CULaborItems = [] if CULaborItems is None else CULaborItems + + self.status = status + + super(CULaborCode, self).__init__(*args, **kw_args) + + _attrs = ["code"] + _attr_types = {"code": str} + _defaults = {"code": ''} + _enums = {} + _refs = ["CULaborItems", "status"] + _many_refs = ["CULaborItems"] + + def getCULaborItems(self): + + return self._CULaborItems + + def setCULaborItems(self, value): + for x in self._CULaborItems: + x.CULaborCode = None + for y in value: + y._CULaborCode = self + self._CULaborItems = value + + CULaborItems = property(getCULaborItems, setCULaborItems) + + def addCULaborItems(self, *CULaborItems): + for obj in CULaborItems: + obj.CULaborCode = self + + def removeCULaborItems(self, *CULaborItems): + for obj in CULaborItems: + obj.CULaborCode = None + + status = None + diff --git a/CIM16/IEC61970/Informative/InfWork/CULaborItem.py b/CIM16/IEC61970/Informative/InfWork/CULaborItem.py new file mode 100755 index 00000000..37e7b937 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/CULaborItem.py @@ -0,0 +1,138 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class CULaborItem(IdentifiedObject): + """Compatible unit labor item.Compatible unit labor item. + """ + + def __init__(self, laborDuration=0.0, laborRate=0.0, activityCode='', CompatibleUnits=None, CULaborCode=None, status=None, QualificationRequirements=None, *args, **kw_args): + """Initialises a new 'CULaborItem' instance. + + @param laborDuration: Estimated time to perform work. + @param laborRate: The labor rate applied for work. + @param activityCode: Activity code identifies a specific and distinguishable unit of work. + @param CompatibleUnits: + @param CULaborCode: + @param status: + @param QualificationRequirements: + """ + #: Estimated time to perform work. + self.laborDuration = laborDuration + + #: The labor rate applied for work. + self.laborRate = laborRate + + #: Activity code identifies a specific and distinguishable unit of work. + self.activityCode = activityCode + + self._CompatibleUnits = [] + self.CompatibleUnits = [] if CompatibleUnits is None else CompatibleUnits + + self._CULaborCode = None + self.CULaborCode = CULaborCode + + self.status = status + + self._QualificationRequirements = [] + self.QualificationRequirements = [] if QualificationRequirements is None else QualificationRequirements + + super(CULaborItem, self).__init__(*args, **kw_args) + + _attrs = ["laborDuration", "laborRate", "activityCode"] + _attr_types = {"laborDuration": float, "laborRate": float, "activityCode": str} + _defaults = {"laborDuration": 0.0, "laborRate": 0.0, "activityCode": ''} + _enums = {} + _refs = ["CompatibleUnits", "CULaborCode", "status", "QualificationRequirements"] + _many_refs = ["CompatibleUnits", "QualificationRequirements"] + + def getCompatibleUnits(self): + + return self._CompatibleUnits + + def setCompatibleUnits(self, value): + for p in self._CompatibleUnits: + filtered = [q for q in p.CULaborItems if q != self] + self._CompatibleUnits._CULaborItems = filtered + for r in value: + if self not in r._CULaborItems: + r._CULaborItems.append(self) + self._CompatibleUnits = value + + CompatibleUnits = property(getCompatibleUnits, setCompatibleUnits) + + def addCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + if self not in obj._CULaborItems: + obj._CULaborItems.append(self) + self._CompatibleUnits.append(obj) + + def removeCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + if self in obj._CULaborItems: + obj._CULaborItems.remove(self) + self._CompatibleUnits.remove(obj) + + def getCULaborCode(self): + + return self._CULaborCode + + def setCULaborCode(self, value): + if self._CULaborCode is not None: + filtered = [x for x in self.CULaborCode.CULaborItems if x != self] + self._CULaborCode._CULaborItems = filtered + + self._CULaborCode = value + if self._CULaborCode is not None: + if self not in self._CULaborCode._CULaborItems: + self._CULaborCode._CULaborItems.append(self) + + CULaborCode = property(getCULaborCode, setCULaborCode) + + status = None + + def getQualificationRequirements(self): + + return self._QualificationRequirements + + def setQualificationRequirements(self, value): + for p in self._QualificationRequirements: + filtered = [q for q in p.CULaborItems if q != self] + self._QualificationRequirements._CULaborItems = filtered + for r in value: + if self not in r._CULaborItems: + r._CULaborItems.append(self) + self._QualificationRequirements = value + + QualificationRequirements = property(getQualificationRequirements, setQualificationRequirements) + + def addQualificationRequirements(self, *QualificationRequirements): + for obj in QualificationRequirements: + if self not in obj._CULaborItems: + obj._CULaborItems.append(self) + self._QualificationRequirements.append(obj) + + def removeQualificationRequirements(self, *QualificationRequirements): + for obj in QualificationRequirements: + if self in obj._CULaborItems: + obj._CULaborItems.remove(self) + self._QualificationRequirements.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfWork/CUMaterialItem.py b/CIM16/IEC61970/Informative/InfWork/CUMaterialItem.py new file mode 100755 index 00000000..463657a0 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/CUMaterialItem.py @@ -0,0 +1,134 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class CUMaterialItem(IdentifiedObject): + """Compatible unit of a consumable supply item. For example, nuts, bolts, brackets, glue, etc.Compatible unit of a consumable supply item. For example, nuts, bolts, brackets, glue, etc. + """ + + def __init__(self, quantity="", corporateCode='', status=None, PropertyUnits=None, CompatibleUnits=None, TypeMaterial=None, *args, **kw_args): + """Initialises a new 'CUMaterialItem' instance. + + @param quantity: Quantity of the TypeMaterial for this CU, used to determine estimated costs based on a per unit cost or a cost per unit length specified in the TypeMaterial. + @param corporateCode: Code for material. + @param status: + @param PropertyUnits: + @param CompatibleUnits: + @param TypeMaterial: + """ + #: Quantity of the TypeMaterial for this CU, used to determine estimated costs based on a per unit cost or a cost per unit length specified in the TypeMaterial. + self.quantity = quantity + + #: Code for material. + self.corporateCode = corporateCode + + self.status = status + + self._PropertyUnits = [] + self.PropertyUnits = [] if PropertyUnits is None else PropertyUnits + + self._CompatibleUnits = [] + self.CompatibleUnits = [] if CompatibleUnits is None else CompatibleUnits + + self._TypeMaterial = None + self.TypeMaterial = TypeMaterial + + super(CUMaterialItem, self).__init__(*args, **kw_args) + + _attrs = ["quantity", "corporateCode"] + _attr_types = {"quantity": str, "corporateCode": str} + _defaults = {"quantity": "", "corporateCode": ''} + _enums = {} + _refs = ["status", "PropertyUnits", "CompatibleUnits", "TypeMaterial"] + _many_refs = ["PropertyUnits", "CompatibleUnits"] + + status = None + + def getPropertyUnits(self): + + return self._PropertyUnits + + def setPropertyUnits(self, value): + for p in self._PropertyUnits: + filtered = [q for q in p.CUMaterialItems if q != self] + self._PropertyUnits._CUMaterialItems = filtered + for r in value: + if self not in r._CUMaterialItems: + r._CUMaterialItems.append(self) + self._PropertyUnits = value + + PropertyUnits = property(getPropertyUnits, setPropertyUnits) + + def addPropertyUnits(self, *PropertyUnits): + for obj in PropertyUnits: + if self not in obj._CUMaterialItems: + obj._CUMaterialItems.append(self) + self._PropertyUnits.append(obj) + + def removePropertyUnits(self, *PropertyUnits): + for obj in PropertyUnits: + if self in obj._CUMaterialItems: + obj._CUMaterialItems.remove(self) + self._PropertyUnits.remove(obj) + + def getCompatibleUnits(self): + + return self._CompatibleUnits + + def setCompatibleUnits(self, value): + for p in self._CompatibleUnits: + filtered = [q for q in p.CUMaterialItems if q != self] + self._CompatibleUnits._CUMaterialItems = filtered + for r in value: + if self not in r._CUMaterialItems: + r._CUMaterialItems.append(self) + self._CompatibleUnits = value + + CompatibleUnits = property(getCompatibleUnits, setCompatibleUnits) + + def addCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + if self not in obj._CUMaterialItems: + obj._CUMaterialItems.append(self) + self._CompatibleUnits.append(obj) + + def removeCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + if self in obj._CUMaterialItems: + obj._CUMaterialItems.remove(self) + self._CompatibleUnits.remove(obj) + + def getTypeMaterial(self): + + return self._TypeMaterial + + def setTypeMaterial(self, value): + if self._TypeMaterial is not None: + filtered = [x for x in self.TypeMaterial.CUMaterialItems if x != self] + self._TypeMaterial._CUMaterialItems = filtered + + self._TypeMaterial = value + if self._TypeMaterial is not None: + if self not in self._TypeMaterial._CUMaterialItems: + self._TypeMaterial._CUMaterialItems.append(self) + + TypeMaterial = property(getTypeMaterial, setTypeMaterial) + diff --git a/CIM16/IEC61970/Informative/InfWork/CUWorkEquipmentItem.py b/CIM16/IEC61970/Informative/InfWork/CUWorkEquipmentItem.py new file mode 100755 index 00000000..68a1b5b5 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/CUWorkEquipmentItem.py @@ -0,0 +1,102 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class CUWorkEquipmentItem(IdentifiedObject): + """Compatible unit for various types of WorkEquipmentAssets, including vehicles.Compatible unit for various types of WorkEquipmentAssets, including vehicles. + """ + + def __init__(self, rate=0.0, equipCode='', TypeAsset=None, status=None, CompatibleUnits=None, *args, **kw_args): + """Initialises a new 'CUWorkEquipmentItem' instance. + + @param rate: Standard usage rate for the type of vehicle. + @param equipCode: The equipment type code. + @param TypeAsset: + @param status: + @param CompatibleUnits: + """ + #: Standard usage rate for the type of vehicle. + self.rate = rate + + #: The equipment type code. + self.equipCode = equipCode + + self._TypeAsset = None + self.TypeAsset = TypeAsset + + self.status = status + + self._CompatibleUnits = [] + self.CompatibleUnits = [] if CompatibleUnits is None else CompatibleUnits + + super(CUWorkEquipmentItem, self).__init__(*args, **kw_args) + + _attrs = ["rate", "equipCode"] + _attr_types = {"rate": float, "equipCode": str} + _defaults = {"rate": 0.0, "equipCode": ''} + _enums = {} + _refs = ["TypeAsset", "status", "CompatibleUnits"] + _many_refs = ["CompatibleUnits"] + + def getTypeAsset(self): + + return self._TypeAsset + + def setTypeAsset(self, value): + if self._TypeAsset is not None: + self._TypeAsset._CUWorkEquipmentAsset = None + + self._TypeAsset = value + if self._TypeAsset is not None: + self._TypeAsset.CUWorkEquipmentAsset = None + self._TypeAsset._CUWorkEquipmentAsset = self + + TypeAsset = property(getTypeAsset, setTypeAsset) + + status = None + + def getCompatibleUnits(self): + + return self._CompatibleUnits + + def setCompatibleUnits(self, value): + for p in self._CompatibleUnits: + filtered = [q for q in p.CUWorkEquipmentItems if q != self] + self._CompatibleUnits._CUWorkEquipmentItems = filtered + for r in value: + if self not in r._CUWorkEquipmentItems: + r._CUWorkEquipmentItems.append(self) + self._CompatibleUnits = value + + CompatibleUnits = property(getCompatibleUnits, setCompatibleUnits) + + def addCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + if self not in obj._CUWorkEquipmentItems: + obj._CUWorkEquipmentItems.append(self) + self._CompatibleUnits.append(obj) + + def removeCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + if self in obj._CUWorkEquipmentItems: + obj._CUWorkEquipmentItems.remove(self) + self._CompatibleUnits.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfWork/Capability.py b/CIM16/IEC61970/Informative/InfWork/Capability.py new file mode 100755 index 00000000..e54b7d57 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/Capability.py @@ -0,0 +1,140 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Capability(IdentifiedObject): + """Capabilities of a crew.Capabilities of a crew. + """ + + def __init__(self, category='', performanceFactor='', Crew=None, WorkTasks=None, status=None, Crafts=None, validityInterval=None, *args, **kw_args): + """Initialises a new 'Capability' instance. + + @param category: Category by utility's work management standards and practices. + @param performanceFactor: Capability performance factor. + @param Crew: + @param WorkTasks: + @param status: + @param Crafts: + @param validityInterval: Date and time interval for which this capability is valid (when it became effective and when it expires). + """ + #: Category by utility's work management standards and practices. + self.category = category + + #: Capability performance factor. + self.performanceFactor = performanceFactor + + self._Crew = None + self.Crew = Crew + + self._WorkTasks = [] + self.WorkTasks = [] if WorkTasks is None else WorkTasks + + self.status = status + + self._Crafts = [] + self.Crafts = [] if Crafts is None else Crafts + + self.validityInterval = validityInterval + + super(Capability, self).__init__(*args, **kw_args) + + _attrs = ["category", "performanceFactor"] + _attr_types = {"category": str, "performanceFactor": str} + _defaults = {"category": '', "performanceFactor": ''} + _enums = {} + _refs = ["Crew", "WorkTasks", "status", "Crafts", "validityInterval"] + _many_refs = ["WorkTasks", "Crafts"] + + def getCrew(self): + + return self._Crew + + def setCrew(self, value): + if self._Crew is not None: + filtered = [x for x in self.Crew.Capabilities if x != self] + self._Crew._Capabilities = filtered + + self._Crew = value + if self._Crew is not None: + if self not in self._Crew._Capabilities: + self._Crew._Capabilities.append(self) + + Crew = property(getCrew, setCrew) + + def getWorkTasks(self): + + return self._WorkTasks + + def setWorkTasks(self, value): + for p in self._WorkTasks: + filtered = [q for q in p.Capabilities if q != self] + self._WorkTasks._Capabilities = filtered + for r in value: + if self not in r._Capabilities: + r._Capabilities.append(self) + self._WorkTasks = value + + WorkTasks = property(getWorkTasks, setWorkTasks) + + def addWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + if self not in obj._Capabilities: + obj._Capabilities.append(self) + self._WorkTasks.append(obj) + + def removeWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + if self in obj._Capabilities: + obj._Capabilities.remove(self) + self._WorkTasks.remove(obj) + + status = None + + def getCrafts(self): + + return self._Crafts + + def setCrafts(self, value): + for p in self._Crafts: + filtered = [q for q in p.Capabilities if q != self] + self._Crafts._Capabilities = filtered + for r in value: + if self not in r._Capabilities: + r._Capabilities.append(self) + self._Crafts = value + + Crafts = property(getCrafts, setCrafts) + + def addCrafts(self, *Crafts): + for obj in Crafts: + if self not in obj._Capabilities: + obj._Capabilities.append(self) + self._Crafts.append(obj) + + def removeCrafts(self, *Crafts): + for obj in Crafts: + if self in obj._Capabilities: + obj._Capabilities.remove(self) + self._Crafts.remove(obj) + + # Date and time interval for which this capability is valid (when it became effective and when it expires). + validityInterval = None + diff --git a/CIM16/IEC61970/Informative/InfWork/CompatibleUnit.py b/CIM16/IEC61970/Informative/InfWork/CompatibleUnit.py new file mode 100755 index 00000000..d5cfe7b8 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/CompatibleUnit.py @@ -0,0 +1,344 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class CompatibleUnit(Document): + """A pre-planned job model containing labor, material, and accounting requirements for standardized job planning.A pre-planned job model containing labor, material, and accounting requirements for standardized job planning. + """ + + def __init__(self, quantity='', estCost=0.0, CUWorkEquipmentItems=None, DesignLocationCUs=None, CUGroup=None, CUAssets=None, PropertyUnit=None, CostType=None, CUAllowableAction=None, Procedures=None, CUContractorItems=None, CUMaterialItems=None, CULaborItems=None, *args, **kw_args): + """Initialises a new 'CompatibleUnit' instance. + + @param quantity: The quantity, unit of measure, and multiplier at the CU level that applies to the materials. + @param estCost: Estimated total cost for perfoming CU. + @param CUWorkEquipmentItems: + @param DesignLocationCUs: + @param CUGroup: + @param CUAssets: + @param PropertyUnit: + @param CostType: + @param CUAllowableAction: + @param Procedures: + @param CUContractorItems: + @param CUMaterialItems: + @param CULaborItems: + """ + #: The quantity, unit of measure, and multiplier at the CU level that applies to the materials. + self.quantity = quantity + + #: Estimated total cost for perfoming CU. + self.estCost = estCost + + self._CUWorkEquipmentItems = [] + self.CUWorkEquipmentItems = [] if CUWorkEquipmentItems is None else CUWorkEquipmentItems + + self._DesignLocationCUs = [] + self.DesignLocationCUs = [] if DesignLocationCUs is None else DesignLocationCUs + + self._CUGroup = None + self.CUGroup = CUGroup + + self._CUAssets = [] + self.CUAssets = [] if CUAssets is None else CUAssets + + self._PropertyUnit = None + self.PropertyUnit = PropertyUnit + + self._CostType = None + self.CostType = CostType + + self._CUAllowableAction = None + self.CUAllowableAction = CUAllowableAction + + self._Procedures = [] + self.Procedures = [] if Procedures is None else Procedures + + self._CUContractorItems = [] + self.CUContractorItems = [] if CUContractorItems is None else CUContractorItems + + self._CUMaterialItems = [] + self.CUMaterialItems = [] if CUMaterialItems is None else CUMaterialItems + + self._CULaborItems = [] + self.CULaborItems = [] if CULaborItems is None else CULaborItems + + super(CompatibleUnit, self).__init__(*args, **kw_args) + + _attrs = ["quantity", "estCost"] + _attr_types = {"quantity": str, "estCost": float} + _defaults = {"quantity": '', "estCost": 0.0} + _enums = {} + _refs = ["CUWorkEquipmentItems", "DesignLocationCUs", "CUGroup", "CUAssets", "PropertyUnit", "CostType", "CUAllowableAction", "Procedures", "CUContractorItems", "CUMaterialItems", "CULaborItems"] + _many_refs = ["CUWorkEquipmentItems", "DesignLocationCUs", "CUAssets", "Procedures", "CUContractorItems", "CUMaterialItems", "CULaborItems"] + + def getCUWorkEquipmentItems(self): + + return self._CUWorkEquipmentItems + + def setCUWorkEquipmentItems(self, value): + for p in self._CUWorkEquipmentItems: + filtered = [q for q in p.CompatibleUnits if q != self] + self._CUWorkEquipmentItems._CompatibleUnits = filtered + for r in value: + if self not in r._CompatibleUnits: + r._CompatibleUnits.append(self) + self._CUWorkEquipmentItems = value + + CUWorkEquipmentItems = property(getCUWorkEquipmentItems, setCUWorkEquipmentItems) + + def addCUWorkEquipmentItems(self, *CUWorkEquipmentItems): + for obj in CUWorkEquipmentItems: + if self not in obj._CompatibleUnits: + obj._CompatibleUnits.append(self) + self._CUWorkEquipmentItems.append(obj) + + def removeCUWorkEquipmentItems(self, *CUWorkEquipmentItems): + for obj in CUWorkEquipmentItems: + if self in obj._CompatibleUnits: + obj._CompatibleUnits.remove(self) + self._CUWorkEquipmentItems.remove(obj) + + def getDesignLocationCUs(self): + + return self._DesignLocationCUs + + def setDesignLocationCUs(self, value): + for p in self._DesignLocationCUs: + filtered = [q for q in p.CompatibleUnits if q != self] + self._DesignLocationCUs._CompatibleUnits = filtered + for r in value: + if self not in r._CompatibleUnits: + r._CompatibleUnits.append(self) + self._DesignLocationCUs = value + + DesignLocationCUs = property(getDesignLocationCUs, setDesignLocationCUs) + + def addDesignLocationCUs(self, *DesignLocationCUs): + for obj in DesignLocationCUs: + if self not in obj._CompatibleUnits: + obj._CompatibleUnits.append(self) + self._DesignLocationCUs.append(obj) + + def removeDesignLocationCUs(self, *DesignLocationCUs): + for obj in DesignLocationCUs: + if self in obj._CompatibleUnits: + obj._CompatibleUnits.remove(self) + self._DesignLocationCUs.remove(obj) + + def getCUGroup(self): + + return self._CUGroup + + def setCUGroup(self, value): + if self._CUGroup is not None: + filtered = [x for x in self.CUGroup.CompatibleUnits if x != self] + self._CUGroup._CompatibleUnits = filtered + + self._CUGroup = value + if self._CUGroup is not None: + if self not in self._CUGroup._CompatibleUnits: + self._CUGroup._CompatibleUnits.append(self) + + CUGroup = property(getCUGroup, setCUGroup) + + def getCUAssets(self): + + return self._CUAssets + + def setCUAssets(self, value): + for p in self._CUAssets: + filtered = [q for q in p.CompatibleUnits if q != self] + self._CUAssets._CompatibleUnits = filtered + for r in value: + if self not in r._CompatibleUnits: + r._CompatibleUnits.append(self) + self._CUAssets = value + + CUAssets = property(getCUAssets, setCUAssets) + + def addCUAssets(self, *CUAssets): + for obj in CUAssets: + if self not in obj._CompatibleUnits: + obj._CompatibleUnits.append(self) + self._CUAssets.append(obj) + + def removeCUAssets(self, *CUAssets): + for obj in CUAssets: + if self in obj._CompatibleUnits: + obj._CompatibleUnits.remove(self) + self._CUAssets.remove(obj) + + def getPropertyUnit(self): + + return self._PropertyUnit + + def setPropertyUnit(self, value): + if self._PropertyUnit is not None: + filtered = [x for x in self.PropertyUnit.CompatibleUnits if x != self] + self._PropertyUnit._CompatibleUnits = filtered + + self._PropertyUnit = value + if self._PropertyUnit is not None: + if self not in self._PropertyUnit._CompatibleUnits: + self._PropertyUnit._CompatibleUnits.append(self) + + PropertyUnit = property(getPropertyUnit, setPropertyUnit) + + def getCostType(self): + + return self._CostType + + def setCostType(self, value): + if self._CostType is not None: + filtered = [x for x in self.CostType.CompatibleUnits if x != self] + self._CostType._CompatibleUnits = filtered + + self._CostType = value + if self._CostType is not None: + if self not in self._CostType._CompatibleUnits: + self._CostType._CompatibleUnits.append(self) + + CostType = property(getCostType, setCostType) + + def getCUAllowableAction(self): + + return self._CUAllowableAction + + def setCUAllowableAction(self, value): + if self._CUAllowableAction is not None: + filtered = [x for x in self.CUAllowableAction.CompatibleUnits if x != self] + self._CUAllowableAction._CompatibleUnits = filtered + + self._CUAllowableAction = value + if self._CUAllowableAction is not None: + if self not in self._CUAllowableAction._CompatibleUnits: + self._CUAllowableAction._CompatibleUnits.append(self) + + CUAllowableAction = property(getCUAllowableAction, setCUAllowableAction) + + def getProcedures(self): + + return self._Procedures + + def setProcedures(self, value): + for p in self._Procedures: + filtered = [q for q in p.CompatibleUnits if q != self] + self._Procedures._CompatibleUnits = filtered + for r in value: + if self not in r._CompatibleUnits: + r._CompatibleUnits.append(self) + self._Procedures = value + + Procedures = property(getProcedures, setProcedures) + + def addProcedures(self, *Procedures): + for obj in Procedures: + if self not in obj._CompatibleUnits: + obj._CompatibleUnits.append(self) + self._Procedures.append(obj) + + def removeProcedures(self, *Procedures): + for obj in Procedures: + if self in obj._CompatibleUnits: + obj._CompatibleUnits.remove(self) + self._Procedures.remove(obj) + + def getCUContractorItems(self): + + return self._CUContractorItems + + def setCUContractorItems(self, value): + for p in self._CUContractorItems: + filtered = [q for q in p.CompatibleUnits if q != self] + self._CUContractorItems._CompatibleUnits = filtered + for r in value: + if self not in r._CompatibleUnits: + r._CompatibleUnits.append(self) + self._CUContractorItems = value + + CUContractorItems = property(getCUContractorItems, setCUContractorItems) + + def addCUContractorItems(self, *CUContractorItems): + for obj in CUContractorItems: + if self not in obj._CompatibleUnits: + obj._CompatibleUnits.append(self) + self._CUContractorItems.append(obj) + + def removeCUContractorItems(self, *CUContractorItems): + for obj in CUContractorItems: + if self in obj._CompatibleUnits: + obj._CompatibleUnits.remove(self) + self._CUContractorItems.remove(obj) + + def getCUMaterialItems(self): + + return self._CUMaterialItems + + def setCUMaterialItems(self, value): + for p in self._CUMaterialItems: + filtered = [q for q in p.CompatibleUnits if q != self] + self._CUMaterialItems._CompatibleUnits = filtered + for r in value: + if self not in r._CompatibleUnits: + r._CompatibleUnits.append(self) + self._CUMaterialItems = value + + CUMaterialItems = property(getCUMaterialItems, setCUMaterialItems) + + def addCUMaterialItems(self, *CUMaterialItems): + for obj in CUMaterialItems: + if self not in obj._CompatibleUnits: + obj._CompatibleUnits.append(self) + self._CUMaterialItems.append(obj) + + def removeCUMaterialItems(self, *CUMaterialItems): + for obj in CUMaterialItems: + if self in obj._CompatibleUnits: + obj._CompatibleUnits.remove(self) + self._CUMaterialItems.remove(obj) + + def getCULaborItems(self): + + return self._CULaborItems + + def setCULaborItems(self, value): + for p in self._CULaborItems: + filtered = [q for q in p.CompatibleUnits if q != self] + self._CULaborItems._CompatibleUnits = filtered + for r in value: + if self not in r._CompatibleUnits: + r._CompatibleUnits.append(self) + self._CULaborItems = value + + CULaborItems = property(getCULaborItems, setCULaborItems) + + def addCULaborItems(self, *CULaborItems): + for obj in CULaborItems: + if self not in obj._CompatibleUnits: + obj._CompatibleUnits.append(self) + self._CULaborItems.append(obj) + + def removeCULaborItems(self, *CULaborItems): + for obj in CULaborItems: + if self in obj._CompatibleUnits: + obj._CompatibleUnits.remove(self) + self._CULaborItems.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfWork/ConditionFactor.py b/CIM16/IEC61970/Informative/InfWork/ConditionFactor.py new file mode 100755 index 00000000..f15da8e7 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/ConditionFactor.py @@ -0,0 +1,145 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ConditionFactor(IdentifiedObject): + """This is to specify the various condition factors for a design that may alter the cost estimate or the allocation.This is to specify the various condition factors for a design that may alter the cost estimate or the allocation. + """ + + def __init__(self, kind="material", cfValue='', Designs=None, DesignLocations=None, status=None, DesignLocationCUs=None, *args, **kw_args): + """Initialises a new 'ConditionFactor' instance. + + @param kind: Kind of this condition factor. Values are: "material", "travel", "accountAllocation", "labor", "other" + @param cfValue: The actual value of the condition factor, such as labor flat fee or percentage. + @param Designs: + @param DesignLocations: + @param status: + @param DesignLocationCUs: + """ + #: Kind of this condition factor. Values are: "material", "travel", "accountAllocation", "labor", "other" + self.kind = kind + + #: The actual value of the condition factor, such as labor flat fee or percentage. + self.cfValue = cfValue + + self._Designs = [] + self.Designs = [] if Designs is None else Designs + + self._DesignLocations = [] + self.DesignLocations = [] if DesignLocations is None else DesignLocations + + self.status = status + + self._DesignLocationCUs = [] + self.DesignLocationCUs = [] if DesignLocationCUs is None else DesignLocationCUs + + super(ConditionFactor, self).__init__(*args, **kw_args) + + _attrs = ["kind", "cfValue"] + _attr_types = {"kind": str, "cfValue": str} + _defaults = {"kind": "material", "cfValue": ''} + _enums = {"kind": "ConditionFactorKind"} + _refs = ["Designs", "DesignLocations", "status", "DesignLocationCUs"] + _many_refs = ["Designs", "DesignLocations", "DesignLocationCUs"] + + def getDesigns(self): + + return self._Designs + + def setDesigns(self, value): + for p in self._Designs: + filtered = [q for q in p.ConditionFactors if q != self] + self._Designs._ConditionFactors = filtered + for r in value: + if self not in r._ConditionFactors: + r._ConditionFactors.append(self) + self._Designs = value + + Designs = property(getDesigns, setDesigns) + + def addDesigns(self, *Designs): + for obj in Designs: + if self not in obj._ConditionFactors: + obj._ConditionFactors.append(self) + self._Designs.append(obj) + + def removeDesigns(self, *Designs): + for obj in Designs: + if self in obj._ConditionFactors: + obj._ConditionFactors.remove(self) + self._Designs.remove(obj) + + def getDesignLocations(self): + + return self._DesignLocations + + def setDesignLocations(self, value): + for p in self._DesignLocations: + filtered = [q for q in p.ConditionFactors if q != self] + self._DesignLocations._ConditionFactors = filtered + for r in value: + if self not in r._ConditionFactors: + r._ConditionFactors.append(self) + self._DesignLocations = value + + DesignLocations = property(getDesignLocations, setDesignLocations) + + def addDesignLocations(self, *DesignLocations): + for obj in DesignLocations: + if self not in obj._ConditionFactors: + obj._ConditionFactors.append(self) + self._DesignLocations.append(obj) + + def removeDesignLocations(self, *DesignLocations): + for obj in DesignLocations: + if self in obj._ConditionFactors: + obj._ConditionFactors.remove(self) + self._DesignLocations.remove(obj) + + status = None + + def getDesignLocationCUs(self): + + return self._DesignLocationCUs + + def setDesignLocationCUs(self, value): + for p in self._DesignLocationCUs: + filtered = [q for q in p.ConditionFactors if q != self] + self._DesignLocationCUs._ConditionFactors = filtered + for r in value: + if self not in r._ConditionFactors: + r._ConditionFactors.append(self) + self._DesignLocationCUs = value + + DesignLocationCUs = property(getDesignLocationCUs, setDesignLocationCUs) + + def addDesignLocationCUs(self, *DesignLocationCUs): + for obj in DesignLocationCUs: + if self not in obj._ConditionFactors: + obj._ConditionFactors.append(self) + self._DesignLocationCUs.append(obj) + + def removeDesignLocationCUs(self, *DesignLocationCUs): + for obj in DesignLocationCUs: + if self in obj._ConditionFactors: + obj._ConditionFactors.remove(self) + self._DesignLocationCUs.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfWork/ContractorItem.py b/CIM16/IEC61970/Informative/InfWork/ContractorItem.py new file mode 100755 index 00000000..daee7353 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/ContractorItem.py @@ -0,0 +1,127 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ContractorItem(IdentifiedObject): + """Contractor information for work task.Contractor information for work task. + """ + + def __init__(self, bidAmount=0.0, activityCode='', cost=0.0, WorkTask=None, ErpPayables=None, status=None, WorkCostDetail=None, *args, **kw_args): + """Initialises a new 'ContractorItem' instance. + + @param bidAmount: The amount that a given contractor will charge for performing this unit of work. + @param activityCode: Activity code identifies a specific and distinguishable unit of work. + @param cost: The total amount charged. + @param WorkTask: + @param ErpPayables: + @param status: + @param WorkCostDetail: + """ + #: The amount that a given contractor will charge for performing this unit of work. + self.bidAmount = bidAmount + + #: Activity code identifies a specific and distinguishable unit of work. + self.activityCode = activityCode + + #: The total amount charged. + self.cost = cost + + self._WorkTask = None + self.WorkTask = WorkTask + + self._ErpPayables = [] + self.ErpPayables = [] if ErpPayables is None else ErpPayables + + self.status = status + + self._WorkCostDetail = None + self.WorkCostDetail = WorkCostDetail + + super(ContractorItem, self).__init__(*args, **kw_args) + + _attrs = ["bidAmount", "activityCode", "cost"] + _attr_types = {"bidAmount": float, "activityCode": str, "cost": float} + _defaults = {"bidAmount": 0.0, "activityCode": '', "cost": 0.0} + _enums = {} + _refs = ["WorkTask", "ErpPayables", "status", "WorkCostDetail"] + _many_refs = ["ErpPayables"] + + def getWorkTask(self): + + return self._WorkTask + + def setWorkTask(self, value): + if self._WorkTask is not None: + filtered = [x for x in self.WorkTask.ContractorItems if x != self] + self._WorkTask._ContractorItems = filtered + + self._WorkTask = value + if self._WorkTask is not None: + if self not in self._WorkTask._ContractorItems: + self._WorkTask._ContractorItems.append(self) + + WorkTask = property(getWorkTask, setWorkTask) + + def getErpPayables(self): + + return self._ErpPayables + + def setErpPayables(self, value): + for p in self._ErpPayables: + filtered = [q for q in p.ContractorItems if q != self] + self._ErpPayables._ContractorItems = filtered + for r in value: + if self not in r._ContractorItems: + r._ContractorItems.append(self) + self._ErpPayables = value + + ErpPayables = property(getErpPayables, setErpPayables) + + def addErpPayables(self, *ErpPayables): + for obj in ErpPayables: + if self not in obj._ContractorItems: + obj._ContractorItems.append(self) + self._ErpPayables.append(obj) + + def removeErpPayables(self, *ErpPayables): + for obj in ErpPayables: + if self in obj._ContractorItems: + obj._ContractorItems.remove(self) + self._ErpPayables.remove(obj) + + status = None + + def getWorkCostDetail(self): + + return self._WorkCostDetail + + def setWorkCostDetail(self, value): + if self._WorkCostDetail is not None: + filtered = [x for x in self.WorkCostDetail.ContractorItems if x != self] + self._WorkCostDetail._ContractorItems = filtered + + self._WorkCostDetail = value + if self._WorkCostDetail is not None: + if self not in self._WorkCostDetail._ContractorItems: + self._WorkCostDetail._ContractorItems.append(self) + + WorkCostDetail = property(getWorkCostDetail, setWorkCostDetail) + diff --git a/CIM16/IEC61970/Informative/InfWork/CostType.py b/CIM16/IEC61970/Informative/InfWork/CostType.py new file mode 100755 index 00000000..edd491b1 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/CostType.py @@ -0,0 +1,186 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class CostType(IdentifiedObject): + """A categorization for resources, often costs, in accounting transactions. Examples include: material components, building in service, coal sales, overhead, etc.A categorization for resources, often costs, in accounting transactions. Examples include: material components, building in service, coal sales, overhead, etc. + """ + + def __init__(self, stage='', code='', level='', amountAssignable=False, ErpJournalEntries=None, ParentCostType=None, ChildCostTypes=None, WorkCostDetails=None, CompatibleUnits=None, status=None, *args, **kw_args): + """Initialises a new 'CostType' instance. + + @param stage: The stage for which this costType applies: estimated design, estimated actual or actual actual. + @param code: A codified representation of the resource element. + @param level: The level of the resource element in the hierarchy of resource elements (recursive relationship). + @param amountAssignable: True if an amount can be assigned to the resource element (e.g., building in service, transmission plant, software development capital); false otherwise (e.g., internal labor, material components). + @param ErpJournalEntries: + @param ParentCostType: + @param ChildCostTypes: + @param WorkCostDetails: + @param CompatibleUnits: + @param status: + """ + #: The stage for which this costType applies: estimated design, estimated actual or actual actual. + self.stage = stage + + #: A codified representation of the resource element. + self.code = code + + #: The level of the resource element in the hierarchy of resource elements (recursive relationship). + self.level = level + + #: True if an amount can be assigned to the resource element (e.g., building in service, transmission plant, software development capital); false otherwise (e.g., internal labor, material components). + self.amountAssignable = amountAssignable + + self._ErpJournalEntries = [] + self.ErpJournalEntries = [] if ErpJournalEntries is None else ErpJournalEntries + + self._ParentCostType = None + self.ParentCostType = ParentCostType + + self._ChildCostTypes = [] + self.ChildCostTypes = [] if ChildCostTypes is None else ChildCostTypes + + self._WorkCostDetails = [] + self.WorkCostDetails = [] if WorkCostDetails is None else WorkCostDetails + + self._CompatibleUnits = [] + self.CompatibleUnits = [] if CompatibleUnits is None else CompatibleUnits + + self.status = status + + super(CostType, self).__init__(*args, **kw_args) + + _attrs = ["stage", "code", "level", "amountAssignable"] + _attr_types = {"stage": str, "code": str, "level": str, "amountAssignable": bool} + _defaults = {"stage": '', "code": '', "level": '', "amountAssignable": False} + _enums = {} + _refs = ["ErpJournalEntries", "ParentCostType", "ChildCostTypes", "WorkCostDetails", "CompatibleUnits", "status"] + _many_refs = ["ErpJournalEntries", "ChildCostTypes", "WorkCostDetails", "CompatibleUnits"] + + def getErpJournalEntries(self): + + return self._ErpJournalEntries + + def setErpJournalEntries(self, value): + for p in self._ErpJournalEntries: + filtered = [q for q in p.CostTypes if q != self] + self._ErpJournalEntries._CostTypes = filtered + for r in value: + if self not in r._CostTypes: + r._CostTypes.append(self) + self._ErpJournalEntries = value + + ErpJournalEntries = property(getErpJournalEntries, setErpJournalEntries) + + def addErpJournalEntries(self, *ErpJournalEntries): + for obj in ErpJournalEntries: + if self not in obj._CostTypes: + obj._CostTypes.append(self) + self._ErpJournalEntries.append(obj) + + def removeErpJournalEntries(self, *ErpJournalEntries): + for obj in ErpJournalEntries: + if self in obj._CostTypes: + obj._CostTypes.remove(self) + self._ErpJournalEntries.remove(obj) + + def getParentCostType(self): + + return self._ParentCostType + + def setParentCostType(self, value): + if self._ParentCostType is not None: + filtered = [x for x in self.ParentCostType.ChildCostTypes if x != self] + self._ParentCostType._ChildCostTypes = filtered + + self._ParentCostType = value + if self._ParentCostType is not None: + if self not in self._ParentCostType._ChildCostTypes: + self._ParentCostType._ChildCostTypes.append(self) + + ParentCostType = property(getParentCostType, setParentCostType) + + def getChildCostTypes(self): + + return self._ChildCostTypes + + def setChildCostTypes(self, value): + for x in self._ChildCostTypes: + x.ParentCostType = None + for y in value: + y._ParentCostType = self + self._ChildCostTypes = value + + ChildCostTypes = property(getChildCostTypes, setChildCostTypes) + + def addChildCostTypes(self, *ChildCostTypes): + for obj in ChildCostTypes: + obj.ParentCostType = self + + def removeChildCostTypes(self, *ChildCostTypes): + for obj in ChildCostTypes: + obj.ParentCostType = None + + def getWorkCostDetails(self): + + return self._WorkCostDetails + + def setWorkCostDetails(self, value): + for x in self._WorkCostDetails: + x.CostType = None + for y in value: + y._CostType = self + self._WorkCostDetails = value + + WorkCostDetails = property(getWorkCostDetails, setWorkCostDetails) + + def addWorkCostDetails(self, *WorkCostDetails): + for obj in WorkCostDetails: + obj.CostType = self + + def removeWorkCostDetails(self, *WorkCostDetails): + for obj in WorkCostDetails: + obj.CostType = None + + def getCompatibleUnits(self): + + return self._CompatibleUnits + + def setCompatibleUnits(self, value): + for x in self._CompatibleUnits: + x.CostType = None + for y in value: + y._CostType = self + self._CompatibleUnits = value + + CompatibleUnits = property(getCompatibleUnits, setCompatibleUnits) + + def addCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + obj.CostType = self + + def removeCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + obj.CostType = None + + status = None + diff --git a/CIM16/IEC61970/Informative/InfWork/Crew.py b/CIM16/IEC61970/Informative/InfWork/Crew.py new file mode 100755 index 00000000..66c53821 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/Crew.py @@ -0,0 +1,415 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Crew(IdentifiedObject): + """A crew is a group of people with specific skills, tools, and vehicles.A crew is a group of people with specific skills, tools, and vehicles. + """ + + def __init__(self, category='', Tools=None, SwitchingSchedules=None, Route=None, Capabilities=None, CrewMembers=None, OutageSteps=None, WorkEquipmentAssets=None, Assignments=None, Locations=None, WorkTasks=None, Organisations=None, ShiftPatterns=None, Vehicles=None, *args, **kw_args): + """Initialises a new 'Crew' instance. + + @param category: Category by utility's work management standards and practices. + @param Tools: + @param SwitchingSchedules: All SwitchingSchedules executed by this Crew. + @param Route: + @param Capabilities: + @param CrewMembers: All ErpPersons that are members of this Crew. + @param OutageSteps: + @param WorkEquipmentAssets: + @param Assignments: All Assignments for this Crew. + @param Locations: + @param WorkTasks: All WorkTasks this Crew participates in. + @param Organisations: + @param ShiftPatterns: + @param Vehicles: + """ + #: Category by utility's work management standards and practices. + self.category = category + + self._Tools = [] + self.Tools = [] if Tools is None else Tools + + self._SwitchingSchedules = [] + self.SwitchingSchedules = [] if SwitchingSchedules is None else SwitchingSchedules + + self._Route = None + self.Route = Route + + self._Capabilities = [] + self.Capabilities = [] if Capabilities is None else Capabilities + + self._CrewMembers = [] + self.CrewMembers = [] if CrewMembers is None else CrewMembers + + self._OutageSteps = [] + self.OutageSteps = [] if OutageSteps is None else OutageSteps + + self._WorkEquipmentAssets = [] + self.WorkEquipmentAssets = [] if WorkEquipmentAssets is None else WorkEquipmentAssets + + self._Assignments = [] + self.Assignments = [] if Assignments is None else Assignments + + self._Locations = [] + self.Locations = [] if Locations is None else Locations + + self._WorkTasks = [] + self.WorkTasks = [] if WorkTasks is None else WorkTasks + + self._Organisations = [] + self.Organisations = [] if Organisations is None else Organisations + + self._ShiftPatterns = [] + self.ShiftPatterns = [] if ShiftPatterns is None else ShiftPatterns + + self._Vehicles = [] + self.Vehicles = [] if Vehicles is None else Vehicles + + super(Crew, self).__init__(*args, **kw_args) + + _attrs = ["category"] + _attr_types = {"category": str} + _defaults = {"category": ''} + _enums = {} + _refs = ["Tools", "SwitchingSchedules", "Route", "Capabilities", "CrewMembers", "OutageSteps", "WorkEquipmentAssets", "Assignments", "Locations", "WorkTasks", "Organisations", "ShiftPatterns", "Vehicles"] + _many_refs = ["Tools", "SwitchingSchedules", "Capabilities", "CrewMembers", "OutageSteps", "WorkEquipmentAssets", "Assignments", "Locations", "WorkTasks", "Organisations", "ShiftPatterns", "Vehicles"] + + def getTools(self): + + return self._Tools + + def setTools(self, value): + for x in self._Tools: + x.Crew = None + for y in value: + y._Crew = self + self._Tools = value + + Tools = property(getTools, setTools) + + def addTools(self, *Tools): + for obj in Tools: + obj.Crew = self + + def removeTools(self, *Tools): + for obj in Tools: + obj.Crew = None + + def getSwitchingSchedules(self): + """All SwitchingSchedules executed by this Crew. + """ + return self._SwitchingSchedules + + def setSwitchingSchedules(self, value): + for p in self._SwitchingSchedules: + filtered = [q for q in p.Crews if q != self] + self._SwitchingSchedules._Crews = filtered + for r in value: + if self not in r._Crews: + r._Crews.append(self) + self._SwitchingSchedules = value + + SwitchingSchedules = property(getSwitchingSchedules, setSwitchingSchedules) + + def addSwitchingSchedules(self, *SwitchingSchedules): + for obj in SwitchingSchedules: + if self not in obj._Crews: + obj._Crews.append(self) + self._SwitchingSchedules.append(obj) + + def removeSwitchingSchedules(self, *SwitchingSchedules): + for obj in SwitchingSchedules: + if self in obj._Crews: + obj._Crews.remove(self) + self._SwitchingSchedules.remove(obj) + + def getRoute(self): + + return self._Route + + def setRoute(self, value): + if self._Route is not None: + filtered = [x for x in self.Route.Crews if x != self] + self._Route._Crews = filtered + + self._Route = value + if self._Route is not None: + if self not in self._Route._Crews: + self._Route._Crews.append(self) + + Route = property(getRoute, setRoute) + + def getCapabilities(self): + + return self._Capabilities + + def setCapabilities(self, value): + for x in self._Capabilities: + x.Crew = None + for y in value: + y._Crew = self + self._Capabilities = value + + Capabilities = property(getCapabilities, setCapabilities) + + def addCapabilities(self, *Capabilities): + for obj in Capabilities: + obj.Crew = self + + def removeCapabilities(self, *Capabilities): + for obj in Capabilities: + obj.Crew = None + + def getCrewMembers(self): + """All ErpPersons that are members of this Crew. + """ + return self._CrewMembers + + def setCrewMembers(self, value): + for p in self._CrewMembers: + filtered = [q for q in p.Crews if q != self] + self._CrewMembers._Crews = filtered + for r in value: + if self not in r._Crews: + r._Crews.append(self) + self._CrewMembers = value + + CrewMembers = property(getCrewMembers, setCrewMembers) + + def addCrewMembers(self, *CrewMembers): + for obj in CrewMembers: + if self not in obj._Crews: + obj._Crews.append(self) + self._CrewMembers.append(obj) + + def removeCrewMembers(self, *CrewMembers): + for obj in CrewMembers: + if self in obj._Crews: + obj._Crews.remove(self) + self._CrewMembers.remove(obj) + + def getOutageSteps(self): + + return self._OutageSteps + + def setOutageSteps(self, value): + for p in self._OutageSteps: + filtered = [q for q in p.Crews if q != self] + self._OutageSteps._Crews = filtered + for r in value: + if self not in r._Crews: + r._Crews.append(self) + self._OutageSteps = value + + OutageSteps = property(getOutageSteps, setOutageSteps) + + def addOutageSteps(self, *OutageSteps): + for obj in OutageSteps: + if self not in obj._Crews: + obj._Crews.append(self) + self._OutageSteps.append(obj) + + def removeOutageSteps(self, *OutageSteps): + for obj in OutageSteps: + if self in obj._Crews: + obj._Crews.remove(self) + self._OutageSteps.remove(obj) + + def getWorkEquipmentAssets(self): + + return self._WorkEquipmentAssets + + def setWorkEquipmentAssets(self, value): + for x in self._WorkEquipmentAssets: + x.Crew = None + for y in value: + y._Crew = self + self._WorkEquipmentAssets = value + + WorkEquipmentAssets = property(getWorkEquipmentAssets, setWorkEquipmentAssets) + + def addWorkEquipmentAssets(self, *WorkEquipmentAssets): + for obj in WorkEquipmentAssets: + obj.Crew = self + + def removeWorkEquipmentAssets(self, *WorkEquipmentAssets): + for obj in WorkEquipmentAssets: + obj.Crew = None + + def getAssignments(self): + """All Assignments for this Crew. + """ + return self._Assignments + + def setAssignments(self, value): + for p in self._Assignments: + filtered = [q for q in p.Crews if q != self] + self._Assignments._Crews = filtered + for r in value: + if self not in r._Crews: + r._Crews.append(self) + self._Assignments = value + + Assignments = property(getAssignments, setAssignments) + + def addAssignments(self, *Assignments): + for obj in Assignments: + if self not in obj._Crews: + obj._Crews.append(self) + self._Assignments.append(obj) + + def removeAssignments(self, *Assignments): + for obj in Assignments: + if self in obj._Crews: + obj._Crews.remove(self) + self._Assignments.remove(obj) + + def getLocations(self): + + return self._Locations + + def setLocations(self, value): + for p in self._Locations: + filtered = [q for q in p.Crews if q != self] + self._Locations._Crews = filtered + for r in value: + if self not in r._Crews: + r._Crews.append(self) + self._Locations = value + + Locations = property(getLocations, setLocations) + + def addLocations(self, *Locations): + for obj in Locations: + if self not in obj._Crews: + obj._Crews.append(self) + self._Locations.append(obj) + + def removeLocations(self, *Locations): + for obj in Locations: + if self in obj._Crews: + obj._Crews.remove(self) + self._Locations.remove(obj) + + def getWorkTasks(self): + """All WorkTasks this Crew participates in. + """ + return self._WorkTasks + + def setWorkTasks(self, value): + for p in self._WorkTasks: + filtered = [q for q in p.Crews if q != self] + self._WorkTasks._Crews = filtered + for r in value: + if self not in r._Crews: + r._Crews.append(self) + self._WorkTasks = value + + WorkTasks = property(getWorkTasks, setWorkTasks) + + def addWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + if self not in obj._Crews: + obj._Crews.append(self) + self._WorkTasks.append(obj) + + def removeWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + if self in obj._Crews: + obj._Crews.remove(self) + self._WorkTasks.remove(obj) + + def getOrganisations(self): + + return self._Organisations + + def setOrganisations(self, value): + for p in self._Organisations: + filtered = [q for q in p.Crews if q != self] + self._Organisations._Crews = filtered + for r in value: + if self not in r._Crews: + r._Crews.append(self) + self._Organisations = value + + Organisations = property(getOrganisations, setOrganisations) + + def addOrganisations(self, *Organisations): + for obj in Organisations: + if self not in obj._Crews: + obj._Crews.append(self) + self._Organisations.append(obj) + + def removeOrganisations(self, *Organisations): + for obj in Organisations: + if self in obj._Crews: + obj._Crews.remove(self) + self._Organisations.remove(obj) + + def getShiftPatterns(self): + + return self._ShiftPatterns + + def setShiftPatterns(self, value): + for p in self._ShiftPatterns: + filtered = [q for q in p.Crews if q != self] + self._ShiftPatterns._Crews = filtered + for r in value: + if self not in r._Crews: + r._Crews.append(self) + self._ShiftPatterns = value + + ShiftPatterns = property(getShiftPatterns, setShiftPatterns) + + def addShiftPatterns(self, *ShiftPatterns): + for obj in ShiftPatterns: + if self not in obj._Crews: + obj._Crews.append(self) + self._ShiftPatterns.append(obj) + + def removeShiftPatterns(self, *ShiftPatterns): + for obj in ShiftPatterns: + if self in obj._Crews: + obj._Crews.remove(self) + self._ShiftPatterns.remove(obj) + + def getVehicles(self): + + return self._Vehicles + + def setVehicles(self, value): + for x in self._Vehicles: + x.Crew = None + for y in value: + y._Crew = self + self._Vehicles = value + + Vehicles = property(getVehicles, setVehicles) + + def addVehicles(self, *Vehicles): + for obj in Vehicles: + obj.Crew = self + + def removeVehicles(self, *Vehicles): + for obj in Vehicles: + obj.Crew = None + diff --git a/CIM16/IEC61970/Informative/InfWork/Design.py b/CIM16/IEC61970/Informative/InfWork/Design.py new file mode 100755 index 00000000..b649f0d3 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/Design.py @@ -0,0 +1,258 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class Design(Document): + """A design for consideration by customers, potential customers, or internal work. Note that the Version of design is the revision attribute that is inherited from Document.A design for consideration by customers, potential customers, or internal work. Note that the Version of design is the revision attribute that is inherited from Document. + """ + + def __init__(self, costEstimate=0.0, kind="asBuilt", price=0.0, DesignLocations=None, WorkCostDetails=None, ConditionFactors=None, WorkTasks=None, ErpBOMs=None, Work=None, DesignLocationsCUs=None, ErpQuoteLineItem=None, *args, **kw_args): + """Initialises a new 'Design' instance. + + @param costEstimate: Estimated cost (not price) of design. + @param kind: Kind of this design. Values are: "asBuilt", "other", "estimated" + @param price: Price to customer for implementing design. + @param DesignLocations: + @param WorkCostDetails: + @param ConditionFactors: + @param WorkTasks: + @param ErpBOMs: + @param Work: + @param DesignLocationsCUs: + @param ErpQuoteLineItem: + """ + #: Estimated cost (not price) of design. + self.costEstimate = costEstimate + + #: Kind of this design. Values are: "asBuilt", "other", "estimated" + self.kind = kind + + #: Price to customer for implementing design. + self.price = price + + self._DesignLocations = [] + self.DesignLocations = [] if DesignLocations is None else DesignLocations + + self._WorkCostDetails = [] + self.WorkCostDetails = [] if WorkCostDetails is None else WorkCostDetails + + self._ConditionFactors = [] + self.ConditionFactors = [] if ConditionFactors is None else ConditionFactors + + self._WorkTasks = [] + self.WorkTasks = [] if WorkTasks is None else WorkTasks + + self._ErpBOMs = [] + self.ErpBOMs = [] if ErpBOMs is None else ErpBOMs + + self._Work = None + self.Work = Work + + self._DesignLocationsCUs = [] + self.DesignLocationsCUs = [] if DesignLocationsCUs is None else DesignLocationsCUs + + self._ErpQuoteLineItem = None + self.ErpQuoteLineItem = ErpQuoteLineItem + + super(Design, self).__init__(*args, **kw_args) + + _attrs = ["costEstimate", "kind", "price"] + _attr_types = {"costEstimate": float, "kind": str, "price": float} + _defaults = {"costEstimate": 0.0, "kind": "asBuilt", "price": 0.0} + _enums = {"kind": "DesignKind"} + _refs = ["DesignLocations", "WorkCostDetails", "ConditionFactors", "WorkTasks", "ErpBOMs", "Work", "DesignLocationsCUs", "ErpQuoteLineItem"] + _many_refs = ["DesignLocations", "WorkCostDetails", "ConditionFactors", "WorkTasks", "ErpBOMs", "DesignLocationsCUs"] + + def getDesignLocations(self): + + return self._DesignLocations + + def setDesignLocations(self, value): + for p in self._DesignLocations: + filtered = [q for q in p.Designs if q != self] + self._DesignLocations._Designs = filtered + for r in value: + if self not in r._Designs: + r._Designs.append(self) + self._DesignLocations = value + + DesignLocations = property(getDesignLocations, setDesignLocations) + + def addDesignLocations(self, *DesignLocations): + for obj in DesignLocations: + if self not in obj._Designs: + obj._Designs.append(self) + self._DesignLocations.append(obj) + + def removeDesignLocations(self, *DesignLocations): + for obj in DesignLocations: + if self in obj._Designs: + obj._Designs.remove(self) + self._DesignLocations.remove(obj) + + def getWorkCostDetails(self): + + return self._WorkCostDetails + + def setWorkCostDetails(self, value): + for x in self._WorkCostDetails: + x.Design = None + for y in value: + y._Design = self + self._WorkCostDetails = value + + WorkCostDetails = property(getWorkCostDetails, setWorkCostDetails) + + def addWorkCostDetails(self, *WorkCostDetails): + for obj in WorkCostDetails: + obj.Design = self + + def removeWorkCostDetails(self, *WorkCostDetails): + for obj in WorkCostDetails: + obj.Design = None + + def getConditionFactors(self): + + return self._ConditionFactors + + def setConditionFactors(self, value): + for p in self._ConditionFactors: + filtered = [q for q in p.Designs if q != self] + self._ConditionFactors._Designs = filtered + for r in value: + if self not in r._Designs: + r._Designs.append(self) + self._ConditionFactors = value + + ConditionFactors = property(getConditionFactors, setConditionFactors) + + def addConditionFactors(self, *ConditionFactors): + for obj in ConditionFactors: + if self not in obj._Designs: + obj._Designs.append(self) + self._ConditionFactors.append(obj) + + def removeConditionFactors(self, *ConditionFactors): + for obj in ConditionFactors: + if self in obj._Designs: + obj._Designs.remove(self) + self._ConditionFactors.remove(obj) + + def getWorkTasks(self): + + return self._WorkTasks + + def setWorkTasks(self, value): + for x in self._WorkTasks: + x.Design = None + for y in value: + y._Design = self + self._WorkTasks = value + + WorkTasks = property(getWorkTasks, setWorkTasks) + + def addWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + obj.Design = self + + def removeWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + obj.Design = None + + def getErpBOMs(self): + + return self._ErpBOMs + + def setErpBOMs(self, value): + for x in self._ErpBOMs: + x.Design = None + for y in value: + y._Design = self + self._ErpBOMs = value + + ErpBOMs = property(getErpBOMs, setErpBOMs) + + def addErpBOMs(self, *ErpBOMs): + for obj in ErpBOMs: + obj.Design = self + + def removeErpBOMs(self, *ErpBOMs): + for obj in ErpBOMs: + obj.Design = None + + def getWork(self): + + return self._Work + + def setWork(self, value): + if self._Work is not None: + filtered = [x for x in self.Work.Designs if x != self] + self._Work._Designs = filtered + + self._Work = value + if self._Work is not None: + if self not in self._Work._Designs: + self._Work._Designs.append(self) + + Work = property(getWork, setWork) + + def getDesignLocationsCUs(self): + + return self._DesignLocationsCUs + + def setDesignLocationsCUs(self, value): + for p in self._DesignLocationsCUs: + filtered = [q for q in p.Designs if q != self] + self._DesignLocationsCUs._Designs = filtered + for r in value: + if self not in r._Designs: + r._Designs.append(self) + self._DesignLocationsCUs = value + + DesignLocationsCUs = property(getDesignLocationsCUs, setDesignLocationsCUs) + + def addDesignLocationsCUs(self, *DesignLocationsCUs): + for obj in DesignLocationsCUs: + if self not in obj._Designs: + obj._Designs.append(self) + self._DesignLocationsCUs.append(obj) + + def removeDesignLocationsCUs(self, *DesignLocationsCUs): + for obj in DesignLocationsCUs: + if self in obj._Designs: + obj._Designs.remove(self) + self._DesignLocationsCUs.remove(obj) + + def getErpQuoteLineItem(self): + + return self._ErpQuoteLineItem + + def setErpQuoteLineItem(self, value): + if self._ErpQuoteLineItem is not None: + self._ErpQuoteLineItem._Design = None + + self._ErpQuoteLineItem = value + if self._ErpQuoteLineItem is not None: + self._ErpQuoteLineItem.Design = None + self._ErpQuoteLineItem._Design = self + + ErpQuoteLineItem = property(getErpQuoteLineItem, setErpQuoteLineItem) + diff --git a/CIM16/IEC61970/Informative/InfWork/DesignLocation.py b/CIM16/IEC61970/Informative/InfWork/DesignLocation.py new file mode 100755 index 00000000..50f41440 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/DesignLocation.py @@ -0,0 +1,272 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class DesignLocation(IdentifiedObject): + """A logical part of the design (e.g., pole and all equipment on a pole). This includes points and spans.A logical part of the design (e.g., pole and all equipment on a pole). This includes points and spans. + """ + + def __init__(self, spanLength=0.0, status=None, MaterialItems=None, Designs=None, DesignLocationCUs=None, WorkLocations=None, Diagrams=None, MiscCostItems=None, ErpBomItemDatas=None, ConditionFactors=None, *args, **kw_args): + """Initialises a new 'DesignLocation' instance. + + @param spanLength: The legth of the span from the previous pole to this pole. + @param status: + @param MaterialItems: + @param Designs: + @param DesignLocationCUs: + @param WorkLocations: + @param Diagrams: + @param MiscCostItems: + @param ErpBomItemDatas: + @param ConditionFactors: + """ + #: The legth of the span from the previous pole to this pole. + self.spanLength = spanLength + + self.status = status + + self._MaterialItems = [] + self.MaterialItems = [] if MaterialItems is None else MaterialItems + + self._Designs = [] + self.Designs = [] if Designs is None else Designs + + self._DesignLocationCUs = [] + self.DesignLocationCUs = [] if DesignLocationCUs is None else DesignLocationCUs + + self._WorkLocations = [] + self.WorkLocations = [] if WorkLocations is None else WorkLocations + + self._Diagrams = [] + self.Diagrams = [] if Diagrams is None else Diagrams + + self._MiscCostItems = [] + self.MiscCostItems = [] if MiscCostItems is None else MiscCostItems + + self._ErpBomItemDatas = [] + self.ErpBomItemDatas = [] if ErpBomItemDatas is None else ErpBomItemDatas + + self._ConditionFactors = [] + self.ConditionFactors = [] if ConditionFactors is None else ConditionFactors + + super(DesignLocation, self).__init__(*args, **kw_args) + + _attrs = ["spanLength"] + _attr_types = {"spanLength": float} + _defaults = {"spanLength": 0.0} + _enums = {} + _refs = ["status", "MaterialItems", "Designs", "DesignLocationCUs", "WorkLocations", "Diagrams", "MiscCostItems", "ErpBomItemDatas", "ConditionFactors"] + _many_refs = ["MaterialItems", "Designs", "DesignLocationCUs", "WorkLocations", "Diagrams", "MiscCostItems", "ErpBomItemDatas", "ConditionFactors"] + + status = None + + def getMaterialItems(self): + + return self._MaterialItems + + def setMaterialItems(self, value): + for x in self._MaterialItems: + x.DesignLocation = None + for y in value: + y._DesignLocation = self + self._MaterialItems = value + + MaterialItems = property(getMaterialItems, setMaterialItems) + + def addMaterialItems(self, *MaterialItems): + for obj in MaterialItems: + obj.DesignLocation = self + + def removeMaterialItems(self, *MaterialItems): + for obj in MaterialItems: + obj.DesignLocation = None + + def getDesigns(self): + + return self._Designs + + def setDesigns(self, value): + for p in self._Designs: + filtered = [q for q in p.DesignLocations if q != self] + self._Designs._DesignLocations = filtered + for r in value: + if self not in r._DesignLocations: + r._DesignLocations.append(self) + self._Designs = value + + Designs = property(getDesigns, setDesigns) + + def addDesigns(self, *Designs): + for obj in Designs: + if self not in obj._DesignLocations: + obj._DesignLocations.append(self) + self._Designs.append(obj) + + def removeDesigns(self, *Designs): + for obj in Designs: + if self in obj._DesignLocations: + obj._DesignLocations.remove(self) + self._Designs.remove(obj) + + def getDesignLocationCUs(self): + + return self._DesignLocationCUs + + def setDesignLocationCUs(self, value): + for x in self._DesignLocationCUs: + x.DesignLocation = None + for y in value: + y._DesignLocation = self + self._DesignLocationCUs = value + + DesignLocationCUs = property(getDesignLocationCUs, setDesignLocationCUs) + + def addDesignLocationCUs(self, *DesignLocationCUs): + for obj in DesignLocationCUs: + obj.DesignLocation = self + + def removeDesignLocationCUs(self, *DesignLocationCUs): + for obj in DesignLocationCUs: + obj.DesignLocation = None + + def getWorkLocations(self): + + return self._WorkLocations + + def setWorkLocations(self, value): + for p in self._WorkLocations: + filtered = [q for q in p.DesignLocations if q != self] + self._WorkLocations._DesignLocations = filtered + for r in value: + if self not in r._DesignLocations: + r._DesignLocations.append(self) + self._WorkLocations = value + + WorkLocations = property(getWorkLocations, setWorkLocations) + + def addWorkLocations(self, *WorkLocations): + for obj in WorkLocations: + if self not in obj._DesignLocations: + obj._DesignLocations.append(self) + self._WorkLocations.append(obj) + + def removeWorkLocations(self, *WorkLocations): + for obj in WorkLocations: + if self in obj._DesignLocations: + obj._DesignLocations.remove(self) + self._WorkLocations.remove(obj) + + def getDiagrams(self): + + return self._Diagrams + + def setDiagrams(self, value): + for p in self._Diagrams: + filtered = [q for q in p.DesignLocations if q != self] + self._Diagrams._DesignLocations = filtered + for r in value: + if self not in r._DesignLocations: + r._DesignLocations.append(self) + self._Diagrams = value + + Diagrams = property(getDiagrams, setDiagrams) + + def addDiagrams(self, *Diagrams): + for obj in Diagrams: + if self not in obj._DesignLocations: + obj._DesignLocations.append(self) + self._Diagrams.append(obj) + + def removeDiagrams(self, *Diagrams): + for obj in Diagrams: + if self in obj._DesignLocations: + obj._DesignLocations.remove(self) + self._Diagrams.remove(obj) + + def getMiscCostItems(self): + + return self._MiscCostItems + + def setMiscCostItems(self, value): + for x in self._MiscCostItems: + x.DesignLocation = None + for y in value: + y._DesignLocation = self + self._MiscCostItems = value + + MiscCostItems = property(getMiscCostItems, setMiscCostItems) + + def addMiscCostItems(self, *MiscCostItems): + for obj in MiscCostItems: + obj.DesignLocation = self + + def removeMiscCostItems(self, *MiscCostItems): + for obj in MiscCostItems: + obj.DesignLocation = None + + def getErpBomItemDatas(self): + + return self._ErpBomItemDatas + + def setErpBomItemDatas(self, value): + for x in self._ErpBomItemDatas: + x.DesignLocation = None + for y in value: + y._DesignLocation = self + self._ErpBomItemDatas = value + + ErpBomItemDatas = property(getErpBomItemDatas, setErpBomItemDatas) + + def addErpBomItemDatas(self, *ErpBomItemDatas): + for obj in ErpBomItemDatas: + obj.DesignLocation = self + + def removeErpBomItemDatas(self, *ErpBomItemDatas): + for obj in ErpBomItemDatas: + obj.DesignLocation = None + + def getConditionFactors(self): + + return self._ConditionFactors + + def setConditionFactors(self, value): + for p in self._ConditionFactors: + filtered = [q for q in p.DesignLocations if q != self] + self._ConditionFactors._DesignLocations = filtered + for r in value: + if self not in r._DesignLocations: + r._DesignLocations.append(self) + self._ConditionFactors = value + + ConditionFactors = property(getConditionFactors, setConditionFactors) + + def addConditionFactors(self, *ConditionFactors): + for obj in ConditionFactors: + if self not in obj._DesignLocations: + obj._DesignLocations.append(self) + self._ConditionFactors.append(obj) + + def removeConditionFactors(self, *ConditionFactors): + for obj in ConditionFactors: + if self in obj._DesignLocations: + obj._DesignLocations.remove(self) + self._ConditionFactors.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfWork/DesignLocationCU.py b/CIM16/IEC61970/Informative/InfWork/DesignLocationCU.py new file mode 100755 index 00000000..6ddb3f5a --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/DesignLocationCU.py @@ -0,0 +1,243 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class DesignLocationCU(IdentifiedObject): + """Compatible unit at a given design location.Compatible unit at a given design location. + """ + + def __init__(self, energizationFlag=False, cuUsage='', removalDate='', cuAction="install", cuAccount='', cuQuantity="", ConditionFactors=None, CompatibleUnits=None, WorkTasks=None, Designs=None, CUGroups=None, DesignLocation=None, status=None, *args, **kw_args): + """Initialises a new 'DesignLocationCU' instance. + + @param energizationFlag: True if associated electrical equipment is intended to be energized while work is being performed. + @param cuUsage: As the same CU can be used for different purposes and accounting purposes, usage must be specified. Examples include: distribution, transmission, substation. + @param removalDate: Year when a CU that represents an asset is removed. + @param cuAction: A code that instructs the crew what action to perform. Values are: "install", "remove", "transfer", "abandon" + @param cuAccount: A code that helps direct accounting (capital, expense, or accounting treatment). + @param cuQuantity: The quantity of the CU being assigned to this location. + @param ConditionFactors: + @param CompatibleUnits: + @param WorkTasks: + @param Designs: + @param CUGroups: + @param DesignLocation: + @param status: + """ + #: True if associated electrical equipment is intended to be energized while work is being performed. + self.energizationFlag = energizationFlag + + #: As the same CU can be used for different purposes and accounting purposes, usage must be specified. Examples include: distribution, transmission, substation. + self.cuUsage = cuUsage + + #: Year when a CU that represents an asset is removed. + self.removalDate = removalDate + + #: A code that instructs the crew what action to perform. Values are: "install", "remove", "transfer", "abandon" + self.cuAction = cuAction + + #: A code that helps direct accounting (capital, expense, or accounting treatment). + self.cuAccount = cuAccount + + #: The quantity of the CU being assigned to this location. + self.cuQuantity = cuQuantity + + self._ConditionFactors = [] + self.ConditionFactors = [] if ConditionFactors is None else ConditionFactors + + self._CompatibleUnits = [] + self.CompatibleUnits = [] if CompatibleUnits is None else CompatibleUnits + + self._WorkTasks = [] + self.WorkTasks = [] if WorkTasks is None else WorkTasks + + self._Designs = [] + self.Designs = [] if Designs is None else Designs + + self._CUGroups = [] + self.CUGroups = [] if CUGroups is None else CUGroups + + self._DesignLocation = None + self.DesignLocation = DesignLocation + + self.status = status + + super(DesignLocationCU, self).__init__(*args, **kw_args) + + _attrs = ["energizationFlag", "cuUsage", "removalDate", "cuAction", "cuAccount", "cuQuantity"] + _attr_types = {"energizationFlag": bool, "cuUsage": str, "removalDate": str, "cuAction": str, "cuAccount": str, "cuQuantity": str} + _defaults = {"energizationFlag": False, "cuUsage": '', "removalDate": '', "cuAction": "install", "cuAccount": '', "cuQuantity": ""} + _enums = {"cuAction": "WorkActionKind"} + _refs = ["ConditionFactors", "CompatibleUnits", "WorkTasks", "Designs", "CUGroups", "DesignLocation", "status"] + _many_refs = ["ConditionFactors", "CompatibleUnits", "WorkTasks", "Designs", "CUGroups"] + + def getConditionFactors(self): + + return self._ConditionFactors + + def setConditionFactors(self, value): + for p in self._ConditionFactors: + filtered = [q for q in p.DesignLocationCUs if q != self] + self._ConditionFactors._DesignLocationCUs = filtered + for r in value: + if self not in r._DesignLocationCUs: + r._DesignLocationCUs.append(self) + self._ConditionFactors = value + + ConditionFactors = property(getConditionFactors, setConditionFactors) + + def addConditionFactors(self, *ConditionFactors): + for obj in ConditionFactors: + if self not in obj._DesignLocationCUs: + obj._DesignLocationCUs.append(self) + self._ConditionFactors.append(obj) + + def removeConditionFactors(self, *ConditionFactors): + for obj in ConditionFactors: + if self in obj._DesignLocationCUs: + obj._DesignLocationCUs.remove(self) + self._ConditionFactors.remove(obj) + + def getCompatibleUnits(self): + + return self._CompatibleUnits + + def setCompatibleUnits(self, value): + for p in self._CompatibleUnits: + filtered = [q for q in p.DesignLocationCUs if q != self] + self._CompatibleUnits._DesignLocationCUs = filtered + for r in value: + if self not in r._DesignLocationCUs: + r._DesignLocationCUs.append(self) + self._CompatibleUnits = value + + CompatibleUnits = property(getCompatibleUnits, setCompatibleUnits) + + def addCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + if self not in obj._DesignLocationCUs: + obj._DesignLocationCUs.append(self) + self._CompatibleUnits.append(obj) + + def removeCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + if self in obj._DesignLocationCUs: + obj._DesignLocationCUs.remove(self) + self._CompatibleUnits.remove(obj) + + def getWorkTasks(self): + + return self._WorkTasks + + def setWorkTasks(self, value): + for p in self._WorkTasks: + filtered = [q for q in p.DesignLocationCUs if q != self] + self._WorkTasks._DesignLocationCUs = filtered + for r in value: + if self not in r._DesignLocationCUs: + r._DesignLocationCUs.append(self) + self._WorkTasks = value + + WorkTasks = property(getWorkTasks, setWorkTasks) + + def addWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + if self not in obj._DesignLocationCUs: + obj._DesignLocationCUs.append(self) + self._WorkTasks.append(obj) + + def removeWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + if self in obj._DesignLocationCUs: + obj._DesignLocationCUs.remove(self) + self._WorkTasks.remove(obj) + + def getDesigns(self): + + return self._Designs + + def setDesigns(self, value): + for p in self._Designs: + filtered = [q for q in p.DesignLocationsCUs if q != self] + self._Designs._DesignLocationsCUs = filtered + for r in value: + if self not in r._DesignLocationsCUs: + r._DesignLocationsCUs.append(self) + self._Designs = value + + Designs = property(getDesigns, setDesigns) + + def addDesigns(self, *Designs): + for obj in Designs: + if self not in obj._DesignLocationsCUs: + obj._DesignLocationsCUs.append(self) + self._Designs.append(obj) + + def removeDesigns(self, *Designs): + for obj in Designs: + if self in obj._DesignLocationsCUs: + obj._DesignLocationsCUs.remove(self) + self._Designs.remove(obj) + + def getCUGroups(self): + + return self._CUGroups + + def setCUGroups(self, value): + for p in self._CUGroups: + filtered = [q for q in p.DesignLocationCUs if q != self] + self._CUGroups._DesignLocationCUs = filtered + for r in value: + if self not in r._DesignLocationCUs: + r._DesignLocationCUs.append(self) + self._CUGroups = value + + CUGroups = property(getCUGroups, setCUGroups) + + def addCUGroups(self, *CUGroups): + for obj in CUGroups: + if self not in obj._DesignLocationCUs: + obj._DesignLocationCUs.append(self) + self._CUGroups.append(obj) + + def removeCUGroups(self, *CUGroups): + for obj in CUGroups: + if self in obj._DesignLocationCUs: + obj._DesignLocationCUs.remove(self) + self._CUGroups.remove(obj) + + def getDesignLocation(self): + + return self._DesignLocation + + def setDesignLocation(self, value): + if self._DesignLocation is not None: + filtered = [x for x in self.DesignLocation.DesignLocationCUs if x != self] + self._DesignLocation._DesignLocationCUs = filtered + + self._DesignLocation = value + if self._DesignLocation is not None: + if self not in self._DesignLocation._DesignLocationCUs: + self._DesignLocation._DesignLocationCUs.append(self) + + DesignLocation = property(getDesignLocation, setDesignLocation) + + status = None + diff --git a/CIM16/IEC61970/Informative/InfWork/DiagnosisDataSet.py b/CIM16/IEC61970/Informative/InfWork/DiagnosisDataSet.py new file mode 100755 index 00000000..56be7434 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/DiagnosisDataSet.py @@ -0,0 +1,91 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfAssets.ProcedureDataSet import ProcedureDataSet + +class DiagnosisDataSet(ProcedureDataSet): + """The result of a problem (typically an asset failure) diagnosis.The result of a problem (typically an asset failure) diagnosis. + """ + + def __init__(self, finalCause='', finalRemark='', phaseCode="s12N", preliminaryDateTime='', preliminaryCode='', rootRemark='', rootCause='', preliminaryRemark='', effect='', finalOrigin='', finalCode='', rootOrigin='', failureMode='', *args, **kw_args): + """Initialises a new 'DiagnosisDataSet' instance. + + @param finalCause: Cause of problem determined during diagnosis. + @param finalRemark: Remarks pertaining to findings during problem diagnosis. + @param phaseCode: Phase(s) diagnosed. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param preliminaryDateTime: Date and time preliminary assessment of problem was performed. + @param preliminaryCode: Code for problem category determined during preliminary assessment. + @param rootRemark: Remarks pertaining to root cause findings during problem diagnosis. + @param rootCause: Root cause of problem determined during diagnosis. + @param preliminaryRemark: Remarks pertaining to preliminary assessment of problem. + @param effect: Effect of problem. + @param finalOrigin: Origin of problem determined during diagnosis. + @param finalCode: Code for diagnosed probem category. + @param rootOrigin: Root origin of problem determined during diagnosis. + @param failureMode: Failuer mode, for example: Failure to Insulate; Failure to conduct; Failure to contain oil; Failure to provide ground plane; Other. + """ + #: Cause of problem determined during diagnosis. + self.finalCause = finalCause + + #: Remarks pertaining to findings during problem diagnosis. + self.finalRemark = finalRemark + + #: Phase(s) diagnosed. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.phaseCode = phaseCode + + #: Date and time preliminary assessment of problem was performed. + self.preliminaryDateTime = preliminaryDateTime + + #: Code for problem category determined during preliminary assessment. + self.preliminaryCode = preliminaryCode + + #: Remarks pertaining to root cause findings during problem diagnosis. + self.rootRemark = rootRemark + + #: Root cause of problem determined during diagnosis. + self.rootCause = rootCause + + #: Remarks pertaining to preliminary assessment of problem. + self.preliminaryRemark = preliminaryRemark + + #: Effect of problem. + self.effect = effect + + #: Origin of problem determined during diagnosis. + self.finalOrigin = finalOrigin + + #: Code for diagnosed probem category. + self.finalCode = finalCode + + #: Root origin of problem determined during diagnosis. + self.rootOrigin = rootOrigin + + #: Failuer mode, for example: Failure to Insulate; Failure to conduct; Failure to contain oil; Failure to provide ground plane; Other. + self.failureMode = failureMode + + super(DiagnosisDataSet, self).__init__(*args, **kw_args) + + _attrs = ["finalCause", "finalRemark", "phaseCode", "preliminaryDateTime", "preliminaryCode", "rootRemark", "rootCause", "preliminaryRemark", "effect", "finalOrigin", "finalCode", "rootOrigin", "failureMode"] + _attr_types = {"finalCause": str, "finalRemark": str, "phaseCode": str, "preliminaryDateTime": str, "preliminaryCode": str, "rootRemark": str, "rootCause": str, "preliminaryRemark": str, "effect": str, "finalOrigin": str, "finalCode": str, "rootOrigin": str, "failureMode": str} + _defaults = {"finalCause": '', "finalRemark": '', "phaseCode": "s12N", "preliminaryDateTime": '', "preliminaryCode": '', "rootRemark": '', "rootCause": '', "preliminaryRemark": '', "effect": '', "finalOrigin": '', "finalCode": '', "rootOrigin": '', "failureMode": ''} + _enums = {"phaseCode": "PhaseCode"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfWork/EquipmentItem.py b/CIM16/IEC61970/Informative/InfWork/EquipmentItem.py new file mode 100755 index 00000000..9d44e90a --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/EquipmentItem.py @@ -0,0 +1,92 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class EquipmentItem(IdentifiedObject): + """An equipment item, such as a vehicle, used for a work order.An equipment item, such as a vehicle, used for a work order. + """ + + def __init__(self, code='', cost=0.0, WorkTask=None, WorkCostDetail=None, status=None, *args, **kw_args): + """Initialises a new 'EquipmentItem' instance. + + @param code: Code for type of vehicle. + @param cost: The cost for vehicle usage. + @param WorkTask: + @param WorkCostDetail: + @param status: + """ + #: Code for type of vehicle. + self.code = code + + #: The cost for vehicle usage. + self.cost = cost + + self._WorkTask = None + self.WorkTask = WorkTask + + self._WorkCostDetail = None + self.WorkCostDetail = WorkCostDetail + + self.status = status + + super(EquipmentItem, self).__init__(*args, **kw_args) + + _attrs = ["code", "cost"] + _attr_types = {"code": str, "cost": float} + _defaults = {"code": '', "cost": 0.0} + _enums = {} + _refs = ["WorkTask", "WorkCostDetail", "status"] + _many_refs = [] + + def getWorkTask(self): + + return self._WorkTask + + def setWorkTask(self, value): + if self._WorkTask is not None: + filtered = [x for x in self.WorkTask.EquipmentItems if x != self] + self._WorkTask._EquipmentItems = filtered + + self._WorkTask = value + if self._WorkTask is not None: + if self not in self._WorkTask._EquipmentItems: + self._WorkTask._EquipmentItems.append(self) + + WorkTask = property(getWorkTask, setWorkTask) + + def getWorkCostDetail(self): + + return self._WorkCostDetail + + def setWorkCostDetail(self, value): + if self._WorkCostDetail is not None: + filtered = [x for x in self.WorkCostDetail.EquipmentItems if x != self] + self._WorkCostDetail._EquipmentItems = filtered + + self._WorkCostDetail = value + if self._WorkCostDetail is not None: + if self not in self._WorkCostDetail._EquipmentItems: + self._WorkCostDetail._EquipmentItems.append(self) + + WorkCostDetail = property(getWorkCostDetail, setWorkCostDetail) + + status = None + diff --git a/CIM16/IEC61970/Informative/InfWork/InfoQuestion.py b/CIM16/IEC61970/Informative/InfWork/InfoQuestion.py new file mode 100755 index 00000000..ce455d0c --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/InfoQuestion.py @@ -0,0 +1,67 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class InfoQuestion(Document): + """Questions and answers associated with a type of document for purposes of clarification. Questions may be predefined or ad hoc.Questions and answers associated with a type of document for purposes of clarification. Questions may be predefined or ad hoc. + """ + + def __init__(self, answer='', answerRemark='', questionText='', answerDateTime='', questionCode='', questionRemark='', questionCategory='', *args, **kw_args): + """Initialises a new 'InfoQuestion' instance. + + @param answer: Answer to question. + @param answerRemark: Remarks to qualify the answer. + @param questionText: For non-coded questions, the question is provided here. + @param answerDateTime: The date and time the quesiton was answered. + @param questionCode: The question code. If blank, refer to questionText. + @param questionRemark: Remarks to qualify the question in this situation. + @param questionCategory: The category of the question. + """ + #: Answer to question. + self.answer = answer + + #: Remarks to qualify the answer. + self.answerRemark = answerRemark + + #: For non-coded questions, the question is provided here. + self.questionText = questionText + + #: The date and time the quesiton was answered. + self.answerDateTime = answerDateTime + + #: The question code. If blank, refer to questionText. + self.questionCode = questionCode + + #: Remarks to qualify the question in this situation. + self.questionRemark = questionRemark + + #: The category of the question. + self.questionCategory = questionCategory + + super(InfoQuestion, self).__init__(*args, **kw_args) + + _attrs = ["answer", "answerRemark", "questionText", "answerDateTime", "questionCode", "questionRemark", "questionCategory"] + _attr_types = {"answer": str, "answerRemark": str, "questionText": str, "answerDateTime": str, "questionCode": str, "questionRemark": str, "questionCategory": str} + _defaults = {"answer": '', "answerRemark": '', "questionText": '', "answerDateTime": '', "questionCode": '', "questionRemark": '', "questionCategory": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfWork/InspectionDataSet.py b/CIM16/IEC61970/Informative/InfWork/InspectionDataSet.py new file mode 100755 index 00000000..b4aea693 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/InspectionDataSet.py @@ -0,0 +1,68 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfAssets.ProcedureDataSet import ProcedureDataSet + +class InspectionDataSet(ProcedureDataSet): + """Documents the result of one inspection, a type of Procedure, for a given attribute of an asset.Documents the result of one inspection, a type of Procedure, for a given attribute of an asset. + """ + + def __init__(self, locationCondition='', AccordingToSchedules=None, *args, **kw_args): + """Initialises a new 'InspectionDataSet' instance. + + @param locationCondition: Description of the conditions of the location where the asset resides. + @param AccordingToSchedules: + """ + #: Description of the conditions of the location where the asset resides. + self.locationCondition = locationCondition + + self._AccordingToSchedules = [] + self.AccordingToSchedules = [] if AccordingToSchedules is None else AccordingToSchedules + + super(InspectionDataSet, self).__init__(*args, **kw_args) + + _attrs = ["locationCondition"] + _attr_types = {"locationCondition": str} + _defaults = {"locationCondition": ''} + _enums = {} + _refs = ["AccordingToSchedules"] + _many_refs = ["AccordingToSchedules"] + + def getAccordingToSchedules(self): + + return self._AccordingToSchedules + + def setAccordingToSchedules(self, value): + for x in self._AccordingToSchedules: + x.ForInspectionDataSet = None + for y in value: + y._ForInspectionDataSet = self + self._AccordingToSchedules = value + + AccordingToSchedules = property(getAccordingToSchedules, setAccordingToSchedules) + + def addAccordingToSchedules(self, *AccordingToSchedules): + for obj in AccordingToSchedules: + obj.ForInspectionDataSet = self + + def removeAccordingToSchedules(self, *AccordingToSchedules): + for obj in AccordingToSchedules: + obj.ForInspectionDataSet = None + diff --git a/CIM16/IEC61970/Informative/InfWork/LaborItem.py b/CIM16/IEC61970/Informative/InfWork/LaborItem.py new file mode 100755 index 00000000..b055d041 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/LaborItem.py @@ -0,0 +1,131 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class LaborItem(IdentifiedObject): + """Labor used for work order.Labor used for work order. + """ + + def __init__(self, cost=0.0, laborRate=0.0, laborDuration=0.0, activityCode='', ErpPersons=None, WorkTask=None, status=None, WorkCostDetail=None, *args, **kw_args): + """Initialises a new 'LaborItem' instance. + + @param cost: Total cost for labor. Note that this may not be able to be derived from labor rate and time charged. + @param laborRate: The labor rate applied for work. + @param laborDuration: Time required to perform work. + @param activityCode: Activity code identifies a specific and distinguishable unit of work. + @param ErpPersons: + @param WorkTask: + @param status: + @param WorkCostDetail: + """ + #: Total cost for labor. Note that this may not be able to be derived from labor rate and time charged. + self.cost = cost + + #: The labor rate applied for work. + self.laborRate = laborRate + + #: Time required to perform work. + self.laborDuration = laborDuration + + #: Activity code identifies a specific and distinguishable unit of work. + self.activityCode = activityCode + + self._ErpPersons = [] + self.ErpPersons = [] if ErpPersons is None else ErpPersons + + self._WorkTask = None + self.WorkTask = WorkTask + + self.status = status + + self._WorkCostDetail = None + self.WorkCostDetail = WorkCostDetail + + super(LaborItem, self).__init__(*args, **kw_args) + + _attrs = ["cost", "laborRate", "laborDuration", "activityCode"] + _attr_types = {"cost": float, "laborRate": float, "laborDuration": float, "activityCode": str} + _defaults = {"cost": 0.0, "laborRate": 0.0, "laborDuration": 0.0, "activityCode": ''} + _enums = {} + _refs = ["ErpPersons", "WorkTask", "status", "WorkCostDetail"] + _many_refs = ["ErpPersons"] + + def getErpPersons(self): + + return self._ErpPersons + + def setErpPersons(self, value): + for p in self._ErpPersons: + filtered = [q for q in p.LaborItems if q != self] + self._ErpPersons._LaborItems = filtered + for r in value: + if self not in r._LaborItems: + r._LaborItems.append(self) + self._ErpPersons = value + + ErpPersons = property(getErpPersons, setErpPersons) + + def addErpPersons(self, *ErpPersons): + for obj in ErpPersons: + if self not in obj._LaborItems: + obj._LaborItems.append(self) + self._ErpPersons.append(obj) + + def removeErpPersons(self, *ErpPersons): + for obj in ErpPersons: + if self in obj._LaborItems: + obj._LaborItems.remove(self) + self._ErpPersons.remove(obj) + + def getWorkTask(self): + + return self._WorkTask + + def setWorkTask(self, value): + if self._WorkTask is not None: + filtered = [x for x in self.WorkTask.LaborItems if x != self] + self._WorkTask._LaborItems = filtered + + self._WorkTask = value + if self._WorkTask is not None: + if self not in self._WorkTask._LaborItems: + self._WorkTask._LaborItems.append(self) + + WorkTask = property(getWorkTask, setWorkTask) + + status = None + + def getWorkCostDetail(self): + + return self._WorkCostDetail + + def setWorkCostDetail(self, value): + if self._WorkCostDetail is not None: + filtered = [x for x in self.WorkCostDetail.LaborItems if x != self] + self._WorkCostDetail._LaborItems = filtered + + self._WorkCostDetail = value + if self._WorkCostDetail is not None: + if self not in self._WorkCostDetail._LaborItems: + self._WorkCostDetail._LaborItems.append(self) + + WorkCostDetail = property(getWorkCostDetail, setWorkCostDetail) + diff --git a/CIM16/IEC61970/Informative/InfWork/MaintenanceDataSet.py b/CIM16/IEC61970/Informative/InfWork/MaintenanceDataSet.py new file mode 100755 index 00000000..2bed6c30 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/MaintenanceDataSet.py @@ -0,0 +1,51 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Informative.InfAssets.ProcedureDataSet import ProcedureDataSet + +class MaintenanceDataSet(ProcedureDataSet): + """The result of a maintenance activity, a type of Procedure, for a given attribute of an asset is documentated in an MaintenanceDataSet.The result of a maintenance activity, a type of Procedure, for a given attribute of an asset is documentated in an MaintenanceDataSet. + """ + + def __init__(self, conditionAfter='', conditionBefore='', maintCode='', *args, **kw_args): + """Initialises a new 'MaintenanceDataSet' instance. + + @param conditionAfter: Condition of asset just following maintenance procedure. + @param conditionBefore: Description of the condition of the asset just prior to maintenance being performed. + @param maintCode: Code for the type of maintenance performed. + """ + #: Condition of asset just following maintenance procedure. + self.conditionAfter = conditionAfter + + #: Description of the condition of the asset just prior to maintenance being performed. + self.conditionBefore = conditionBefore + + #: Code for the type of maintenance performed. + self.maintCode = maintCode + + super(MaintenanceDataSet, self).__init__(*args, **kw_args) + + _attrs = ["conditionAfter", "conditionBefore", "maintCode"] + _attr_types = {"conditionAfter": str, "conditionBefore": str, "maintCode": str} + _defaults = {"conditionAfter": '', "conditionBefore": '', "maintCode": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfWork/MaterialItem.py b/CIM16/IEC61970/Informative/InfWork/MaterialItem.py new file mode 100755 index 00000000..b58526cc --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/MaterialItem.py @@ -0,0 +1,258 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class MaterialItem(IdentifiedObject): + """The physical consumable supply used for work and other purposes. It includes items such as nuts, bolts, brackets, glue, etc.The physical consumable supply used for work and other purposes. It includes items such as nuts, bolts, brackets, glue, etc. + """ + + def __init__(self, costDescription='', quantity="", materialCode='', externalRefID='', costType='', account='', actualCost=0.0, ErpInventoryCounts=None, Usages=None, ErpPOLineItems=None, ErpRecDelvLineItems=None, DesignLocation=None, status=None, TypeMaterial=None, WorkCostDetail=None, WorkTask=None, *args, **kw_args): + """Initialises a new 'MaterialItem' instance. + + @param costDescription: Description of the cost. + @param quantity: The quantity of material used. + @param materialCode: Code for material. + @param externalRefID: External reference identifier for this actual material item such as a purchase order number, a serial number, etc. + @param costType: The category of cost to which this Material Item belongs. + @param account: The account to which this actual material item is charged. + @param actualCost: The actual cost of this particular material in this particular quantity. + @param ErpInventoryCounts: + @param Usages: + @param ErpPOLineItems: + @param ErpRecDelvLineItems: + @param DesignLocation: + @param status: + @param TypeMaterial: + @param WorkCostDetail: + @param WorkTask: + """ + #: Description of the cost. + self.costDescription = costDescription + + #: The quantity of material used. + self.quantity = quantity + + #: Code for material. + self.materialCode = materialCode + + #: External reference identifier for this actual material item such as a purchase order number, a serial number, etc. + self.externalRefID = externalRefID + + #: The category of cost to which this Material Item belongs. + self.costType = costType + + #: The account to which this actual material item is charged. + self.account = account + + #: The actual cost of this particular material in this particular quantity. + self.actualCost = actualCost + + self._ErpInventoryCounts = [] + self.ErpInventoryCounts = [] if ErpInventoryCounts is None else ErpInventoryCounts + + self._Usages = [] + self.Usages = [] if Usages is None else Usages + + self._ErpPOLineItems = [] + self.ErpPOLineItems = [] if ErpPOLineItems is None else ErpPOLineItems + + self._ErpRecDelvLineItems = [] + self.ErpRecDelvLineItems = [] if ErpRecDelvLineItems is None else ErpRecDelvLineItems + + self._DesignLocation = None + self.DesignLocation = DesignLocation + + self.status = status + + self._TypeMaterial = None + self.TypeMaterial = TypeMaterial + + self._WorkCostDetail = None + self.WorkCostDetail = WorkCostDetail + + self._WorkTask = None + self.WorkTask = WorkTask + + super(MaterialItem, self).__init__(*args, **kw_args) + + _attrs = ["costDescription", "quantity", "materialCode", "externalRefID", "costType", "account", "actualCost"] + _attr_types = {"costDescription": str, "quantity": str, "materialCode": str, "externalRefID": str, "costType": str, "account": str, "actualCost": float} + _defaults = {"costDescription": '', "quantity": "", "materialCode": '', "externalRefID": '', "costType": '', "account": '', "actualCost": 0.0} + _enums = {} + _refs = ["ErpInventoryCounts", "Usages", "ErpPOLineItems", "ErpRecDelvLineItems", "DesignLocation", "status", "TypeMaterial", "WorkCostDetail", "WorkTask"] + _many_refs = ["ErpInventoryCounts", "Usages", "ErpPOLineItems", "ErpRecDelvLineItems"] + + def getErpInventoryCounts(self): + + return self._ErpInventoryCounts + + def setErpInventoryCounts(self, value): + for x in self._ErpInventoryCounts: + x.MaterialItem = None + for y in value: + y._MaterialItem = self + self._ErpInventoryCounts = value + + ErpInventoryCounts = property(getErpInventoryCounts, setErpInventoryCounts) + + def addErpInventoryCounts(self, *ErpInventoryCounts): + for obj in ErpInventoryCounts: + obj.MaterialItem = self + + def removeErpInventoryCounts(self, *ErpInventoryCounts): + for obj in ErpInventoryCounts: + obj.MaterialItem = None + + def getUsages(self): + + return self._Usages + + def setUsages(self, value): + for x in self._Usages: + x.MaterialItem = None + for y in value: + y._MaterialItem = self + self._Usages = value + + Usages = property(getUsages, setUsages) + + def addUsages(self, *Usages): + for obj in Usages: + obj.MaterialItem = self + + def removeUsages(self, *Usages): + for obj in Usages: + obj.MaterialItem = None + + def getErpPOLineItems(self): + + return self._ErpPOLineItems + + def setErpPOLineItems(self, value): + for x in self._ErpPOLineItems: + x.MaterialItem = None + for y in value: + y._MaterialItem = self + self._ErpPOLineItems = value + + ErpPOLineItems = property(getErpPOLineItems, setErpPOLineItems) + + def addErpPOLineItems(self, *ErpPOLineItems): + for obj in ErpPOLineItems: + obj.MaterialItem = self + + def removeErpPOLineItems(self, *ErpPOLineItems): + for obj in ErpPOLineItems: + obj.MaterialItem = None + + def getErpRecDelvLineItems(self): + + return self._ErpRecDelvLineItems + + def setErpRecDelvLineItems(self, value): + for p in self._ErpRecDelvLineItems: + filtered = [q for q in p.MaterialItems if q != self] + self._ErpRecDelvLineItems._MaterialItems = filtered + for r in value: + if self not in r._MaterialItems: + r._MaterialItems.append(self) + self._ErpRecDelvLineItems = value + + ErpRecDelvLineItems = property(getErpRecDelvLineItems, setErpRecDelvLineItems) + + def addErpRecDelvLineItems(self, *ErpRecDelvLineItems): + for obj in ErpRecDelvLineItems: + if self not in obj._MaterialItems: + obj._MaterialItems.append(self) + self._ErpRecDelvLineItems.append(obj) + + def removeErpRecDelvLineItems(self, *ErpRecDelvLineItems): + for obj in ErpRecDelvLineItems: + if self in obj._MaterialItems: + obj._MaterialItems.remove(self) + self._ErpRecDelvLineItems.remove(obj) + + def getDesignLocation(self): + + return self._DesignLocation + + def setDesignLocation(self, value): + if self._DesignLocation is not None: + filtered = [x for x in self.DesignLocation.MaterialItems if x != self] + self._DesignLocation._MaterialItems = filtered + + self._DesignLocation = value + if self._DesignLocation is not None: + if self not in self._DesignLocation._MaterialItems: + self._DesignLocation._MaterialItems.append(self) + + DesignLocation = property(getDesignLocation, setDesignLocation) + + status = None + + def getTypeMaterial(self): + + return self._TypeMaterial + + def setTypeMaterial(self, value): + if self._TypeMaterial is not None: + filtered = [x for x in self.TypeMaterial.MaterialItems if x != self] + self._TypeMaterial._MaterialItems = filtered + + self._TypeMaterial = value + if self._TypeMaterial is not None: + if self not in self._TypeMaterial._MaterialItems: + self._TypeMaterial._MaterialItems.append(self) + + TypeMaterial = property(getTypeMaterial, setTypeMaterial) + + def getWorkCostDetail(self): + + return self._WorkCostDetail + + def setWorkCostDetail(self, value): + if self._WorkCostDetail is not None: + filtered = [x for x in self.WorkCostDetail.MaterialItems if x != self] + self._WorkCostDetail._MaterialItems = filtered + + self._WorkCostDetail = value + if self._WorkCostDetail is not None: + if self not in self._WorkCostDetail._MaterialItems: + self._WorkCostDetail._MaterialItems.append(self) + + WorkCostDetail = property(getWorkCostDetail, setWorkCostDetail) + + def getWorkTask(self): + + return self._WorkTask + + def setWorkTask(self, value): + if self._WorkTask is not None: + filtered = [x for x in self.WorkTask.MaterialItems if x != self] + self._WorkTask._MaterialItems = filtered + + self._WorkTask = value + if self._WorkTask is not None: + if self not in self._WorkTask._MaterialItems: + self._WorkTask._MaterialItems.append(self) + + WorkTask = property(getWorkTask, setWorkTask) + diff --git a/CIM16/IEC61970/Informative/InfWork/MiscCostItem.py b/CIM16/IEC61970/Informative/InfWork/MiscCostItem.py new file mode 100755 index 00000000..36f6ef2b --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/MiscCostItem.py @@ -0,0 +1,124 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class MiscCostItem(IdentifiedObject): + """Various cost items that are not associated with compatible units. Examples include rental equipment, labor, materials, contractor costs, permits - anything not covered in a CU.Various cost items that are not associated with compatible units. Examples include rental equipment, labor, materials, contractor costs, permits - anything not covered in a CU. + """ + + def __init__(self, quantity="", costPerUnit=0.0, externalRefID='', account='', costType='', DesignLocation=None, status=None, WorkTask=None, WorkCostDetail=None, *args, **kw_args): + """Initialises a new 'MiscCostItem' instance. + + @param quantity: The quantity of the misc. item being assigned to this location. + @param costPerUnit: The cost per unit for this misc. item. + @param externalRefID: External Reference ID (e.g. PO#, Serial #) + @param account: This drives the accounting treatment for this misc. item. + @param costType: The cost category for accounting, such as material, labor, vehicle, contractor, equipment, overhead. + @param DesignLocation: + @param status: + @param WorkTask: + @param WorkCostDetail: + """ + #: The quantity of the misc. item being assigned to this location. + self.quantity = quantity + + #: The cost per unit for this misc. item. + self.costPerUnit = costPerUnit + + #: External Reference ID (e.g. PO#, Serial #) + self.externalRefID = externalRefID + + #: This drives the accounting treatment for this misc. item. + self.account = account + + #: The cost category for accounting, such as material, labor, vehicle, contractor, equipment, overhead. + self.costType = costType + + self._DesignLocation = None + self.DesignLocation = DesignLocation + + self.status = status + + self._WorkTask = None + self.WorkTask = WorkTask + + self._WorkCostDetail = None + self.WorkCostDetail = WorkCostDetail + + super(MiscCostItem, self).__init__(*args, **kw_args) + + _attrs = ["quantity", "costPerUnit", "externalRefID", "account", "costType"] + _attr_types = {"quantity": str, "costPerUnit": float, "externalRefID": str, "account": str, "costType": str} + _defaults = {"quantity": "", "costPerUnit": 0.0, "externalRefID": '', "account": '', "costType": ''} + _enums = {} + _refs = ["DesignLocation", "status", "WorkTask", "WorkCostDetail"] + _many_refs = [] + + def getDesignLocation(self): + + return self._DesignLocation + + def setDesignLocation(self, value): + if self._DesignLocation is not None: + filtered = [x for x in self.DesignLocation.MiscCostItems if x != self] + self._DesignLocation._MiscCostItems = filtered + + self._DesignLocation = value + if self._DesignLocation is not None: + if self not in self._DesignLocation._MiscCostItems: + self._DesignLocation._MiscCostItems.append(self) + + DesignLocation = property(getDesignLocation, setDesignLocation) + + status = None + + def getWorkTask(self): + + return self._WorkTask + + def setWorkTask(self, value): + if self._WorkTask is not None: + filtered = [x for x in self.WorkTask.MiscCostItems if x != self] + self._WorkTask._MiscCostItems = filtered + + self._WorkTask = value + if self._WorkTask is not None: + if self not in self._WorkTask._MiscCostItems: + self._WorkTask._MiscCostItems.append(self) + + WorkTask = property(getWorkTask, setWorkTask) + + def getWorkCostDetail(self): + + return self._WorkCostDetail + + def setWorkCostDetail(self, value): + if self._WorkCostDetail is not None: + filtered = [x for x in self.WorkCostDetail.MiscCostItems if x != self] + self._WorkCostDetail._MiscCostItems = filtered + + self._WorkCostDetail = value + if self._WorkCostDetail is not None: + if self not in self._WorkCostDetail._MiscCostItems: + self._WorkCostDetail._MiscCostItems.append(self) + + WorkCostDetail = property(getWorkCostDetail, setWorkCostDetail) + diff --git a/CIM16/IEC61970/Informative/InfWork/NonStandardItem.py b/CIM16/IEC61970/Informative/InfWork/NonStandardItem.py new file mode 100755 index 00000000..fc0f6cfc --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/NonStandardItem.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class NonStandardItem(Document): + """This document provides information for non-standard items like customer contributions (e.g., customer digs trench), vouchers (e.g., credit), and contractor bids.This document provides information for non-standard items like customer contributions (e.g., customer digs trench), vouchers (e.g., credit), and contractor bids. + """ + + def __init__(self, code='', amount=0.0, *args, **kw_args): + """Initialises a new 'NonStandardItem' instance. + + @param code: The category of non-standard work. + @param amount: The projected cost for this item. + """ + #: The category of non-standard work. + self.code = code + + #: The projected cost for this item. + self.amount = amount + + super(NonStandardItem, self).__init__(*args, **kw_args) + + _attrs = ["code", "amount"] + _attr_types = {"code": str, "amount": float} + _defaults = {"code": '', "amount": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfWork/OneCallRequest.py b/CIM16/IEC61970/Informative/InfWork/OneCallRequest.py new file mode 100755 index 00000000..0e44aa57 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/OneCallRequest.py @@ -0,0 +1,76 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class OneCallRequest(Document): + """A request for other utilities to mark their underground facilities prior to commencement of construction and/or maintenance.A request for other utilities to mark their underground facilities prior to commencement of construction and/or maintenance. + """ + + def __init__(self, markedIndicator=False, explosivesUsed=False, markingInstruction='', WorkLocations=None, *args, **kw_args): + """Initialises a new 'OneCallRequest' instance. + + @param markedIndicator: True if work location has been marked, for example for a dig area. + @param explosivesUsed: True if explosives have been or are planned to be used. + @param markingInstruction: Instructions for marking a dig area, if applicable. + @param WorkLocations: + """ + #: True if work location has been marked, for example for a dig area. + self.markedIndicator = markedIndicator + + #: True if explosives have been or are planned to be used. + self.explosivesUsed = explosivesUsed + + #: Instructions for marking a dig area, if applicable. + self.markingInstruction = markingInstruction + + self._WorkLocations = [] + self.WorkLocations = [] if WorkLocations is None else WorkLocations + + super(OneCallRequest, self).__init__(*args, **kw_args) + + _attrs = ["markedIndicator", "explosivesUsed", "markingInstruction"] + _attr_types = {"markedIndicator": bool, "explosivesUsed": bool, "markingInstruction": str} + _defaults = {"markedIndicator": False, "explosivesUsed": False, "markingInstruction": ''} + _enums = {} + _refs = ["WorkLocations"] + _many_refs = ["WorkLocations"] + + def getWorkLocations(self): + + return self._WorkLocations + + def setWorkLocations(self, value): + for x in self._WorkLocations: + x.OneCallRequest = None + for y in value: + y._OneCallRequest = self + self._WorkLocations = value + + WorkLocations = property(getWorkLocations, setWorkLocations) + + def addWorkLocations(self, *WorkLocations): + for obj in WorkLocations: + obj.OneCallRequest = self + + def removeWorkLocations(self, *WorkLocations): + for obj in WorkLocations: + obj.OneCallRequest = None + diff --git a/CIM16/IEC61970/Informative/InfWork/OverheadCost.py b/CIM16/IEC61970/Informative/InfWork/OverheadCost.py new file mode 100755 index 00000000..c5a76981 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/OverheadCost.py @@ -0,0 +1,102 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class OverheadCost(IdentifiedObject): + """Overhead cost applied to work order.Overhead cost applied to work order. + """ + + def __init__(self, code='', cost=0.0, status=None, WorkCostDetails=None, WorkTasks=None, *args, **kw_args): + """Initialises a new 'OverheadCost' instance. + + @param code: Overhead code. + @param cost: The overhead cost to be applied. + @param status: + @param WorkCostDetails: + @param WorkTasks: + """ + #: Overhead code. + self.code = code + + #: The overhead cost to be applied. + self.cost = cost + + self.status = status + + self._WorkCostDetails = [] + self.WorkCostDetails = [] if WorkCostDetails is None else WorkCostDetails + + self._WorkTasks = [] + self.WorkTasks = [] if WorkTasks is None else WorkTasks + + super(OverheadCost, self).__init__(*args, **kw_args) + + _attrs = ["code", "cost"] + _attr_types = {"code": str, "cost": float} + _defaults = {"code": '', "cost": 0.0} + _enums = {} + _refs = ["status", "WorkCostDetails", "WorkTasks"] + _many_refs = ["WorkCostDetails", "WorkTasks"] + + status = None + + def getWorkCostDetails(self): + + return self._WorkCostDetails + + def setWorkCostDetails(self, value): + for x in self._WorkCostDetails: + x.OverheadCost = None + for y in value: + y._OverheadCost = self + self._WorkCostDetails = value + + WorkCostDetails = property(getWorkCostDetails, setWorkCostDetails) + + def addWorkCostDetails(self, *WorkCostDetails): + for obj in WorkCostDetails: + obj.OverheadCost = self + + def removeWorkCostDetails(self, *WorkCostDetails): + for obj in WorkCostDetails: + obj.OverheadCost = None + + def getWorkTasks(self): + + return self._WorkTasks + + def setWorkTasks(self, value): + for x in self._WorkTasks: + x.OverheadCost = None + for y in value: + y._OverheadCost = self + self._WorkTasks = value + + WorkTasks = property(getWorkTasks, setWorkTasks) + + def addWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + obj.OverheadCost = self + + def removeWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + obj.OverheadCost = None + diff --git a/CIM16/IEC61970/Informative/InfWork/Project.py b/CIM16/IEC61970/Informative/InfWork/Project.py new file mode 100755 index 00000000..87c930ff --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/Project.py @@ -0,0 +1,184 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class Project(Document): + """A collection of related work. For construction projects and maintenance projects, multiple phases may be performed.A collection of related work. For construction projects and maintenance projects, multiple phases may be performed. + """ + + def __init__(self, budget=0.0, BusinessCase=None, SubProjects=None, ErpProjectAccounting=None, Requests=None, Works=None, ParentProject=None, *args, **kw_args): + """Initialises a new 'Project' instance. + + @param budget: Overall project budget. + @param BusinessCase: + @param SubProjects: + @param ErpProjectAccounting: + @param Requests: + @param Works: + @param ParentProject: + """ + #: Overall project budget. + self.budget = budget + + self._BusinessCase = None + self.BusinessCase = BusinessCase + + self._SubProjects = [] + self.SubProjects = [] if SubProjects is None else SubProjects + + self._ErpProjectAccounting = None + self.ErpProjectAccounting = ErpProjectAccounting + + self._Requests = [] + self.Requests = [] if Requests is None else Requests + + self._Works = [] + self.Works = [] if Works is None else Works + + self._ParentProject = None + self.ParentProject = ParentProject + + super(Project, self).__init__(*args, **kw_args) + + _attrs = ["budget"] + _attr_types = {"budget": float} + _defaults = {"budget": 0.0} + _enums = {} + _refs = ["BusinessCase", "SubProjects", "ErpProjectAccounting", "Requests", "Works", "ParentProject"] + _many_refs = ["SubProjects", "Requests", "Works"] + + def getBusinessCase(self): + + return self._BusinessCase + + def setBusinessCase(self, value): + if self._BusinessCase is not None: + filtered = [x for x in self.BusinessCase.Projects if x != self] + self._BusinessCase._Projects = filtered + + self._BusinessCase = value + if self._BusinessCase is not None: + if self not in self._BusinessCase._Projects: + self._BusinessCase._Projects.append(self) + + BusinessCase = property(getBusinessCase, setBusinessCase) + + def getSubProjects(self): + + return self._SubProjects + + def setSubProjects(self, value): + for x in self._SubProjects: + x.ParentProject = None + for y in value: + y._ParentProject = self + self._SubProjects = value + + SubProjects = property(getSubProjects, setSubProjects) + + def addSubProjects(self, *SubProjects): + for obj in SubProjects: + obj.ParentProject = self + + def removeSubProjects(self, *SubProjects): + for obj in SubProjects: + obj.ParentProject = None + + def getErpProjectAccounting(self): + + return self._ErpProjectAccounting + + def setErpProjectAccounting(self, value): + if self._ErpProjectAccounting is not None: + filtered = [x for x in self.ErpProjectAccounting.Projects if x != self] + self._ErpProjectAccounting._Projects = filtered + + self._ErpProjectAccounting = value + if self._ErpProjectAccounting is not None: + if self not in self._ErpProjectAccounting._Projects: + self._ErpProjectAccounting._Projects.append(self) + + ErpProjectAccounting = property(getErpProjectAccounting, setErpProjectAccounting) + + def getRequests(self): + + return self._Requests + + def setRequests(self, value): + for p in self._Requests: + filtered = [q for q in p.Projects if q != self] + self._Requests._Projects = filtered + for r in value: + if self not in r._Projects: + r._Projects.append(self) + self._Requests = value + + Requests = property(getRequests, setRequests) + + def addRequests(self, *Requests): + for obj in Requests: + if self not in obj._Projects: + obj._Projects.append(self) + self._Requests.append(obj) + + def removeRequests(self, *Requests): + for obj in Requests: + if self in obj._Projects: + obj._Projects.remove(self) + self._Requests.remove(obj) + + def getWorks(self): + + return self._Works + + def setWorks(self, value): + for x in self._Works: + x.Project = None + for y in value: + y._Project = self + self._Works = value + + Works = property(getWorks, setWorks) + + def addWorks(self, *Works): + for obj in Works: + obj.Project = self + + def removeWorks(self, *Works): + for obj in Works: + obj.Project = None + + def getParentProject(self): + + return self._ParentProject + + def setParentProject(self, value): + if self._ParentProject is not None: + filtered = [x for x in self.ParentProject.SubProjects if x != self] + self._ParentProject._SubProjects = filtered + + self._ParentProject = value + if self._ParentProject is not None: + if self not in self._ParentProject._SubProjects: + self._ParentProject._SubProjects.append(self) + + ParentProject = property(getParentProject, setParentProject) + diff --git a/CIM16/IEC61970/Informative/InfWork/PropertyUnit.py b/CIM16/IEC61970/Informative/InfWork/PropertyUnit.py new file mode 100755 index 00000000..bb4eba27 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/PropertyUnit.py @@ -0,0 +1,143 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PropertyUnit(IdentifiedObject): + """Unit of property for reporting purposes.Unit of property for reporting purposes. + """ + + def __init__(self, accountingUsage='', propertyAccount='', activityCode="install", status=None, CompatibleUnits=None, CUMaterialItems=None, WorkCostDetails=None, *args, **kw_args): + """Initialises a new 'PropertyUnit' instance. + + @param accountingUsage: A code that identifies appropriate type of property accounts such as distribution, streetlgihts, communications. + @param propertyAccount: Used for property record accounting. For example, in the USA, this would be a FERC account. + @param activityCode: Activity code identifies a specific and distinguishable work action. Values are: "install", "remove", "transfer", "abandon" + @param status: + @param CompatibleUnits: + @param CUMaterialItems: + @param WorkCostDetails: + """ + #: A code that identifies appropriate type of property accounts such as distribution, streetlgihts, communications. + self.accountingUsage = accountingUsage + + #: Used for property record accounting. For example, in the USA, this would be a FERC account. + self.propertyAccount = propertyAccount + + #: Activity code identifies a specific and distinguishable work action. Values are: "install", "remove", "transfer", "abandon" + self.activityCode = activityCode + + self.status = status + + self._CompatibleUnits = [] + self.CompatibleUnits = [] if CompatibleUnits is None else CompatibleUnits + + self._CUMaterialItems = [] + self.CUMaterialItems = [] if CUMaterialItems is None else CUMaterialItems + + self._WorkCostDetails = [] + self.WorkCostDetails = [] if WorkCostDetails is None else WorkCostDetails + + super(PropertyUnit, self).__init__(*args, **kw_args) + + _attrs = ["accountingUsage", "propertyAccount", "activityCode"] + _attr_types = {"accountingUsage": str, "propertyAccount": str, "activityCode": str} + _defaults = {"accountingUsage": '', "propertyAccount": '', "activityCode": "install"} + _enums = {"activityCode": "WorkActionKind"} + _refs = ["status", "CompatibleUnits", "CUMaterialItems", "WorkCostDetails"] + _many_refs = ["CompatibleUnits", "CUMaterialItems", "WorkCostDetails"] + + status = None + + def getCompatibleUnits(self): + + return self._CompatibleUnits + + def setCompatibleUnits(self, value): + for x in self._CompatibleUnits: + x.PropertyUnit = None + for y in value: + y._PropertyUnit = self + self._CompatibleUnits = value + + CompatibleUnits = property(getCompatibleUnits, setCompatibleUnits) + + def addCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + obj.PropertyUnit = self + + def removeCompatibleUnits(self, *CompatibleUnits): + for obj in CompatibleUnits: + obj.PropertyUnit = None + + def getCUMaterialItems(self): + + return self._CUMaterialItems + + def setCUMaterialItems(self, value): + for p in self._CUMaterialItems: + filtered = [q for q in p.PropertyUnits if q != self] + self._CUMaterialItems._PropertyUnits = filtered + for r in value: + if self not in r._PropertyUnits: + r._PropertyUnits.append(self) + self._CUMaterialItems = value + + CUMaterialItems = property(getCUMaterialItems, setCUMaterialItems) + + def addCUMaterialItems(self, *CUMaterialItems): + for obj in CUMaterialItems: + if self not in obj._PropertyUnits: + obj._PropertyUnits.append(self) + self._CUMaterialItems.append(obj) + + def removeCUMaterialItems(self, *CUMaterialItems): + for obj in CUMaterialItems: + if self in obj._PropertyUnits: + obj._PropertyUnits.remove(self) + self._CUMaterialItems.remove(obj) + + def getWorkCostDetails(self): + + return self._WorkCostDetails + + def setWorkCostDetails(self, value): + for p in self._WorkCostDetails: + filtered = [q for q in p.PropertyUnits if q != self] + self._WorkCostDetails._PropertyUnits = filtered + for r in value: + if self not in r._PropertyUnits: + r._PropertyUnits.append(self) + self._WorkCostDetails = value + + WorkCostDetails = property(getWorkCostDetails, setWorkCostDetails) + + def addWorkCostDetails(self, *WorkCostDetails): + for obj in WorkCostDetails: + if self not in obj._PropertyUnits: + obj._PropertyUnits.append(self) + self._WorkCostDetails.append(obj) + + def removeWorkCostDetails(self, *WorkCostDetails): + for obj in WorkCostDetails: + if self in obj._PropertyUnits: + obj._PropertyUnits.remove(self) + self._WorkCostDetails.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfWork/QualificationRequirement.py b/CIM16/IEC61970/Informative/InfWork/QualificationRequirement.py new file mode 100755 index 00000000..686d346f --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/QualificationRequirement.py @@ -0,0 +1,167 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class QualificationRequirement(IdentifiedObject): + """Certain skills are required and must be certified in order for a person (typically a member of a crew) to be qualified to work on types of equipment.Certain skills are required and must be certified in order for a person (typically a member of a crew) to be qualified to work on types of equipment. + """ + + def __init__(self, qualificationID='', WorkTasks=None, Skills=None, CULaborItems=None, Specifications=None, *args, **kw_args): + """Initialises a new 'QualificationRequirement' instance. + + @param qualificationID: Qualification identifier. + @param WorkTasks: + @param Skills: + @param CULaborItems: + @param Specifications: + """ + #: Qualification identifier. + self.qualificationID = qualificationID + + self._WorkTasks = [] + self.WorkTasks = [] if WorkTasks is None else WorkTasks + + self._Skills = [] + self.Skills = [] if Skills is None else Skills + + self._CULaborItems = [] + self.CULaborItems = [] if CULaborItems is None else CULaborItems + + self._Specifications = [] + self.Specifications = [] if Specifications is None else Specifications + + super(QualificationRequirement, self).__init__(*args, **kw_args) + + _attrs = ["qualificationID"] + _attr_types = {"qualificationID": str} + _defaults = {"qualificationID": ''} + _enums = {} + _refs = ["WorkTasks", "Skills", "CULaborItems", "Specifications"] + _many_refs = ["WorkTasks", "Skills", "CULaborItems", "Specifications"] + + def getWorkTasks(self): + + return self._WorkTasks + + def setWorkTasks(self, value): + for p in self._WorkTasks: + filtered = [q for q in p.QualificationRequirements if q != self] + self._WorkTasks._QualificationRequirements = filtered + for r in value: + if self not in r._QualificationRequirements: + r._QualificationRequirements.append(self) + self._WorkTasks = value + + WorkTasks = property(getWorkTasks, setWorkTasks) + + def addWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + if self not in obj._QualificationRequirements: + obj._QualificationRequirements.append(self) + self._WorkTasks.append(obj) + + def removeWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + if self in obj._QualificationRequirements: + obj._QualificationRequirements.remove(self) + self._WorkTasks.remove(obj) + + def getSkills(self): + + return self._Skills + + def setSkills(self, value): + for p in self._Skills: + filtered = [q for q in p.QualificationRequirements if q != self] + self._Skills._QualificationRequirements = filtered + for r in value: + if self not in r._QualificationRequirements: + r._QualificationRequirements.append(self) + self._Skills = value + + Skills = property(getSkills, setSkills) + + def addSkills(self, *Skills): + for obj in Skills: + if self not in obj._QualificationRequirements: + obj._QualificationRequirements.append(self) + self._Skills.append(obj) + + def removeSkills(self, *Skills): + for obj in Skills: + if self in obj._QualificationRequirements: + obj._QualificationRequirements.remove(self) + self._Skills.remove(obj) + + def getCULaborItems(self): + + return self._CULaborItems + + def setCULaborItems(self, value): + for p in self._CULaborItems: + filtered = [q for q in p.QualificationRequirements if q != self] + self._CULaborItems._QualificationRequirements = filtered + for r in value: + if self not in r._QualificationRequirements: + r._QualificationRequirements.append(self) + self._CULaborItems = value + + CULaborItems = property(getCULaborItems, setCULaborItems) + + def addCULaborItems(self, *CULaborItems): + for obj in CULaborItems: + if self not in obj._QualificationRequirements: + obj._QualificationRequirements.append(self) + self._CULaborItems.append(obj) + + def removeCULaborItems(self, *CULaborItems): + for obj in CULaborItems: + if self in obj._QualificationRequirements: + obj._QualificationRequirements.remove(self) + self._CULaborItems.remove(obj) + + def getSpecifications(self): + + return self._Specifications + + def setSpecifications(self, value): + for p in self._Specifications: + filtered = [q for q in p.QualificationRequirements if q != self] + self._Specifications._QualificationRequirements = filtered + for r in value: + if self not in r._QualificationRequirements: + r._QualificationRequirements.append(self) + self._Specifications = value + + Specifications = property(getSpecifications, setSpecifications) + + def addSpecifications(self, *Specifications): + for obj in Specifications: + if self not in obj._QualificationRequirements: + obj._QualificationRequirements.append(self) + self._Specifications.append(obj) + + def removeSpecifications(self, *Specifications): + for obj in Specifications: + if self in obj._QualificationRequirements: + obj._QualificationRequirements.remove(self) + self._Specifications.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfWork/Regulation.py b/CIM16/IEC61970/Informative/InfWork/Regulation.py new file mode 100755 index 00000000..97e79460 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/Regulation.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class Regulation(Document): + """Special requirements and/or regulations may pertain to certain types of assets or work. For example, fire protection and scaffolding.Special requirements and/or regulations may pertain to certain types of assets or work. For example, fire protection and scaffolding. + """ + + def __init__(self, referenceNumber='', *args, **kw_args): + """Initialises a new 'Regulation' instance. + + @param referenceNumber: External reference to regulation, if applicable. + """ + #: External reference to regulation, if applicable. + self.referenceNumber = referenceNumber + + super(Regulation, self).__init__(*args, **kw_args) + + _attrs = ["referenceNumber"] + _attr_types = {"referenceNumber": str} + _defaults = {"referenceNumber": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfWork/Request.py b/CIM16/IEC61970/Informative/InfWork/Request.py new file mode 100755 index 00000000..65874128 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/Request.py @@ -0,0 +1,146 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class Request(Document): + """A request for work, service or project.A request for work, service or project. + """ + + def __init__(self, actionNeeded='', priority='', corporateCode='', ErpQuoteLineItem=None, Projects=None, Organisation=None, Works=None, *args, **kw_args): + """Initialises a new 'Request' instance. + + @param actionNeeded: Based on the current 'Status.status', the action that is needed before this Request can transition to the desired state, such as initiating the requested Work. For example, missing or additionally needed information may be required from the requesting organisation before a work Design may be created. + @param priority: The priority of this request. + @param corporateCode: The corporate code for this request. + @param ErpQuoteLineItem: + @param Projects: + @param Organisation: + @param Works: + """ + #: Based on the current 'Status.status', the action that is needed before this Request can transition to the desired state, such as initiating the requested Work. For example, missing or additionally needed information may be required from the requesting organisation before a work Design may be created. + self.actionNeeded = actionNeeded + + #: The priority of this request. + self.priority = priority + + #: The corporate code for this request. + self.corporateCode = corporateCode + + self._ErpQuoteLineItem = None + self.ErpQuoteLineItem = ErpQuoteLineItem + + self._Projects = [] + self.Projects = [] if Projects is None else Projects + + self._Organisation = None + self.Organisation = Organisation + + self._Works = [] + self.Works = [] if Works is None else Works + + super(Request, self).__init__(*args, **kw_args) + + _attrs = ["actionNeeded", "priority", "corporateCode"] + _attr_types = {"actionNeeded": str, "priority": str, "corporateCode": str} + _defaults = {"actionNeeded": '', "priority": '', "corporateCode": ''} + _enums = {} + _refs = ["ErpQuoteLineItem", "Projects", "Organisation", "Works"] + _many_refs = ["Projects", "Works"] + + def getErpQuoteLineItem(self): + + return self._ErpQuoteLineItem + + def setErpQuoteLineItem(self, value): + if self._ErpQuoteLineItem is not None: + self._ErpQuoteLineItem._Request = None + + self._ErpQuoteLineItem = value + if self._ErpQuoteLineItem is not None: + self._ErpQuoteLineItem.Request = None + self._ErpQuoteLineItem._Request = self + + ErpQuoteLineItem = property(getErpQuoteLineItem, setErpQuoteLineItem) + + def getProjects(self): + + return self._Projects + + def setProjects(self, value): + for p in self._Projects: + filtered = [q for q in p.Requests if q != self] + self._Projects._Requests = filtered + for r in value: + if self not in r._Requests: + r._Requests.append(self) + self._Projects = value + + Projects = property(getProjects, setProjects) + + def addProjects(self, *Projects): + for obj in Projects: + if self not in obj._Requests: + obj._Requests.append(self) + self._Projects.append(obj) + + def removeProjects(self, *Projects): + for obj in Projects: + if self in obj._Requests: + obj._Requests.remove(self) + self._Projects.remove(obj) + + def getOrganisation(self): + + return self._Organisation + + def setOrganisation(self, value): + if self._Organisation is not None: + filtered = [x for x in self.Organisation.Requests if x != self] + self._Organisation._Requests = filtered + + self._Organisation = value + if self._Organisation is not None: + if self not in self._Organisation._Requests: + self._Organisation._Requests.append(self) + + Organisation = property(getOrganisation, setOrganisation) + + def getWorks(self): + + return self._Works + + def setWorks(self, value): + for x in self._Works: + x.Request = None + for y in value: + y._Request = self + self._Works = value + + Works = property(getWorks, setWorks) + + def addWorks(self, *Works): + for obj in Works: + obj.Request = self + + def removeWorks(self, *Works): + for obj in Works: + obj.Request = None + diff --git a/CIM16/IEC61970/Informative/InfWork/ShiftPattern.py b/CIM16/IEC61970/Informative/InfWork/ShiftPattern.py new file mode 100755 index 00000000..d009b51d --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/ShiftPattern.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ShiftPattern(IdentifiedObject): + """The patterns of shifts worked by people or crews.The patterns of shifts worked by people or crews. + """ + + def __init__(self, cycleCount=0, assignmentType='', Crews=None, status=None, validityInterval=None, *args, **kw_args): + """Initialises a new 'ShiftPattern' instance. + + @param cycleCount: Number of cycles for a temporary shift. + @param assignmentType: Type of assignement intended to be worked on this shift, for example, temporary, standard, etc. + @param Crews: + @param status: + @param validityInterval: Date and time interval for which this shift pattern is valid (when it became effective and when it expires). + """ + #: Number of cycles for a temporary shift. + self.cycleCount = cycleCount + + #: Type of assignement intended to be worked on this shift, for example, temporary, standard, etc. + self.assignmentType = assignmentType + + self._Crews = [] + self.Crews = [] if Crews is None else Crews + + self.status = status + + self.validityInterval = validityInterval + + super(ShiftPattern, self).__init__(*args, **kw_args) + + _attrs = ["cycleCount", "assignmentType"] + _attr_types = {"cycleCount": int, "assignmentType": str} + _defaults = {"cycleCount": 0, "assignmentType": ''} + _enums = {} + _refs = ["Crews", "status", "validityInterval"] + _many_refs = ["Crews"] + + def getCrews(self): + + return self._Crews + + def setCrews(self, value): + for p in self._Crews: + filtered = [q for q in p.ShiftPatterns if q != self] + self._Crews._ShiftPatterns = filtered + for r in value: + if self not in r._ShiftPatterns: + r._ShiftPatterns.append(self) + self._Crews = value + + Crews = property(getCrews, setCrews) + + def addCrews(self, *Crews): + for obj in Crews: + if self not in obj._ShiftPatterns: + obj._ShiftPatterns.append(self) + self._Crews.append(obj) + + def removeCrews(self, *Crews): + for obj in Crews: + if self in obj._ShiftPatterns: + obj._ShiftPatterns.remove(self) + self._Crews.remove(obj) + + status = None + + # Date and time interval for which this shift pattern is valid (when it became effective and when it expires). + validityInterval = None + diff --git a/CIM16/IEC61970/Informative/InfWork/TypeMaterial.py b/CIM16/IEC61970/Informative/InfWork/TypeMaterial.py new file mode 100755 index 00000000..89012869 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/TypeMaterial.py @@ -0,0 +1,155 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class TypeMaterial(Document): + """Documentation for a generic material item that may be used for design, work and other purposes. Any number of MaterialItems manufactured by various vendors may be used to perform this TypeMaterial. Note that class analagous to 'AssetModel' is not used for material items. This is because in some cases, for example, a utility sets up a Master material record for a 3 inch long half inch diameter steel bolt and they do not necessarily care what specific supplier is providing the material item. As different vendors are used to supply the part, the Stock Code of the material item can stay the same. In other cases, each time the vendor changes, a new stock code is set up so they can track material used by vendor. Therefore a Material Item 'Model' is not typically needed.Documentation for a generic material item that may be used for design, work and other purposes. Any number of MaterialItems manufactured by various vendors may be used to perform this TypeMaterial. Note that class analagous to 'AssetModel' is not used for material items. This is because in some cases, for example, a utility sets up a Master material record for a 3 inch long half inch diameter steel bolt and they do not necessarily care what specific supplier is providing the material item. As different vendors are used to supply the part, the Stock Code of the material item can stay the same. In other cases, each time the vendor changes, a new stock code is set up so they can track material used by vendor. Therefore a Material Item 'Model' is not typically needed. + """ + + def __init__(self, stockItem=False, costType='', quantity='', estUnitCost=0.0, ErpIssueInventories=None, MaterialItems=None, CUMaterialItems=None, ErpReqLineItems=None, *args, **kw_args): + """Initialises a new 'TypeMaterial' instance. + + @param stockItem: True if item is a stock item (default). + @param costType: The category of cost to which this Material Item belongs. + @param quantity: The value, unit of measure, and multiplier for the quantity. + @param estUnitCost: The estimated unit cost of this type of material, either for a unit cost or cost per unit length. Cost is for material or asset only and does not include labor to install/construct or configure it. + @param ErpIssueInventories: + @param MaterialItems: + @param CUMaterialItems: + @param ErpReqLineItems: + """ + #: True if item is a stock item (default). + self.stockItem = stockItem + + #: The category of cost to which this Material Item belongs. + self.costType = costType + + #: The value, unit of measure, and multiplier for the quantity. + self.quantity = quantity + + #: The estimated unit cost of this type of material, either for a unit cost or cost per unit length. Cost is for material or asset only and does not include labor to install/construct or configure it. + self.estUnitCost = estUnitCost + + self._ErpIssueInventories = [] + self.ErpIssueInventories = [] if ErpIssueInventories is None else ErpIssueInventories + + self._MaterialItems = [] + self.MaterialItems = [] if MaterialItems is None else MaterialItems + + self._CUMaterialItems = [] + self.CUMaterialItems = [] if CUMaterialItems is None else CUMaterialItems + + self._ErpReqLineItems = [] + self.ErpReqLineItems = [] if ErpReqLineItems is None else ErpReqLineItems + + super(TypeMaterial, self).__init__(*args, **kw_args) + + _attrs = ["stockItem", "costType", "quantity", "estUnitCost"] + _attr_types = {"stockItem": bool, "costType": str, "quantity": str, "estUnitCost": float} + _defaults = {"stockItem": False, "costType": '', "quantity": '', "estUnitCost": 0.0} + _enums = {} + _refs = ["ErpIssueInventories", "MaterialItems", "CUMaterialItems", "ErpReqLineItems"] + _many_refs = ["ErpIssueInventories", "MaterialItems", "CUMaterialItems", "ErpReqLineItems"] + + def getErpIssueInventories(self): + + return self._ErpIssueInventories + + def setErpIssueInventories(self, value): + for x in self._ErpIssueInventories: + x.TypeMaterial = None + for y in value: + y._TypeMaterial = self + self._ErpIssueInventories = value + + ErpIssueInventories = property(getErpIssueInventories, setErpIssueInventories) + + def addErpIssueInventories(self, *ErpIssueInventories): + for obj in ErpIssueInventories: + obj.TypeMaterial = self + + def removeErpIssueInventories(self, *ErpIssueInventories): + for obj in ErpIssueInventories: + obj.TypeMaterial = None + + def getMaterialItems(self): + + return self._MaterialItems + + def setMaterialItems(self, value): + for x in self._MaterialItems: + x.TypeMaterial = None + for y in value: + y._TypeMaterial = self + self._MaterialItems = value + + MaterialItems = property(getMaterialItems, setMaterialItems) + + def addMaterialItems(self, *MaterialItems): + for obj in MaterialItems: + obj.TypeMaterial = self + + def removeMaterialItems(self, *MaterialItems): + for obj in MaterialItems: + obj.TypeMaterial = None + + def getCUMaterialItems(self): + + return self._CUMaterialItems + + def setCUMaterialItems(self, value): + for x in self._CUMaterialItems: + x.TypeMaterial = None + for y in value: + y._TypeMaterial = self + self._CUMaterialItems = value + + CUMaterialItems = property(getCUMaterialItems, setCUMaterialItems) + + def addCUMaterialItems(self, *CUMaterialItems): + for obj in CUMaterialItems: + obj.TypeMaterial = self + + def removeCUMaterialItems(self, *CUMaterialItems): + for obj in CUMaterialItems: + obj.TypeMaterial = None + + def getErpReqLineItems(self): + + return self._ErpReqLineItems + + def setErpReqLineItems(self, value): + for x in self._ErpReqLineItems: + x.TypeMaterial = None + for y in value: + y._TypeMaterial = self + self._ErpReqLineItems = value + + ErpReqLineItems = property(getErpReqLineItems, setErpReqLineItems) + + def addErpReqLineItems(self, *ErpReqLineItems): + for obj in ErpReqLineItems: + obj.TypeMaterial = self + + def removeErpReqLineItems(self, *ErpReqLineItems): + for obj in ErpReqLineItems: + obj.TypeMaterial = None + diff --git a/CIM16/IEC61970/Informative/InfWork/Usage.py b/CIM16/IEC61970/Informative/InfWork/Usage.py new file mode 100755 index 00000000..70977361 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/Usage.py @@ -0,0 +1,104 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Usage(IdentifiedObject): + """The way material and assets are used to perform a certain type of work task. The way is described in text in the inheritied description attribute.The way material and assets are used to perform a certain type of work task. The way is described in text in the inheritied description attribute. + """ + + def __init__(self, WorkTask=None, WorkEquipmentAsset=None, status=None, MaterialItem=None, *args, **kw_args): + """Initialises a new 'Usage' instance. + + @param WorkTask: + @param WorkEquipmentAsset: + @param status: + @param MaterialItem: + """ + self._WorkTask = None + self.WorkTask = WorkTask + + self._WorkEquipmentAsset = None + self.WorkEquipmentAsset = WorkEquipmentAsset + + self.status = status + + self._MaterialItem = None + self.MaterialItem = MaterialItem + + super(Usage, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["WorkTask", "WorkEquipmentAsset", "status", "MaterialItem"] + _many_refs = [] + + def getWorkTask(self): + + return self._WorkTask + + def setWorkTask(self, value): + if self._WorkTask is not None: + filtered = [x for x in self.WorkTask.Usages if x != self] + self._WorkTask._Usages = filtered + + self._WorkTask = value + if self._WorkTask is not None: + if self not in self._WorkTask._Usages: + self._WorkTask._Usages.append(self) + + WorkTask = property(getWorkTask, setWorkTask) + + def getWorkEquipmentAsset(self): + + return self._WorkEquipmentAsset + + def setWorkEquipmentAsset(self, value): + if self._WorkEquipmentAsset is not None: + filtered = [x for x in self.WorkEquipmentAsset.Usages if x != self] + self._WorkEquipmentAsset._Usages = filtered + + self._WorkEquipmentAsset = value + if self._WorkEquipmentAsset is not None: + if self not in self._WorkEquipmentAsset._Usages: + self._WorkEquipmentAsset._Usages.append(self) + + WorkEquipmentAsset = property(getWorkEquipmentAsset, setWorkEquipmentAsset) + + status = None + + def getMaterialItem(self): + + return self._MaterialItem + + def setMaterialItem(self, value): + if self._MaterialItem is not None: + filtered = [x for x in self.MaterialItem.Usages if x != self] + self._MaterialItem._Usages = filtered + + self._MaterialItem = value + if self._MaterialItem is not None: + if self not in self._MaterialItem._Usages: + self._MaterialItem._Usages.append(self) + + MaterialItem = property(getMaterialItem, setMaterialItem) + diff --git a/CIM16/IEC61970/Informative/InfWork/WorkCostDetail.py b/CIM16/IEC61970/Informative/InfWork/WorkCostDetail.py new file mode 100755 index 00000000..aae4fc77 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/WorkCostDetail.py @@ -0,0 +1,361 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class WorkCostDetail(Document): + """A collection of all of the individual cost items collected from multiple sources.A collection of all of the individual cost items collected from multiple sources. + """ + + def __init__(self, type='', isDebit=False, transactionDateTime='', amount=0.0, WorkTask=None, Works=None, Design=None, MiscCostItems=None, WorkCostSummary=None, PropertyUnits=None, ErpProjectAccounting=None, LaborItems=None, MaterialItems=None, EquipmentItems=None, ContractorItems=None, OverheadCost=None, CostType=None, *args, **kw_args): + """Initialises a new 'WorkCostDetail' instance. + + @param type: Type of work cost. + @param isDebit: True if 'amount' is a debit, false if it is a credit. + @param transactionDateTime: Date and time that 'amount' is posted to the work. + @param amount: Amount in designated currency for work, either a total or an individual element. As defined in the attribute 'type,' multiple instances are applicable to each work for: planned cost, actual cost, authorized cost, budgeted cost, forecasted cost, other. + @param WorkTask: + @param Works: + @param Design: + @param MiscCostItems: + @param WorkCostSummary: + @param PropertyUnits: + @param ErpProjectAccounting: + @param LaborItems: + @param MaterialItems: + @param EquipmentItems: + @param ContractorItems: + @param OverheadCost: + @param CostType: + """ + #: Type of work cost. + self.type = type + + #: True if 'amount' is a debit, false if it is a credit. + self.isDebit = isDebit + + #: Date and time that 'amount' is posted to the work. + self.transactionDateTime = transactionDateTime + + #: Amount in designated currency for work, either a total or an individual element. As defined in the attribute 'type,' multiple instances are applicable to each work for: planned cost, actual cost, authorized cost, budgeted cost, forecasted cost, other. + self.amount = amount + + self._WorkTask = None + self.WorkTask = WorkTask + + self._Works = [] + self.Works = [] if Works is None else Works + + self._Design = None + self.Design = Design + + self._MiscCostItems = [] + self.MiscCostItems = [] if MiscCostItems is None else MiscCostItems + + self._WorkCostSummary = None + self.WorkCostSummary = WorkCostSummary + + self._PropertyUnits = [] + self.PropertyUnits = [] if PropertyUnits is None else PropertyUnits + + self._ErpProjectAccounting = None + self.ErpProjectAccounting = ErpProjectAccounting + + self._LaborItems = [] + self.LaborItems = [] if LaborItems is None else LaborItems + + self._MaterialItems = [] + self.MaterialItems = [] if MaterialItems is None else MaterialItems + + self._EquipmentItems = [] + self.EquipmentItems = [] if EquipmentItems is None else EquipmentItems + + self._ContractorItems = [] + self.ContractorItems = [] if ContractorItems is None else ContractorItems + + self._OverheadCost = None + self.OverheadCost = OverheadCost + + self._CostType = None + self.CostType = CostType + + super(WorkCostDetail, self).__init__(*args, **kw_args) + + _attrs = ["type", "isDebit", "transactionDateTime", "amount"] + _attr_types = {"type": str, "isDebit": bool, "transactionDateTime": str, "amount": float} + _defaults = {"type": '', "isDebit": False, "transactionDateTime": '', "amount": 0.0} + _enums = {} + _refs = ["WorkTask", "Works", "Design", "MiscCostItems", "WorkCostSummary", "PropertyUnits", "ErpProjectAccounting", "LaborItems", "MaterialItems", "EquipmentItems", "ContractorItems", "OverheadCost", "CostType"] + _many_refs = ["Works", "MiscCostItems", "PropertyUnits", "LaborItems", "MaterialItems", "EquipmentItems", "ContractorItems"] + + def getWorkTask(self): + + return self._WorkTask + + def setWorkTask(self, value): + if self._WorkTask is not None: + filtered = [x for x in self.WorkTask.WorkCostDetails if x != self] + self._WorkTask._WorkCostDetails = filtered + + self._WorkTask = value + if self._WorkTask is not None: + if self not in self._WorkTask._WorkCostDetails: + self._WorkTask._WorkCostDetails.append(self) + + WorkTask = property(getWorkTask, setWorkTask) + + def getWorks(self): + + return self._Works + + def setWorks(self, value): + for p in self._Works: + filtered = [q for q in p.WorkCostDetails if q != self] + self._Works._WorkCostDetails = filtered + for r in value: + if self not in r._WorkCostDetails: + r._WorkCostDetails.append(self) + self._Works = value + + Works = property(getWorks, setWorks) + + def addWorks(self, *Works): + for obj in Works: + if self not in obj._WorkCostDetails: + obj._WorkCostDetails.append(self) + self._Works.append(obj) + + def removeWorks(self, *Works): + for obj in Works: + if self in obj._WorkCostDetails: + obj._WorkCostDetails.remove(self) + self._Works.remove(obj) + + def getDesign(self): + + return self._Design + + def setDesign(self, value): + if self._Design is not None: + filtered = [x for x in self.Design.WorkCostDetails if x != self] + self._Design._WorkCostDetails = filtered + + self._Design = value + if self._Design is not None: + if self not in self._Design._WorkCostDetails: + self._Design._WorkCostDetails.append(self) + + Design = property(getDesign, setDesign) + + def getMiscCostItems(self): + + return self._MiscCostItems + + def setMiscCostItems(self, value): + for x in self._MiscCostItems: + x.WorkCostDetail = None + for y in value: + y._WorkCostDetail = self + self._MiscCostItems = value + + MiscCostItems = property(getMiscCostItems, setMiscCostItems) + + def addMiscCostItems(self, *MiscCostItems): + for obj in MiscCostItems: + obj.WorkCostDetail = self + + def removeMiscCostItems(self, *MiscCostItems): + for obj in MiscCostItems: + obj.WorkCostDetail = None + + def getWorkCostSummary(self): + + return self._WorkCostSummary + + def setWorkCostSummary(self, value): + if self._WorkCostSummary is not None: + self._WorkCostSummary._WorkCostDetail = None + + self._WorkCostSummary = value + if self._WorkCostSummary is not None: + self._WorkCostSummary.WorkCostDetail = None + self._WorkCostSummary._WorkCostDetail = self + + WorkCostSummary = property(getWorkCostSummary, setWorkCostSummary) + + def getPropertyUnits(self): + + return self._PropertyUnits + + def setPropertyUnits(self, value): + for p in self._PropertyUnits: + filtered = [q for q in p.WorkCostDetails if q != self] + self._PropertyUnits._WorkCostDetails = filtered + for r in value: + if self not in r._WorkCostDetails: + r._WorkCostDetails.append(self) + self._PropertyUnits = value + + PropertyUnits = property(getPropertyUnits, setPropertyUnits) + + def addPropertyUnits(self, *PropertyUnits): + for obj in PropertyUnits: + if self not in obj._WorkCostDetails: + obj._WorkCostDetails.append(self) + self._PropertyUnits.append(obj) + + def removePropertyUnits(self, *PropertyUnits): + for obj in PropertyUnits: + if self in obj._WorkCostDetails: + obj._WorkCostDetails.remove(self) + self._PropertyUnits.remove(obj) + + def getErpProjectAccounting(self): + + return self._ErpProjectAccounting + + def setErpProjectAccounting(self, value): + if self._ErpProjectAccounting is not None: + filtered = [x for x in self.ErpProjectAccounting.WorkCostDetails if x != self] + self._ErpProjectAccounting._WorkCostDetails = filtered + + self._ErpProjectAccounting = value + if self._ErpProjectAccounting is not None: + if self not in self._ErpProjectAccounting._WorkCostDetails: + self._ErpProjectAccounting._WorkCostDetails.append(self) + + ErpProjectAccounting = property(getErpProjectAccounting, setErpProjectAccounting) + + def getLaborItems(self): + + return self._LaborItems + + def setLaborItems(self, value): + for x in self._LaborItems: + x.WorkCostDetail = None + for y in value: + y._WorkCostDetail = self + self._LaborItems = value + + LaborItems = property(getLaborItems, setLaborItems) + + def addLaborItems(self, *LaborItems): + for obj in LaborItems: + obj.WorkCostDetail = self + + def removeLaborItems(self, *LaborItems): + for obj in LaborItems: + obj.WorkCostDetail = None + + def getMaterialItems(self): + + return self._MaterialItems + + def setMaterialItems(self, value): + for x in self._MaterialItems: + x.WorkCostDetail = None + for y in value: + y._WorkCostDetail = self + self._MaterialItems = value + + MaterialItems = property(getMaterialItems, setMaterialItems) + + def addMaterialItems(self, *MaterialItems): + for obj in MaterialItems: + obj.WorkCostDetail = self + + def removeMaterialItems(self, *MaterialItems): + for obj in MaterialItems: + obj.WorkCostDetail = None + + def getEquipmentItems(self): + + return self._EquipmentItems + + def setEquipmentItems(self, value): + for x in self._EquipmentItems: + x.WorkCostDetail = None + for y in value: + y._WorkCostDetail = self + self._EquipmentItems = value + + EquipmentItems = property(getEquipmentItems, setEquipmentItems) + + def addEquipmentItems(self, *EquipmentItems): + for obj in EquipmentItems: + obj.WorkCostDetail = self + + def removeEquipmentItems(self, *EquipmentItems): + for obj in EquipmentItems: + obj.WorkCostDetail = None + + def getContractorItems(self): + + return self._ContractorItems + + def setContractorItems(self, value): + for x in self._ContractorItems: + x.WorkCostDetail = None + for y in value: + y._WorkCostDetail = self + self._ContractorItems = value + + ContractorItems = property(getContractorItems, setContractorItems) + + def addContractorItems(self, *ContractorItems): + for obj in ContractorItems: + obj.WorkCostDetail = self + + def removeContractorItems(self, *ContractorItems): + for obj in ContractorItems: + obj.WorkCostDetail = None + + def getOverheadCost(self): + + return self._OverheadCost + + def setOverheadCost(self, value): + if self._OverheadCost is not None: + filtered = [x for x in self.OverheadCost.WorkCostDetails if x != self] + self._OverheadCost._WorkCostDetails = filtered + + self._OverheadCost = value + if self._OverheadCost is not None: + if self not in self._OverheadCost._WorkCostDetails: + self._OverheadCost._WorkCostDetails.append(self) + + OverheadCost = property(getOverheadCost, setOverheadCost) + + def getCostType(self): + + return self._CostType + + def setCostType(self, value): + if self._CostType is not None: + filtered = [x for x in self.CostType.WorkCostDetails if x != self] + self._CostType._WorkCostDetails = filtered + + self._CostType = value + if self._CostType is not None: + if self not in self._CostType._WorkCostDetails: + self._CostType._WorkCostDetails.append(self) + + CostType = property(getCostType, setCostType) + diff --git a/CIM16/IEC61970/Informative/InfWork/WorkCostSummary.py b/CIM16/IEC61970/Informative/InfWork/WorkCostSummary.py new file mode 100755 index 00000000..509228c5 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/WorkCostSummary.py @@ -0,0 +1,58 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class WorkCostSummary(Document): + """A roll up by cost category for the entire cost of a work order. For example, total labor.A roll up by cost category for the entire cost of a work order. For example, total labor. + """ + + def __init__(self, WorkCostDetail=None, *args, **kw_args): + """Initialises a new 'WorkCostSummary' instance. + + @param WorkCostDetail: + """ + self._WorkCostDetail = None + self.WorkCostDetail = WorkCostDetail + + super(WorkCostSummary, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["WorkCostDetail"] + _many_refs = [] + + def getWorkCostDetail(self): + + return self._WorkCostDetail + + def setWorkCostDetail(self, value): + if self._WorkCostDetail is not None: + self._WorkCostDetail._WorkCostSummary = None + + self._WorkCostDetail = value + if self._WorkCostDetail is not None: + self._WorkCostDetail.WorkCostSummary = None + self._WorkCostDetail._WorkCostSummary = self + + WorkCostDetail = property(getWorkCostDetail, setWorkCostDetail) + diff --git a/CIM16/IEC61970/Informative/InfWork/WorkFlowStep.py b/CIM16/IEC61970/Informative/InfWork/WorkFlowStep.py new file mode 100755 index 00000000..84dc9e12 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/WorkFlowStep.py @@ -0,0 +1,93 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class WorkFlowStep(IdentifiedObject): + """A pre-defined set of work steps for a given type of work.A pre-defined set of work steps for a given type of work. + """ + + def __init__(self, sequenceNumber=0, WorkTasks=None, status=None, Work=None, *args, **kw_args): + """Initialises a new 'WorkFlowStep' instance. + + @param sequenceNumber: Used to define dependencies of each work flow step, which is for the instance of WorkTask associated with a given instance of WorkFlow. + @param WorkTasks: + @param status: + @param Work: + """ + #: Used to define dependencies of each work flow step, which is for the instance of WorkTask associated with a given instance of WorkFlow. + self.sequenceNumber = sequenceNumber + + self._WorkTasks = [] + self.WorkTasks = [] if WorkTasks is None else WorkTasks + + self.status = status + + self._Work = None + self.Work = Work + + super(WorkFlowStep, self).__init__(*args, **kw_args) + + _attrs = ["sequenceNumber"] + _attr_types = {"sequenceNumber": int} + _defaults = {"sequenceNumber": 0} + _enums = {} + _refs = ["WorkTasks", "status", "Work"] + _many_refs = ["WorkTasks"] + + def getWorkTasks(self): + + return self._WorkTasks + + def setWorkTasks(self, value): + for x in self._WorkTasks: + x.WorkFlowStep = None + for y in value: + y._WorkFlowStep = self + self._WorkTasks = value + + WorkTasks = property(getWorkTasks, setWorkTasks) + + def addWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + obj.WorkFlowStep = self + + def removeWorkTasks(self, *WorkTasks): + for obj in WorkTasks: + obj.WorkFlowStep = None + + status = None + + def getWork(self): + + return self._Work + + def setWork(self, value): + if self._Work is not None: + filtered = [x for x in self.Work.WorkFlowSteps if x != self] + self._Work._WorkFlowSteps = filtered + + self._Work = value + if self._Work is not None: + if self not in self._Work._WorkFlowSteps: + self._Work._WorkFlowSteps.append(self) + + Work = property(getWork, setWork) + diff --git a/CIM16/IEC61970/Informative/InfWork/WorkLocation.py b/CIM16/IEC61970/Informative/InfWork/WorkLocation.py new file mode 100755 index 00000000..260abd38 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/WorkLocation.py @@ -0,0 +1,106 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Location import Location + +class WorkLocation(Location): + """Information about a particular location for various forms of work such as a one call request.Information about a particular location for various forms of work such as a one call request. + """ + + def __init__(self, subdivision='', nearestIntersection='', block='', lot='', OneCallRequest=None, DesignLocations=None, *args, **kw_args): + """Initialises a new 'WorkLocation' instance. + + @param subdivision: Name, identifier, or description of the subdivision, if applicable, in which work is to occur. + @param nearestIntersection: The names of streets at the nearest intersection to work area. + @param block: Name, identifier, or description of the block, if applicable, in which work is to occur. + @param lot: Name, identifier, or description of the lot, if applicable, in which work is to occur. + @param OneCallRequest: + @param DesignLocations: + """ + #: Name, identifier, or description of the subdivision, if applicable, in which work is to occur. + self.subdivision = subdivision + + #: The names of streets at the nearest intersection to work area. + self.nearestIntersection = nearestIntersection + + #: Name, identifier, or description of the block, if applicable, in which work is to occur. + self.block = block + + #: Name, identifier, or description of the lot, if applicable, in which work is to occur. + self.lot = lot + + self._OneCallRequest = None + self.OneCallRequest = OneCallRequest + + self._DesignLocations = [] + self.DesignLocations = [] if DesignLocations is None else DesignLocations + + super(WorkLocation, self).__init__(*args, **kw_args) + + _attrs = ["subdivision", "nearestIntersection", "block", "lot"] + _attr_types = {"subdivision": str, "nearestIntersection": str, "block": str, "lot": str} + _defaults = {"subdivision": '', "nearestIntersection": '', "block": '', "lot": ''} + _enums = {} + _refs = ["OneCallRequest", "DesignLocations"] + _many_refs = ["DesignLocations"] + + def getOneCallRequest(self): + + return self._OneCallRequest + + def setOneCallRequest(self, value): + if self._OneCallRequest is not None: + filtered = [x for x in self.OneCallRequest.WorkLocations if x != self] + self._OneCallRequest._WorkLocations = filtered + + self._OneCallRequest = value + if self._OneCallRequest is not None: + if self not in self._OneCallRequest._WorkLocations: + self._OneCallRequest._WorkLocations.append(self) + + OneCallRequest = property(getOneCallRequest, setOneCallRequest) + + def getDesignLocations(self): + + return self._DesignLocations + + def setDesignLocations(self, value): + for p in self._DesignLocations: + filtered = [q for q in p.WorkLocations if q != self] + self._DesignLocations._WorkLocations = filtered + for r in value: + if self not in r._WorkLocations: + r._WorkLocations.append(self) + self._DesignLocations = value + + DesignLocations = property(getDesignLocations, setDesignLocations) + + def addDesignLocations(self, *DesignLocations): + for obj in DesignLocations: + if self not in obj._WorkLocations: + obj._WorkLocations.append(self) + self._DesignLocations.append(obj) + + def removeDesignLocations(self, *DesignLocations): + for obj in DesignLocations: + if self in obj._WorkLocations: + obj._WorkLocations.remove(self) + self._DesignLocations.remove(obj) + diff --git a/CIM16/IEC61970/Informative/InfWork/WorkStatusEntry.py b/CIM16/IEC61970/Informative/InfWork/WorkStatusEntry.py new file mode 100755 index 00000000..8ca002c1 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/WorkStatusEntry.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.ActivityRecord import ActivityRecord + +class WorkStatusEntry(ActivityRecord): + """A type of ActivityRecord that records information about the status of an item, such as a Work or WorkTask, at a point in time.A type of ActivityRecord that records information about the status of an item, such as a Work or WorkTask, at a point in time. + """ + + def __init__(self, percentComplete=0.0, *args, **kw_args): + """Initialises a new 'WorkStatusEntry' instance. + + @param percentComplete: Estimated percentage of completion of this individual work task or overall work order. + """ + #: Estimated percentage of completion of this individual work task or overall work order. + self.percentComplete = percentComplete + + super(WorkStatusEntry, self).__init__(*args, **kw_args) + + _attrs = ["percentComplete"] + _attr_types = {"percentComplete": float} + _defaults = {"percentComplete": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Informative/InfWork/WorkTask.py b/CIM16/IEC61970/Informative/InfWork/WorkTask.py new file mode 100755 index 00000000..c09ad224 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/WorkTask.py @@ -0,0 +1,477 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Document import Document + +class WorkTask(Document): + """A set of tasks is required to implement a design.A set of tasks is required to implement a design. + """ + + def __init__(self, priority='', schedOverride='', EquipmentItems=None, Usages=None, MiscCostItems=None, Crews=None, Work=None, OverheadCost=None, DesignLocationCUs=None, ContractorItems=None, SwitchingSchedules=None, WorkFlowStep=None, Design=None, QualificationRequirements=None, Capabilities=None, WorkCostDetails=None, Assets=None, LaborItems=None, MaterialItems=None, *args, **kw_args): + """Initialises a new 'WorkTask' instance. + + @param priority: The priority of this work task. + @param schedOverride: If specified, override schedule and perform this task in accordance with instructions specified here. + @param EquipmentItems: + @param Usages: + @param MiscCostItems: + @param Crews: All Crews participating in this WorkTask. + @param Work: + @param OverheadCost: + @param DesignLocationCUs: + @param ContractorItems: + @param SwitchingSchedules: + @param WorkFlowStep: + @param Design: + @param QualificationRequirements: + @param Capabilities: + @param WorkCostDetails: + @param Assets: + @param LaborItems: + @param MaterialItems: + """ + #: The priority of this work task. + self.priority = priority + + #: If specified, override schedule and perform this task in accordance with instructions specified here. + self.schedOverride = schedOverride + + self._EquipmentItems = [] + self.EquipmentItems = [] if EquipmentItems is None else EquipmentItems + + self._Usages = [] + self.Usages = [] if Usages is None else Usages + + self._MiscCostItems = [] + self.MiscCostItems = [] if MiscCostItems is None else MiscCostItems + + self._Crews = [] + self.Crews = [] if Crews is None else Crews + + self._Work = None + self.Work = Work + + self._OverheadCost = None + self.OverheadCost = OverheadCost + + self._DesignLocationCUs = [] + self.DesignLocationCUs = [] if DesignLocationCUs is None else DesignLocationCUs + + self._ContractorItems = [] + self.ContractorItems = [] if ContractorItems is None else ContractorItems + + self._SwitchingSchedules = [] + self.SwitchingSchedules = [] if SwitchingSchedules is None else SwitchingSchedules + + self._WorkFlowStep = None + self.WorkFlowStep = WorkFlowStep + + self._Design = None + self.Design = Design + + self._QualificationRequirements = [] + self.QualificationRequirements = [] if QualificationRequirements is None else QualificationRequirements + + self._Capabilities = [] + self.Capabilities = [] if Capabilities is None else Capabilities + + self._WorkCostDetails = [] + self.WorkCostDetails = [] if WorkCostDetails is None else WorkCostDetails + + self._Assets = [] + self.Assets = [] if Assets is None else Assets + + self._LaborItems = [] + self.LaborItems = [] if LaborItems is None else LaborItems + + self._MaterialItems = [] + self.MaterialItems = [] if MaterialItems is None else MaterialItems + + super(WorkTask, self).__init__(*args, **kw_args) + + _attrs = ["priority", "schedOverride"] + _attr_types = {"priority": str, "schedOverride": str} + _defaults = {"priority": '', "schedOverride": ''} + _enums = {} + _refs = ["EquipmentItems", "Usages", "MiscCostItems", "Crews", "Work", "OverheadCost", "DesignLocationCUs", "ContractorItems", "SwitchingSchedules", "WorkFlowStep", "Design", "QualificationRequirements", "Capabilities", "WorkCostDetails", "Assets", "LaborItems", "MaterialItems"] + _many_refs = ["EquipmentItems", "Usages", "MiscCostItems", "Crews", "DesignLocationCUs", "ContractorItems", "SwitchingSchedules", "QualificationRequirements", "Capabilities", "WorkCostDetails", "Assets", "LaborItems", "MaterialItems"] + + def getEquipmentItems(self): + + return self._EquipmentItems + + def setEquipmentItems(self, value): + for x in self._EquipmentItems: + x.WorkTask = None + for y in value: + y._WorkTask = self + self._EquipmentItems = value + + EquipmentItems = property(getEquipmentItems, setEquipmentItems) + + def addEquipmentItems(self, *EquipmentItems): + for obj in EquipmentItems: + obj.WorkTask = self + + def removeEquipmentItems(self, *EquipmentItems): + for obj in EquipmentItems: + obj.WorkTask = None + + def getUsages(self): + + return self._Usages + + def setUsages(self, value): + for x in self._Usages: + x.WorkTask = None + for y in value: + y._WorkTask = self + self._Usages = value + + Usages = property(getUsages, setUsages) + + def addUsages(self, *Usages): + for obj in Usages: + obj.WorkTask = self + + def removeUsages(self, *Usages): + for obj in Usages: + obj.WorkTask = None + + def getMiscCostItems(self): + + return self._MiscCostItems + + def setMiscCostItems(self, value): + for x in self._MiscCostItems: + x.WorkTask = None + for y in value: + y._WorkTask = self + self._MiscCostItems = value + + MiscCostItems = property(getMiscCostItems, setMiscCostItems) + + def addMiscCostItems(self, *MiscCostItems): + for obj in MiscCostItems: + obj.WorkTask = self + + def removeMiscCostItems(self, *MiscCostItems): + for obj in MiscCostItems: + obj.WorkTask = None + + def getCrews(self): + """All Crews participating in this WorkTask. + """ + return self._Crews + + def setCrews(self, value): + for p in self._Crews: + filtered = [q for q in p.WorkTasks if q != self] + self._Crews._WorkTasks = filtered + for r in value: + if self not in r._WorkTasks: + r._WorkTasks.append(self) + self._Crews = value + + Crews = property(getCrews, setCrews) + + def addCrews(self, *Crews): + for obj in Crews: + if self not in obj._WorkTasks: + obj._WorkTasks.append(self) + self._Crews.append(obj) + + def removeCrews(self, *Crews): + for obj in Crews: + if self in obj._WorkTasks: + obj._WorkTasks.remove(self) + self._Crews.remove(obj) + + def getWork(self): + + return self._Work + + def setWork(self, value): + if self._Work is not None: + filtered = [x for x in self.Work.WorkTasks if x != self] + self._Work._WorkTasks = filtered + + self._Work = value + if self._Work is not None: + if self not in self._Work._WorkTasks: + self._Work._WorkTasks.append(self) + + Work = property(getWork, setWork) + + def getOverheadCost(self): + + return self._OverheadCost + + def setOverheadCost(self, value): + if self._OverheadCost is not None: + filtered = [x for x in self.OverheadCost.WorkTasks if x != self] + self._OverheadCost._WorkTasks = filtered + + self._OverheadCost = value + if self._OverheadCost is not None: + if self not in self._OverheadCost._WorkTasks: + self._OverheadCost._WorkTasks.append(self) + + OverheadCost = property(getOverheadCost, setOverheadCost) + + def getDesignLocationCUs(self): + + return self._DesignLocationCUs + + def setDesignLocationCUs(self, value): + for p in self._DesignLocationCUs: + filtered = [q for q in p.WorkTasks if q != self] + self._DesignLocationCUs._WorkTasks = filtered + for r in value: + if self not in r._WorkTasks: + r._WorkTasks.append(self) + self._DesignLocationCUs = value + + DesignLocationCUs = property(getDesignLocationCUs, setDesignLocationCUs) + + def addDesignLocationCUs(self, *DesignLocationCUs): + for obj in DesignLocationCUs: + if self not in obj._WorkTasks: + obj._WorkTasks.append(self) + self._DesignLocationCUs.append(obj) + + def removeDesignLocationCUs(self, *DesignLocationCUs): + for obj in DesignLocationCUs: + if self in obj._WorkTasks: + obj._WorkTasks.remove(self) + self._DesignLocationCUs.remove(obj) + + def getContractorItems(self): + + return self._ContractorItems + + def setContractorItems(self, value): + for x in self._ContractorItems: + x.WorkTask = None + for y in value: + y._WorkTask = self + self._ContractorItems = value + + ContractorItems = property(getContractorItems, setContractorItems) + + def addContractorItems(self, *ContractorItems): + for obj in ContractorItems: + obj.WorkTask = self + + def removeContractorItems(self, *ContractorItems): + for obj in ContractorItems: + obj.WorkTask = None + + def getSwitchingSchedules(self): + + return self._SwitchingSchedules + + def setSwitchingSchedules(self, value): + for x in self._SwitchingSchedules: + x.WorkTask = None + for y in value: + y._WorkTask = self + self._SwitchingSchedules = value + + SwitchingSchedules = property(getSwitchingSchedules, setSwitchingSchedules) + + def addSwitchingSchedules(self, *SwitchingSchedules): + for obj in SwitchingSchedules: + obj.WorkTask = self + + def removeSwitchingSchedules(self, *SwitchingSchedules): + for obj in SwitchingSchedules: + obj.WorkTask = None + + def getWorkFlowStep(self): + + return self._WorkFlowStep + + def setWorkFlowStep(self, value): + if self._WorkFlowStep is not None: + filtered = [x for x in self.WorkFlowStep.WorkTasks if x != self] + self._WorkFlowStep._WorkTasks = filtered + + self._WorkFlowStep = value + if self._WorkFlowStep is not None: + if self not in self._WorkFlowStep._WorkTasks: + self._WorkFlowStep._WorkTasks.append(self) + + WorkFlowStep = property(getWorkFlowStep, setWorkFlowStep) + + def getDesign(self): + + return self._Design + + def setDesign(self, value): + if self._Design is not None: + filtered = [x for x in self.Design.WorkTasks if x != self] + self._Design._WorkTasks = filtered + + self._Design = value + if self._Design is not None: + if self not in self._Design._WorkTasks: + self._Design._WorkTasks.append(self) + + Design = property(getDesign, setDesign) + + def getQualificationRequirements(self): + + return self._QualificationRequirements + + def setQualificationRequirements(self, value): + for p in self._QualificationRequirements: + filtered = [q for q in p.WorkTasks if q != self] + self._QualificationRequirements._WorkTasks = filtered + for r in value: + if self not in r._WorkTasks: + r._WorkTasks.append(self) + self._QualificationRequirements = value + + QualificationRequirements = property(getQualificationRequirements, setQualificationRequirements) + + def addQualificationRequirements(self, *QualificationRequirements): + for obj in QualificationRequirements: + if self not in obj._WorkTasks: + obj._WorkTasks.append(self) + self._QualificationRequirements.append(obj) + + def removeQualificationRequirements(self, *QualificationRequirements): + for obj in QualificationRequirements: + if self in obj._WorkTasks: + obj._WorkTasks.remove(self) + self._QualificationRequirements.remove(obj) + + def getCapabilities(self): + + return self._Capabilities + + def setCapabilities(self, value): + for p in self._Capabilities: + filtered = [q for q in p.WorkTasks if q != self] + self._Capabilities._WorkTasks = filtered + for r in value: + if self not in r._WorkTasks: + r._WorkTasks.append(self) + self._Capabilities = value + + Capabilities = property(getCapabilities, setCapabilities) + + def addCapabilities(self, *Capabilities): + for obj in Capabilities: + if self not in obj._WorkTasks: + obj._WorkTasks.append(self) + self._Capabilities.append(obj) + + def removeCapabilities(self, *Capabilities): + for obj in Capabilities: + if self in obj._WorkTasks: + obj._WorkTasks.remove(self) + self._Capabilities.remove(obj) + + def getWorkCostDetails(self): + + return self._WorkCostDetails + + def setWorkCostDetails(self, value): + for x in self._WorkCostDetails: + x.WorkTask = None + for y in value: + y._WorkTask = self + self._WorkCostDetails = value + + WorkCostDetails = property(getWorkCostDetails, setWorkCostDetails) + + def addWorkCostDetails(self, *WorkCostDetails): + for obj in WorkCostDetails: + obj.WorkTask = self + + def removeWorkCostDetails(self, *WorkCostDetails): + for obj in WorkCostDetails: + obj.WorkTask = None + + def getAssets(self): + + return self._Assets + + def setAssets(self, value): + for x in self._Assets: + x.WorkTask = None + for y in value: + y._WorkTask = self + self._Assets = value + + Assets = property(getAssets, setAssets) + + def addAssets(self, *Assets): + for obj in Assets: + obj.WorkTask = self + + def removeAssets(self, *Assets): + for obj in Assets: + obj.WorkTask = None + + def getLaborItems(self): + + return self._LaborItems + + def setLaborItems(self, value): + for x in self._LaborItems: + x.WorkTask = None + for y in value: + y._WorkTask = self + self._LaborItems = value + + LaborItems = property(getLaborItems, setLaborItems) + + def addLaborItems(self, *LaborItems): + for obj in LaborItems: + obj.WorkTask = self + + def removeLaborItems(self, *LaborItems): + for obj in LaborItems: + obj.WorkTask = None + + def getMaterialItems(self): + + return self._MaterialItems + + def setMaterialItems(self, value): + for x in self._MaterialItems: + x.WorkTask = None + for y in value: + y._WorkTask = self + self._MaterialItems = value + + MaterialItems = property(getMaterialItems, setMaterialItems) + + def addMaterialItems(self, *MaterialItems): + for obj in MaterialItems: + obj.WorkTask = self + + def removeMaterialItems(self, *MaterialItems): + for obj in MaterialItems: + obj.WorkTask = None + diff --git a/CIM16/IEC61970/Informative/InfWork/__init__.py b/CIM16/IEC61970/Informative/InfWork/__init__.py new file mode 100755 index 00000000..879b9552 --- /dev/null +++ b/CIM16/IEC61970/Informative/InfWork/__init__.py @@ -0,0 +1,88 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The package covers all types of work, including inspection, maintenance, repair, restoration, and construction. It covers the full life cycle including request, initiate, track and record work. Standardized designs (compatible units) are used where possible. TODO: The following has been copied from a very old version of draft Part 11, so the references are wrong, but we store the knowledge here to reuse later: 'The Work package is used to define classes related to work. There are several different aspects of work. The Work Initiation (Work, Project, Request). The Work Design package is used for managing designs (CompatibleUnit, Design, DesignLocation, WorkTask). The Work Schedule package is used for the scheduling and coordination of work (AccessPermit, MaterialItem, OneCallRequest, Regulation). The Work Closing package is used for tracking costs of work (CostType, LaborItem, WorkCostDetail, VehicleItem). The Work Standards package is used for the definition of compatible units (CULaborItem, CUVehicleItem, CUGroup). This package is used for inspection and maintenance (InspectionDataSet, Procedure). The WorkService package defines Appointment class.' +""" + +from CIM16.IEC61970.Informative.InfWork.EquipmentItem import EquipmentItem +from CIM16.IEC61970.Informative.InfWork.Appointment import Appointment +from CIM16.IEC61970.Informative.InfWork.WorkStatusEntry import WorkStatusEntry +from CIM16.IEC61970.Informative.InfWork.BusinessCase import BusinessCase +from CIM16.IEC61970.Informative.InfWork.TypeMaterial import TypeMaterial +from CIM16.IEC61970.Informative.InfWork.DesignLocation import DesignLocation +from CIM16.IEC61970.Informative.InfWork.OverheadCost import OverheadCost +from CIM16.IEC61970.Informative.InfWork.Crew import Crew +from CIM16.IEC61970.Informative.InfWork.DiagnosisDataSet import DiagnosisDataSet +from CIM16.IEC61970.Informative.InfWork.CUAsset import CUAsset +from CIM16.IEC61970.Informative.InfWork.Request import Request +from CIM16.IEC61970.Informative.InfWork.Design import Design +from CIM16.IEC61970.Informative.InfWork.WorkTask import WorkTask +from CIM16.IEC61970.Informative.InfWork.ConditionFactor import ConditionFactor +from CIM16.IEC61970.Informative.InfWork.QualificationRequirement import QualificationRequirement +from CIM16.IEC61970.Informative.InfWork.WorkLocation import WorkLocation +from CIM16.IEC61970.Informative.InfWork.CostType import CostType +from CIM16.IEC61970.Informative.InfWork.CUMaterialItem import CUMaterialItem +from CIM16.IEC61970.Informative.InfWork.PropertyUnit import PropertyUnit +from CIM16.IEC61970.Informative.InfWork.Project import Project +from CIM16.IEC61970.Informative.InfWork.CULaborItem import CULaborItem +from CIM16.IEC61970.Informative.InfWork.LaborItem import LaborItem +from CIM16.IEC61970.Informative.InfWork.WorkFlowStep import WorkFlowStep +from CIM16.IEC61970.Informative.InfWork.InspectionDataSet import InspectionDataSet +from CIM16.IEC61970.Informative.InfWork.WorkCostDetail import WorkCostDetail +from CIM16.IEC61970.Informative.InfWork.CompatibleUnit import CompatibleUnit +from CIM16.IEC61970.Informative.InfWork.WorkCostSummary import WorkCostSummary +from CIM16.IEC61970.Informative.InfWork.NonStandardItem import NonStandardItem +from CIM16.IEC61970.Informative.InfWork.InfoQuestion import InfoQuestion +from CIM16.IEC61970.Informative.InfWork.Regulation import Regulation +from CIM16.IEC61970.Informative.InfWork.ContractorItem import ContractorItem +from CIM16.IEC61970.Informative.InfWork.CUAllowableAction import CUAllowableAction +from CIM16.IEC61970.Informative.InfWork.CULaborCode import CULaborCode +from CIM16.IEC61970.Informative.InfWork.AccessPermit import AccessPermit +from CIM16.IEC61970.Informative.InfWork.CUWorkEquipmentItem import CUWorkEquipmentItem +from CIM16.IEC61970.Informative.InfWork.DesignLocationCU import DesignLocationCU +from CIM16.IEC61970.Informative.InfWork.MaintenanceDataSet import MaintenanceDataSet +from CIM16.IEC61970.Informative.InfWork.MiscCostItem import MiscCostItem +from CIM16.IEC61970.Informative.InfWork.MaterialItem import MaterialItem +from CIM16.IEC61970.Informative.InfWork.ShiftPattern import ShiftPattern +from CIM16.IEC61970.Informative.InfWork.Capability import Capability +from CIM16.IEC61970.Informative.InfWork.Usage import Usage +from CIM16.IEC61970.Informative.InfWork.OneCallRequest import OneCallRequest +from CIM16.IEC61970.Informative.InfWork.Assignment import Assignment +from CIM16.IEC61970.Informative.InfWork.CUContractorItem import CUContractorItem +from CIM16.IEC61970.Informative.InfWork.CUGroup import CUGroup + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#InfWork" +nsPrefix = "cimInfWork" + + +class ConditionFactorKind(str): + """Values are: material, travel, accountAllocation, labor, other + """ + pass + +class WorkActionKind(str): + """Values are: install, remove, transfer, abandon + """ + pass + +class DesignKind(str): + """Values are: asBuilt, other, estimated + """ + pass diff --git a/CIM16/IEC61970/Informative/__init__.py b/CIM16/IEC61970/Informative/__init__.py new file mode 100755 index 00000000..b4630b03 --- /dev/null +++ b/CIM16/IEC61970/Informative/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package contains functions common for distribution management. TODO: The following has been copied from a very old version of draft Part 11, so the references are wrong, but we store the knowledge here to reuse later: 'Locations are logical entities which are related to a geographical position. Locations can be defined as points, lines or polygons. Location serves as a parent class for e.g. Zone, WorkLocation or ServiceLocation. Both Assets and PowerSystemResources are typically associated to a location. Aside from coordinates, useful properties of Locations can include Directions (i.e. driving instructions) and relationships to Organizations. ActivityRecord is a generalized class used to track the history of an object (e.g. Asset, PowerSystemResource, Customer, Location, Organisation or ErpContact). An ActivityRecord is a type of Document. Key properties of an ActivityRecord include statusDate, status, statusReason and remarks. TODO: Update attribute names. The graphical and geographical aspects of Assets, Locations and PowerSystemResources are managed using Graphical Markup Language (GML), which was defined by the Open GIS Consortium. Using GML, a diagram is a collection of presentation objects. This package defines the classes Diagram and Presentation. TODO: These are now under Common package.' +""" + + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Informative" +nsPrefix = "cimInformative" + diff --git a/CIM16/IEC61970/LoadModel/ConformLoad.py b/CIM16/IEC61970/LoadModel/ConformLoad.py new file mode 100755 index 00000000..5c088375 --- /dev/null +++ b/CIM16/IEC61970/LoadModel/ConformLoad.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.EnergyConsumer import EnergyConsumer + +class ConformLoad(EnergyConsumer): + """ConformLoad represent loads that follow a daily load change pattern where the pattern can be used to scale the load with a system load.ConformLoad represent loads that follow a daily load change pattern where the pattern can be used to scale the load with a system load. + """ + + def __init__(self, LoadGroup=None, *args, **kw_args): + """Initialises a new 'ConformLoad' instance. + + @param LoadGroup: Group of this ConformLoad. + """ + self._LoadGroup = None + self.LoadGroup = LoadGroup + + super(ConformLoad, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["LoadGroup"] + _many_refs = [] + + def getLoadGroup(self): + """Group of this ConformLoad. + """ + return self._LoadGroup + + def setLoadGroup(self, value): + if self._LoadGroup is not None: + filtered = [x for x in self.LoadGroup.EnergyConsumers if x != self] + self._LoadGroup._EnergyConsumers = filtered + + self._LoadGroup = value + if self._LoadGroup is not None: + if self not in self._LoadGroup._EnergyConsumers: + self._LoadGroup._EnergyConsumers.append(self) + + LoadGroup = property(getLoadGroup, setLoadGroup) + diff --git a/CIM16/IEC61970/LoadModel/ConformLoadGroup.py b/CIM16/IEC61970/LoadModel/ConformLoadGroup.py new file mode 100755 index 00000000..d9019213 --- /dev/null +++ b/CIM16/IEC61970/LoadModel/ConformLoadGroup.py @@ -0,0 +1,91 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.LoadModel.LoadGroup import LoadGroup + +class ConformLoadGroup(LoadGroup): + """A group of loads conforming to an allocation pattern.A group of loads conforming to an allocation pattern. + """ + + def __init__(self, ConformLoadSchedules=None, EnergyConsumers=None, *args, **kw_args): + """Initialises a new 'ConformLoadGroup' instance. + + @param ConformLoadSchedules: The ConformLoadSchedules in the ConformLoadGroup. + @param EnergyConsumers: Conform loads assigned to this ConformLoadGroup. + """ + self._ConformLoadSchedules = [] + self.ConformLoadSchedules = [] if ConformLoadSchedules is None else ConformLoadSchedules + + self._EnergyConsumers = [] + self.EnergyConsumers = [] if EnergyConsumers is None else EnergyConsumers + + super(ConformLoadGroup, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ConformLoadSchedules", "EnergyConsumers"] + _many_refs = ["ConformLoadSchedules", "EnergyConsumers"] + + def getConformLoadSchedules(self): + """The ConformLoadSchedules in the ConformLoadGroup. + """ + return self._ConformLoadSchedules + + def setConformLoadSchedules(self, value): + for x in self._ConformLoadSchedules: + x.ConformLoadGroup = None + for y in value: + y._ConformLoadGroup = self + self._ConformLoadSchedules = value + + ConformLoadSchedules = property(getConformLoadSchedules, setConformLoadSchedules) + + def addConformLoadSchedules(self, *ConformLoadSchedules): + for obj in ConformLoadSchedules: + obj.ConformLoadGroup = self + + def removeConformLoadSchedules(self, *ConformLoadSchedules): + for obj in ConformLoadSchedules: + obj.ConformLoadGroup = None + + def getEnergyConsumers(self): + """Conform loads assigned to this ConformLoadGroup. + """ + return self._EnergyConsumers + + def setEnergyConsumers(self, value): + for x in self._EnergyConsumers: + x.LoadGroup = None + for y in value: + y._LoadGroup = self + self._EnergyConsumers = value + + EnergyConsumers = property(getEnergyConsumers, setEnergyConsumers) + + def addEnergyConsumers(self, *EnergyConsumers): + for obj in EnergyConsumers: + obj.LoadGroup = self + + def removeEnergyConsumers(self, *EnergyConsumers): + for obj in EnergyConsumers: + obj.LoadGroup = None + diff --git a/CIM16/IEC61970/LoadModel/ConformLoadSchedule.py b/CIM16/IEC61970/LoadModel/ConformLoadSchedule.py new file mode 100755 index 00000000..5e5b2dfb --- /dev/null +++ b/CIM16/IEC61970/LoadModel/ConformLoadSchedule.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.LoadModel.SeasonDayTypeSchedule import SeasonDayTypeSchedule + +class ConformLoadSchedule(SeasonDayTypeSchedule): + """A curve of load versus time (X-axis) showing the active power values (Y1-axis) and reactive power (Y2-axis) for each unit of the period covered. This curve represents a typical pattern of load over the time period for a given day type and season.A curve of load versus time (X-axis) showing the active power values (Y1-axis) and reactive power (Y2-axis) for each unit of the period covered. This curve represents a typical pattern of load over the time period for a given day type and season. + """ + + def __init__(self, ConformLoadGroup=None, *args, **kw_args): + """Initialises a new 'ConformLoadSchedule' instance. + + @param ConformLoadGroup: The ConformLoadGroup where the ConformLoadSchedule belongs. + """ + self._ConformLoadGroup = None + self.ConformLoadGroup = ConformLoadGroup + + super(ConformLoadSchedule, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ConformLoadGroup"] + _many_refs = [] + + def getConformLoadGroup(self): + """The ConformLoadGroup where the ConformLoadSchedule belongs. + """ + return self._ConformLoadGroup + + def setConformLoadGroup(self, value): + if self._ConformLoadGroup is not None: + filtered = [x for x in self.ConformLoadGroup.ConformLoadSchedules if x != self] + self._ConformLoadGroup._ConformLoadSchedules = filtered + + self._ConformLoadGroup = value + if self._ConformLoadGroup is not None: + if self not in self._ConformLoadGroup._ConformLoadSchedules: + self._ConformLoadGroup._ConformLoadSchedules.append(self) + + ConformLoadGroup = property(getConformLoadGroup, setConformLoadGroup) + diff --git a/CIM16/IEC61970/LoadModel/DayType.py b/CIM16/IEC61970/LoadModel/DayType.py new file mode 100755 index 00000000..c768b243 --- /dev/null +++ b/CIM16/IEC61970/LoadModel/DayType.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class DayType(IdentifiedObject): + """Group of similar days, e.g., Mon/Tue/Wed, Thu/Fri, Sat/Sun, Holiday1, Holiday2Group of similar days, e.g., Mon/Tue/Wed, Thu/Fri, Sat/Sun, Holiday1, Holiday2 + """ + + def __init__(self, SeasonDayTypeSchedules=None, *args, **kw_args): + """Initialises a new 'DayType' instance. + + @param SeasonDayTypeSchedules: Schedules that use this DayType. + """ + self._SeasonDayTypeSchedules = [] + self.SeasonDayTypeSchedules = [] if SeasonDayTypeSchedules is None else SeasonDayTypeSchedules + + super(DayType, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["SeasonDayTypeSchedules"] + _many_refs = ["SeasonDayTypeSchedules"] + + def getSeasonDayTypeSchedules(self): + """Schedules that use this DayType. + """ + return self._SeasonDayTypeSchedules + + def setSeasonDayTypeSchedules(self, value): + for x in self._SeasonDayTypeSchedules: + x.DayType = None + for y in value: + y._DayType = self + self._SeasonDayTypeSchedules = value + + SeasonDayTypeSchedules = property(getSeasonDayTypeSchedules, setSeasonDayTypeSchedules) + + def addSeasonDayTypeSchedules(self, *SeasonDayTypeSchedules): + for obj in SeasonDayTypeSchedules: + obj.DayType = self + + def removeSeasonDayTypeSchedules(self, *SeasonDayTypeSchedules): + for obj in SeasonDayTypeSchedules: + obj.DayType = None + diff --git a/CIM16/IEC61970/LoadModel/EnergyArea.py b/CIM16/IEC61970/LoadModel/EnergyArea.py new file mode 100755 index 00000000..b5b0f5fd --- /dev/null +++ b/CIM16/IEC61970/LoadModel/EnergyArea.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class EnergyArea(IdentifiedObject): + """The class describes an area having energy production or consumption. The class is the basis for further specialization.The class describes an area having energy production or consumption. The class is the basis for further specialization. + """ + + def __init__(self, ControlArea=None, *args, **kw_args): + """Initialises a new 'EnergyArea' instance. + + @param ControlArea: The control area specification that is used for the load forecast. + """ + self._ControlArea = None + self.ControlArea = ControlArea + + super(EnergyArea, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ControlArea"] + _many_refs = [] + + def getControlArea(self): + """The control area specification that is used for the load forecast. + """ + return self._ControlArea + + def setControlArea(self, value): + if self._ControlArea is not None: + self._ControlArea._EnergyArea = None + + self._ControlArea = value + if self._ControlArea is not None: + self._ControlArea.EnergyArea = None + self._ControlArea._EnergyArea = self + + ControlArea = property(getControlArea, setControlArea) + diff --git a/CIM16/IEC61970/LoadModel/LoadArea.py b/CIM16/IEC61970/LoadModel/LoadArea.py new file mode 100755 index 00000000..a5f81a11 --- /dev/null +++ b/CIM16/IEC61970/LoadModel/LoadArea.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.LoadModel.EnergyArea import EnergyArea + +class LoadArea(EnergyArea): + """The class is the root or first level in a hierarchical structure for grouping of loads for the purpose of load flow load scaling.The class is the root or first level in a hierarchical structure for grouping of loads for the purpose of load flow load scaling. + """ + + def __init__(self, SubLoadAreas=None, *args, **kw_args): + """Initialises a new 'LoadArea' instance. + + @param SubLoadAreas: The SubLoadAreas in the LoadArea. + """ + self._SubLoadAreas = [] + self.SubLoadAreas = [] if SubLoadAreas is None else SubLoadAreas + + super(LoadArea, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["SubLoadAreas"] + _many_refs = ["SubLoadAreas"] + + def getSubLoadAreas(self): + """The SubLoadAreas in the LoadArea. + """ + return self._SubLoadAreas + + def setSubLoadAreas(self, value): + for x in self._SubLoadAreas: + x.LoadArea = None + for y in value: + y._LoadArea = self + self._SubLoadAreas = value + + SubLoadAreas = property(getSubLoadAreas, setSubLoadAreas) + + def addSubLoadAreas(self, *SubLoadAreas): + for obj in SubLoadAreas: + obj.LoadArea = self + + def removeSubLoadAreas(self, *SubLoadAreas): + for obj in SubLoadAreas: + obj.LoadArea = None + diff --git a/CIM16/IEC61970/LoadModel/LoadGroup.py b/CIM16/IEC61970/LoadModel/LoadGroup.py new file mode 100755 index 00000000..14ddfaa8 --- /dev/null +++ b/CIM16/IEC61970/LoadModel/LoadGroup.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class LoadGroup(IdentifiedObject): + """The class is the third level in a hierarchical structure for grouping of loads for the purpose of load flow load scaling.The class is the third level in a hierarchical structure for grouping of loads for the purpose of load flow load scaling. + """ + + def __init__(self, SubLoadArea=None, *args, **kw_args): + """Initialises a new 'LoadGroup' instance. + + @param SubLoadArea: The SubLoadArea where the Loadgroup belongs. + """ + self._SubLoadArea = None + self.SubLoadArea = SubLoadArea + + super(LoadGroup, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["SubLoadArea"] + _many_refs = [] + + def getSubLoadArea(self): + """The SubLoadArea where the Loadgroup belongs. + """ + return self._SubLoadArea + + def setSubLoadArea(self, value): + if self._SubLoadArea is not None: + filtered = [x for x in self.SubLoadArea.LoadGroups if x != self] + self._SubLoadArea._LoadGroups = filtered + + self._SubLoadArea = value + if self._SubLoadArea is not None: + if self not in self._SubLoadArea._LoadGroups: + self._SubLoadArea._LoadGroups.append(self) + + SubLoadArea = property(getSubLoadArea, setSubLoadArea) + diff --git a/CIM16/IEC61970/LoadModel/LoadResponseCharacteristic.py b/CIM16/IEC61970/LoadModel/LoadResponseCharacteristic.py new file mode 100755 index 00000000..56da1900 --- /dev/null +++ b/CIM16/IEC61970/LoadModel/LoadResponseCharacteristic.py @@ -0,0 +1,109 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class LoadResponseCharacteristic(IdentifiedObject): + """Models the characteristic response of the load demand due to to changes in system conditions such as voltage and frequency. This is not related to demand response. If LoadResponseCharacteristic.exponentModel is True, the voltage exponents are specified and used as to calculate: Active power component = Pnominal * (Voltage/cim:BaseVoltage.nominalVoltage) ** cim:LoadResponseCharacteristic.pVoltageExponent Reactive power component = Qnominal * (Voltage/cim:BaseVoltage.nominalVoltage)** cim:LoadResponseCharacteristic.qVoltageExponent Where * means 'multiply' and ** is 'raised to power of'.Models the characteristic response of the load demand due to to changes in system conditions such as voltage and frequency. This is not related to demand response. If LoadResponseCharacteristic.exponentModel is True, the voltage exponents are specified and used as to calculate: Active power component = Pnominal * (Voltage/cim:BaseVoltage.nominalVoltage) ** cim:LoadResponseCharacteristic.pVoltageExponent Reactive power component = Qnominal * (Voltage/cim:BaseVoltage.nominalVoltage)** cim:LoadResponseCharacteristic.qVoltageExponent Where * means 'multiply' and ** is 'raised to power of'. + """ + + def __init__(self, pFrequencyExponent=0.0, pConstantPower=0.0, exponentModel=False, qFrequencyExponent=0.0, pVoltageExponent=0.0, qConstantImpedance=0.0, qConstantPower=0.0, pConstantImpedance=0.0, pConstantCurrent=0.0, qVoltageExponent=0.0, qConstantCurrent=0.0, EnergyConsumer=None, *args, **kw_args): + """Initialises a new 'LoadResponseCharacteristic' instance. + + @param pFrequencyExponent: Exponent of per unit frequency effecting active power + @param pConstantPower: Portion of active power load modeled as constant power. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP. + @param exponentModel: Indicates the exponential voltage dependency model (pVoltateExponent and qVoltageExponent) is to be used. If false, the coeficient model (consisting of pConstantImpedance, pConstantCurrent, pConstantPower, qConstantImpedance, qConstantCurrent, and qConstantPower) is to be used. + @param qFrequencyExponent: Exponent of per unit frequency effecting reactive power + @param pVoltageExponent: Exponent of per unit voltage effecting real power. This model used only when 'useExponentModel' is true. + @param qConstantImpedance: Portion of reactive power load modeled as constant impedance. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP. + @param qConstantPower: Portion of reactive power load modeled as constant power. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP. + @param pConstantImpedance: Portion of active power load modeled as constant impedance. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP. + @param pConstantCurrent: Portion of active power load modeled as constant current. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP. + @param qVoltageExponent: Exponent of per unit voltage effecting reactive power. This model used only when 'useExponentModel' is true. + @param qConstantCurrent: Portion of reactive power load modeled as constant current. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP. + @param EnergyConsumer: The set of loads that have the response characteristics. + """ + #: Exponent of per unit frequency effecting active power + self.pFrequencyExponent = pFrequencyExponent + + #: Portion of active power load modeled as constant power. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP. + self.pConstantPower = pConstantPower + + #: Indicates the exponential voltage dependency model (pVoltateExponent and qVoltageExponent) is to be used. If false, the coeficient model (consisting of pConstantImpedance, pConstantCurrent, pConstantPower, qConstantImpedance, qConstantCurrent, and qConstantPower) is to be used. + self.exponentModel = exponentModel + + #: Exponent of per unit frequency effecting reactive power + self.qFrequencyExponent = qFrequencyExponent + + #: Exponent of per unit voltage effecting real power. This model used only when 'useExponentModel' is true. + self.pVoltageExponent = pVoltageExponent + + #: Portion of reactive power load modeled as constant impedance. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP. + self.qConstantImpedance = qConstantImpedance + + #: Portion of reactive power load modeled as constant power. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP. + self.qConstantPower = qConstantPower + + #: Portion of active power load modeled as constant impedance. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP. + self.pConstantImpedance = pConstantImpedance + + #: Portion of active power load modeled as constant current. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP. + self.pConstantCurrent = pConstantCurrent + + #: Exponent of per unit voltage effecting reactive power. This model used only when 'useExponentModel' is true. + self.qVoltageExponent = qVoltageExponent + + #: Portion of reactive power load modeled as constant current. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP. + self.qConstantCurrent = qConstantCurrent + + self._EnergyConsumer = [] + self.EnergyConsumer = [] if EnergyConsumer is None else EnergyConsumer + + super(LoadResponseCharacteristic, self).__init__(*args, **kw_args) + + _attrs = ["pFrequencyExponent", "pConstantPower", "exponentModel", "qFrequencyExponent", "pVoltageExponent", "qConstantImpedance", "qConstantPower", "pConstantImpedance", "pConstantCurrent", "qVoltageExponent", "qConstantCurrent"] + _attr_types = {"pFrequencyExponent": float, "pConstantPower": float, "exponentModel": bool, "qFrequencyExponent": float, "pVoltageExponent": float, "qConstantImpedance": float, "qConstantPower": float, "pConstantImpedance": float, "pConstantCurrent": float, "qVoltageExponent": float, "qConstantCurrent": float} + _defaults = {"pFrequencyExponent": 0.0, "pConstantPower": 0.0, "exponentModel": False, "qFrequencyExponent": 0.0, "pVoltageExponent": 0.0, "qConstantImpedance": 0.0, "qConstantPower": 0.0, "pConstantImpedance": 0.0, "pConstantCurrent": 0.0, "qVoltageExponent": 0.0, "qConstantCurrent": 0.0} + _enums = {} + _refs = ["EnergyConsumer"] + _many_refs = ["EnergyConsumer"] + + def getEnergyConsumer(self): + """The set of loads that have the response characteristics. + """ + return self._EnergyConsumer + + def setEnergyConsumer(self, value): + for x in self._EnergyConsumer: + x.LoadResponse = None + for y in value: + y._LoadResponse = self + self._EnergyConsumer = value + + EnergyConsumer = property(getEnergyConsumer, setEnergyConsumer) + + def addEnergyConsumer(self, *EnergyConsumer): + for obj in EnergyConsumer: + obj.LoadResponse = self + + def removeEnergyConsumer(self, *EnergyConsumer): + for obj in EnergyConsumer: + obj.LoadResponse = None + diff --git a/CIM16/IEC61970/LoadModel/NonConformLoad.py b/CIM16/IEC61970/LoadModel/NonConformLoad.py new file mode 100755 index 00000000..f54640ec --- /dev/null +++ b/CIM16/IEC61970/LoadModel/NonConformLoad.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.EnergyConsumer import EnergyConsumer + +class NonConformLoad(EnergyConsumer): + """NonConformLoad represent loads that do not follow a daily load change pattern and changes are not correlated with the daily load change pattern.NonConformLoad represent loads that do not follow a daily load change pattern and changes are not correlated with the daily load change pattern. + """ + + def __init__(self, LoadGroup=None, *args, **kw_args): + """Initialises a new 'NonConformLoad' instance. + + @param LoadGroup: Group of this ConformLoad. + """ + self._LoadGroup = None + self.LoadGroup = LoadGroup + + super(NonConformLoad, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["LoadGroup"] + _many_refs = [] + + def getLoadGroup(self): + """Group of this ConformLoad. + """ + return self._LoadGroup + + def setLoadGroup(self, value): + if self._LoadGroup is not None: + filtered = [x for x in self.LoadGroup.EnergyConsumers if x != self] + self._LoadGroup._EnergyConsumers = filtered + + self._LoadGroup = value + if self._LoadGroup is not None: + if self not in self._LoadGroup._EnergyConsumers: + self._LoadGroup._EnergyConsumers.append(self) + + LoadGroup = property(getLoadGroup, setLoadGroup) + diff --git a/CIM16/IEC61970/LoadModel/NonConformLoadGroup.py b/CIM16/IEC61970/LoadModel/NonConformLoadGroup.py new file mode 100755 index 00000000..792ec451 --- /dev/null +++ b/CIM16/IEC61970/LoadModel/NonConformLoadGroup.py @@ -0,0 +1,91 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.LoadModel.LoadGroup import LoadGroup + +class NonConformLoadGroup(LoadGroup): + """Loads that do not follow a daily and seasonal load variation pattern.Loads that do not follow a daily and seasonal load variation pattern. + """ + + def __init__(self, NonConformLoadSchedules=None, EnergyConsumers=None, *args, **kw_args): + """Initialises a new 'NonConformLoadGroup' instance. + + @param NonConformLoadSchedules: The NonConformLoadSchedules in the NonConformLoadGroup. + @param EnergyConsumers: Conform loads assigned to this ConformLoadGroup. + """ + self._NonConformLoadSchedules = [] + self.NonConformLoadSchedules = [] if NonConformLoadSchedules is None else NonConformLoadSchedules + + self._EnergyConsumers = [] + self.EnergyConsumers = [] if EnergyConsumers is None else EnergyConsumers + + super(NonConformLoadGroup, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["NonConformLoadSchedules", "EnergyConsumers"] + _many_refs = ["NonConformLoadSchedules", "EnergyConsumers"] + + def getNonConformLoadSchedules(self): + """The NonConformLoadSchedules in the NonConformLoadGroup. + """ + return self._NonConformLoadSchedules + + def setNonConformLoadSchedules(self, value): + for x in self._NonConformLoadSchedules: + x.NonConformLoadGroup = None + for y in value: + y._NonConformLoadGroup = self + self._NonConformLoadSchedules = value + + NonConformLoadSchedules = property(getNonConformLoadSchedules, setNonConformLoadSchedules) + + def addNonConformLoadSchedules(self, *NonConformLoadSchedules): + for obj in NonConformLoadSchedules: + obj.NonConformLoadGroup = self + + def removeNonConformLoadSchedules(self, *NonConformLoadSchedules): + for obj in NonConformLoadSchedules: + obj.NonConformLoadGroup = None + + def getEnergyConsumers(self): + """Conform loads assigned to this ConformLoadGroup. + """ + return self._EnergyConsumers + + def setEnergyConsumers(self, value): + for x in self._EnergyConsumers: + x.LoadGroup = None + for y in value: + y._LoadGroup = self + self._EnergyConsumers = value + + EnergyConsumers = property(getEnergyConsumers, setEnergyConsumers) + + def addEnergyConsumers(self, *EnergyConsumers): + for obj in EnergyConsumers: + obj.LoadGroup = self + + def removeEnergyConsumers(self, *EnergyConsumers): + for obj in EnergyConsumers: + obj.LoadGroup = None + diff --git a/CIM16/IEC61970/LoadModel/NonConformLoadSchedule.py b/CIM16/IEC61970/LoadModel/NonConformLoadSchedule.py new file mode 100755 index 00000000..cddd0e4d --- /dev/null +++ b/CIM16/IEC61970/LoadModel/NonConformLoadSchedule.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.LoadModel.SeasonDayTypeSchedule import SeasonDayTypeSchedule + +class NonConformLoadSchedule(SeasonDayTypeSchedule): + """An active power (Y1-axis) and reactive power (Y2-axis) schedule (curves) versus time (X-axis) for non-conforming loads, e.g., large industrial load or power station service (where modeled)An active power (Y1-axis) and reactive power (Y2-axis) schedule (curves) versus time (X-axis) for non-conforming loads, e.g., large industrial load or power station service (where modeled) + """ + + def __init__(self, NonConformLoadGroup=None, *args, **kw_args): + """Initialises a new 'NonConformLoadSchedule' instance. + + @param NonConformLoadGroup: The NonConformLoadGroup where the NonConformLoadSchedule belongs. + """ + self._NonConformLoadGroup = None + self.NonConformLoadGroup = NonConformLoadGroup + + super(NonConformLoadSchedule, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["NonConformLoadGroup"] + _many_refs = [] + + def getNonConformLoadGroup(self): + """The NonConformLoadGroup where the NonConformLoadSchedule belongs. + """ + return self._NonConformLoadGroup + + def setNonConformLoadGroup(self, value): + if self._NonConformLoadGroup is not None: + filtered = [x for x in self.NonConformLoadGroup.NonConformLoadSchedules if x != self] + self._NonConformLoadGroup._NonConformLoadSchedules = filtered + + self._NonConformLoadGroup = value + if self._NonConformLoadGroup is not None: + if self not in self._NonConformLoadGroup._NonConformLoadSchedules: + self._NonConformLoadGroup._NonConformLoadSchedules.append(self) + + NonConformLoadGroup = property(getNonConformLoadGroup, setNonConformLoadGroup) + diff --git a/CIM16/IEC61970/LoadModel/PowerCutZone.py b/CIM16/IEC61970/LoadModel/PowerCutZone.py new file mode 100755 index 00000000..fd8dbcc3 --- /dev/null +++ b/CIM16/IEC61970/LoadModel/PowerCutZone.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class PowerCutZone(PowerSystemResource): + """An area or zone of the power system which is used for load shedding purposes.An area or zone of the power system which is used for load shedding purposes. + """ + + def __init__(self, cutLevel2=0.0, cutLevel1=0.0, EnergyConsumers=None, *args, **kw_args): + """Initialises a new 'PowerCutZone' instance. + + @param cutLevel2: Second level (amount) of load to cut as a percentage of total zone load + @param cutLevel1: First level (amount) of load to cut as a percentage of total zone load + @param EnergyConsumers: An energy consumer is assigned to a power cut zone + """ + #: Second level (amount) of load to cut as a percentage of total zone load + self.cutLevel2 = cutLevel2 + + #: First level (amount) of load to cut as a percentage of total zone load + self.cutLevel1 = cutLevel1 + + self._EnergyConsumers = [] + self.EnergyConsumers = [] if EnergyConsumers is None else EnergyConsumers + + super(PowerCutZone, self).__init__(*args, **kw_args) + + _attrs = ["cutLevel2", "cutLevel1"] + _attr_types = {"cutLevel2": float, "cutLevel1": float} + _defaults = {"cutLevel2": 0.0, "cutLevel1": 0.0} + _enums = {} + _refs = ["EnergyConsumers"] + _many_refs = ["EnergyConsumers"] + + def getEnergyConsumers(self): + """An energy consumer is assigned to a power cut zone + """ + return self._EnergyConsumers + + def setEnergyConsumers(self, value): + for x in self._EnergyConsumers: + x.PowerCutZone = None + for y in value: + y._PowerCutZone = self + self._EnergyConsumers = value + + EnergyConsumers = property(getEnergyConsumers, setEnergyConsumers) + + def addEnergyConsumers(self, *EnergyConsumers): + for obj in EnergyConsumers: + obj.PowerCutZone = self + + def removeEnergyConsumers(self, *EnergyConsumers): + for obj in EnergyConsumers: + obj.PowerCutZone = None + diff --git a/CIM16/IEC61970/LoadModel/Season.py b/CIM16/IEC61970/LoadModel/Season.py new file mode 100755 index 00000000..06c83de6 --- /dev/null +++ b/CIM16/IEC61970/LoadModel/Season.py @@ -0,0 +1,77 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class Season(Element): + """A specified time period of the year, e.g., Spring, Summer, Fall, WinterA specified time period of the year, e.g., Spring, Summer, Fall, Winter + """ + + def __init__(self, name="winter", startDate='', endDate='', SeasonDayTypeSchedules=None, *args, **kw_args): + """Initialises a new 'Season' instance. + + @param name: Name of the Season Values are: "winter", "summer", "fall", "spring" + @param startDate: Date season starts + @param endDate: Date season ends + @param SeasonDayTypeSchedules: Schedules that use this Season. + """ + #: Name of the Season Values are: "winter", "summer", "fall", "spring" + self.name = name + + #: Date season starts + self.startDate = startDate + + #: Date season ends + self.endDate = endDate + + self._SeasonDayTypeSchedules = [] + self.SeasonDayTypeSchedules = [] if SeasonDayTypeSchedules is None else SeasonDayTypeSchedules + + super(Season, self).__init__(*args, **kw_args) + + _attrs = ["name", "startDate", "endDate"] + _attr_types = {"name": str, "startDate": str, "endDate": str} + _defaults = {"name": "winter", "startDate": '', "endDate": ''} + _enums = {"name": "SeasonName"} + _refs = ["SeasonDayTypeSchedules"] + _many_refs = ["SeasonDayTypeSchedules"] + + def getSeasonDayTypeSchedules(self): + """Schedules that use this Season. + """ + return self._SeasonDayTypeSchedules + + def setSeasonDayTypeSchedules(self, value): + for x in self._SeasonDayTypeSchedules: + x.Season = None + for y in value: + y._Season = self + self._SeasonDayTypeSchedules = value + + SeasonDayTypeSchedules = property(getSeasonDayTypeSchedules, setSeasonDayTypeSchedules) + + def addSeasonDayTypeSchedules(self, *SeasonDayTypeSchedules): + for obj in SeasonDayTypeSchedules: + obj.Season = self + + def removeSeasonDayTypeSchedules(self, *SeasonDayTypeSchedules): + for obj in SeasonDayTypeSchedules: + obj.Season = None + diff --git a/CIM16/IEC61970/LoadModel/SeasonDayTypeSchedule.py b/CIM16/IEC61970/LoadModel/SeasonDayTypeSchedule.py new file mode 100755 index 00000000..7fe8e329 --- /dev/null +++ b/CIM16/IEC61970/LoadModel/SeasonDayTypeSchedule.py @@ -0,0 +1,81 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.RegularIntervalSchedule import RegularIntervalSchedule + +class SeasonDayTypeSchedule(RegularIntervalSchedule): + """The schedule specialize RegularIntervalSchedule with type curve data for a specific type of day and season. This means that curves of this type cover a 24 hour period.The schedule specialize RegularIntervalSchedule with type curve data for a specific type of day and season. This means that curves of this type cover a 24 hour period. + """ + + def __init__(self, Season=None, DayType=None, *args, **kw_args): + """Initialises a new 'SeasonDayTypeSchedule' instance. + + @param Season: Season for the Schedule. + @param DayType: DayType for the Schedule. + """ + self._Season = None + self.Season = Season + + self._DayType = None + self.DayType = DayType + + super(SeasonDayTypeSchedule, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Season", "DayType"] + _many_refs = [] + + def getSeason(self): + """Season for the Schedule. + """ + return self._Season + + def setSeason(self, value): + if self._Season is not None: + filtered = [x for x in self.Season.SeasonDayTypeSchedules if x != self] + self._Season._SeasonDayTypeSchedules = filtered + + self._Season = value + if self._Season is not None: + if self not in self._Season._SeasonDayTypeSchedules: + self._Season._SeasonDayTypeSchedules.append(self) + + Season = property(getSeason, setSeason) + + def getDayType(self): + """DayType for the Schedule. + """ + return self._DayType + + def setDayType(self, value): + if self._DayType is not None: + filtered = [x for x in self.DayType.SeasonDayTypeSchedules if x != self] + self._DayType._SeasonDayTypeSchedules = filtered + + self._DayType = value + if self._DayType is not None: + if self not in self._DayType._SeasonDayTypeSchedules: + self._DayType._SeasonDayTypeSchedules.append(self) + + DayType = property(getDayType, setDayType) + diff --git a/CIM16/IEC61970/LoadModel/StationSupply.py b/CIM16/IEC61970/LoadModel/StationSupply.py new file mode 100755 index 00000000..879aac8f --- /dev/null +++ b/CIM16/IEC61970/LoadModel/StationSupply.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.EnergyConsumer import EnergyConsumer + +class StationSupply(EnergyConsumer): + """Station supply with load derived from the station output.Station supply with load derived from the station output. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'StationSupply' instance. + + """ + super(StationSupply, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/LoadModel/SubLoadArea.py b/CIM16/IEC61970/LoadModel/SubLoadArea.py new file mode 100755 index 00000000..55cb3f88 --- /dev/null +++ b/CIM16/IEC61970/LoadModel/SubLoadArea.py @@ -0,0 +1,86 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.LoadModel.EnergyArea import EnergyArea + +class SubLoadArea(EnergyArea): + """The class is the second level in a hierarchical structure for grouping of loads for the purpose of load flow load scaling.The class is the second level in a hierarchical structure for grouping of loads for the purpose of load flow load scaling. + """ + + def __init__(self, LoadGroups=None, LoadArea=None, *args, **kw_args): + """Initialises a new 'SubLoadArea' instance. + + @param LoadGroups: The Loadgroups in the SubLoadArea. + @param LoadArea: The LoadArea where the SubLoadArea belongs. + """ + self._LoadGroups = [] + self.LoadGroups = [] if LoadGroups is None else LoadGroups + + self._LoadArea = None + self.LoadArea = LoadArea + + super(SubLoadArea, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["LoadGroups", "LoadArea"] + _many_refs = ["LoadGroups"] + + def getLoadGroups(self): + """The Loadgroups in the SubLoadArea. + """ + return self._LoadGroups + + def setLoadGroups(self, value): + for x in self._LoadGroups: + x.SubLoadArea = None + for y in value: + y._SubLoadArea = self + self._LoadGroups = value + + LoadGroups = property(getLoadGroups, setLoadGroups) + + def addLoadGroups(self, *LoadGroups): + for obj in LoadGroups: + obj.SubLoadArea = self + + def removeLoadGroups(self, *LoadGroups): + for obj in LoadGroups: + obj.SubLoadArea = None + + def getLoadArea(self): + """The LoadArea where the SubLoadArea belongs. + """ + return self._LoadArea + + def setLoadArea(self, value): + if self._LoadArea is not None: + filtered = [x for x in self.LoadArea.SubLoadAreas if x != self] + self._LoadArea._SubLoadAreas = filtered + + self._LoadArea = value + if self._LoadArea is not None: + if self not in self._LoadArea._SubLoadAreas: + self._LoadArea._SubLoadAreas.append(self) + + LoadArea = property(getLoadArea, setLoadArea) + diff --git a/CIM16/IEC61970/LoadModel/__init__.py b/CIM16/IEC61970/LoadModel/__init__.py new file mode 100755 index 00000000..08f3ee68 --- /dev/null +++ b/CIM16/IEC61970/LoadModel/__init__.py @@ -0,0 +1,48 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package is responsible for modeling the energy consumers and the system load as curves and associated curve data. Special circumstances that may affect the load, such as seasons and daytypes, are also included here. This information is used by Load Forecasting and Load Management. +""" + +from CIM16.IEC61970.LoadModel.ConformLoad import ConformLoad +from CIM16.IEC61970.LoadModel.ConformLoadGroup import ConformLoadGroup +from CIM16.IEC61970.LoadModel.SeasonDayTypeSchedule import SeasonDayTypeSchedule +from CIM16.IEC61970.LoadModel.LoadGroup import LoadGroup +from CIM16.IEC61970.LoadModel.ConformLoadSchedule import ConformLoadSchedule +from CIM16.IEC61970.LoadModel.LoadArea import LoadArea +from CIM16.IEC61970.LoadModel.PowerCutZone import PowerCutZone +from CIM16.IEC61970.LoadModel.LoadResponseCharacteristic import LoadResponseCharacteristic +from CIM16.IEC61970.LoadModel.NonConformLoad import NonConformLoad +from CIM16.IEC61970.LoadModel.StationSupply import StationSupply +from CIM16.IEC61970.LoadModel.EnergyArea import EnergyArea +from CIM16.IEC61970.LoadModel.NonConformLoadSchedule import NonConformLoadSchedule +from CIM16.IEC61970.LoadModel.NonConformLoadGroup import NonConformLoadGroup +from CIM16.IEC61970.LoadModel.DayType import DayType +from CIM16.IEC61970.LoadModel.SubLoadArea import SubLoadArea +from CIM16.IEC61970.LoadModel.Season import Season + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#LoadModel" +nsPrefix = "cimLoadModel" + + +class SeasonName(str): + """Values are: winter, summer, fall, spring + """ + pass diff --git a/CIM16/IEC61970/Meas/Accumulator.py b/CIM16/IEC61970/Meas/Accumulator.py new file mode 100755 index 00000000..bf25d6f3 --- /dev/null +++ b/CIM16/IEC61970/Meas/Accumulator.py @@ -0,0 +1,101 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.Measurement import Measurement + +class Accumulator(Measurement): + """Accumulator represents a accumulated (counted) Measurement, e.g. an energy value.Accumulator represents a accumulated (counted) Measurement, e.g. an energy value. + """ + + def __init__(self, maxValue=0, LimitSets=None, AccumulatorValues=None, *args, **kw_args): + """Initialises a new 'Accumulator' instance. + + @param maxValue: Normal value range maximum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values. + @param LimitSets: A measurement may have zero or more limit ranges defined for it. + @param AccumulatorValues: The values connected to this measurement. + """ + #: Normal value range maximum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values. + self.maxValue = maxValue + + self._LimitSets = [] + self.LimitSets = [] if LimitSets is None else LimitSets + + self._AccumulatorValues = [] + self.AccumulatorValues = [] if AccumulatorValues is None else AccumulatorValues + + super(Accumulator, self).__init__(*args, **kw_args) + + _attrs = ["maxValue"] + _attr_types = {"maxValue": int} + _defaults = {"maxValue": 0} + _enums = {} + _refs = ["LimitSets", "AccumulatorValues"] + _many_refs = ["LimitSets", "AccumulatorValues"] + + def getLimitSets(self): + """A measurement may have zero or more limit ranges defined for it. + """ + return self._LimitSets + + def setLimitSets(self, value): + for p in self._LimitSets: + filtered = [q for q in p.Measurements if q != self] + self._LimitSets._Measurements = filtered + for r in value: + if self not in r._Measurements: + r._Measurements.append(self) + self._LimitSets = value + + LimitSets = property(getLimitSets, setLimitSets) + + def addLimitSets(self, *LimitSets): + for obj in LimitSets: + if self not in obj._Measurements: + obj._Measurements.append(self) + self._LimitSets.append(obj) + + def removeLimitSets(self, *LimitSets): + for obj in LimitSets: + if self in obj._Measurements: + obj._Measurements.remove(self) + self._LimitSets.remove(obj) + + def getAccumulatorValues(self): + """The values connected to this measurement. + """ + return self._AccumulatorValues + + def setAccumulatorValues(self, value): + for x in self._AccumulatorValues: + x.Accumulator = None + for y in value: + y._Accumulator = self + self._AccumulatorValues = value + + AccumulatorValues = property(getAccumulatorValues, setAccumulatorValues) + + def addAccumulatorValues(self, *AccumulatorValues): + for obj in AccumulatorValues: + obj.Accumulator = self + + def removeAccumulatorValues(self, *AccumulatorValues): + for obj in AccumulatorValues: + obj.Accumulator = None + diff --git a/CIM16/IEC61970/Meas/AccumulatorLimit.py b/CIM16/IEC61970/Meas/AccumulatorLimit.py new file mode 100755 index 00000000..add07577 --- /dev/null +++ b/CIM16/IEC61970/Meas/AccumulatorLimit.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.Limit import Limit + +class AccumulatorLimit(Limit): + """Limit values for Accumulator measurementsLimit values for Accumulator measurements + """ + + def __init__(self, value=0, LimitSet=None, *args, **kw_args): + """Initialises a new 'AccumulatorLimit' instance. + + @param value: The value to supervise against. The value is positive. + @param LimitSet: The set of limits. + """ + #: The value to supervise against. The value is positive. + self.value = value + + self._LimitSet = None + self.LimitSet = LimitSet + + super(AccumulatorLimit, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": int} + _defaults = {"value": 0} + _enums = {} + _refs = ["LimitSet"] + _many_refs = [] + + def getLimitSet(self): + """The set of limits. + """ + return self._LimitSet + + def setLimitSet(self, value): + if self._LimitSet is not None: + filtered = [x for x in self.LimitSet.Limits if x != self] + self._LimitSet._Limits = filtered + + self._LimitSet = value + if self._LimitSet is not None: + if self not in self._LimitSet._Limits: + self._LimitSet._Limits.append(self) + + LimitSet = property(getLimitSet, setLimitSet) + diff --git a/CIM16/IEC61970/Meas/AccumulatorLimitSet.py b/CIM16/IEC61970/Meas/AccumulatorLimitSet.py new file mode 100755 index 00000000..bb4eeedf --- /dev/null +++ b/CIM16/IEC61970/Meas/AccumulatorLimitSet.py @@ -0,0 +1,97 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.LimitSet import LimitSet + +class AccumulatorLimitSet(LimitSet): + """An AccumulatorLimitSet specifies a set of Limits that are associated with an Accumulator measurement.An AccumulatorLimitSet specifies a set of Limits that are associated with an Accumulator measurement. + """ + + def __init__(self, Limits=None, Measurements=None, *args, **kw_args): + """Initialises a new 'AccumulatorLimitSet' instance. + + @param Limits: The limit values used for supervision of Measurements. + @param Measurements: The Measurements using the LimitSet. + """ + self._Limits = [] + self.Limits = [] if Limits is None else Limits + + self._Measurements = [] + self.Measurements = [] if Measurements is None else Measurements + + super(AccumulatorLimitSet, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Limits", "Measurements"] + _many_refs = ["Limits", "Measurements"] + + def getLimits(self): + """The limit values used for supervision of Measurements. + """ + return self._Limits + + def setLimits(self, value): + for x in self._Limits: + x.LimitSet = None + for y in value: + y._LimitSet = self + self._Limits = value + + Limits = property(getLimits, setLimits) + + def addLimits(self, *Limits): + for obj in Limits: + obj.LimitSet = self + + def removeLimits(self, *Limits): + for obj in Limits: + obj.LimitSet = None + + def getMeasurements(self): + """The Measurements using the LimitSet. + """ + return self._Measurements + + def setMeasurements(self, value): + for p in self._Measurements: + filtered = [q for q in p.LimitSets if q != self] + self._Measurements._LimitSets = filtered + for r in value: + if self not in r._LimitSets: + r._LimitSets.append(self) + self._Measurements = value + + Measurements = property(getMeasurements, setMeasurements) + + def addMeasurements(self, *Measurements): + for obj in Measurements: + if self not in obj._LimitSets: + obj._LimitSets.append(self) + self._Measurements.append(obj) + + def removeMeasurements(self, *Measurements): + for obj in Measurements: + if self in obj._LimitSets: + obj._LimitSets.remove(self) + self._Measurements.remove(obj) + diff --git a/CIM16/IEC61970/Meas/AccumulatorValue.py b/CIM16/IEC61970/Meas/AccumulatorValue.py new file mode 100755 index 00000000..eaf49814 --- /dev/null +++ b/CIM16/IEC61970/Meas/AccumulatorValue.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.MeasurementValue import MeasurementValue + +class AccumulatorValue(MeasurementValue): + """AccumulatorValue represents a accumulated (counted) MeasurementValue.AccumulatorValue represents a accumulated (counted) MeasurementValue. + """ + + def __init__(self, value=0, Accumulator=None, *args, **kw_args): + """Initialises a new 'AccumulatorValue' instance. + + @param value: The value to supervise. The value is positive. + @param Accumulator: Measurement to which this value is connected. + """ + #: The value to supervise. The value is positive. + self.value = value + + self._Accumulator = None + self.Accumulator = Accumulator + + super(AccumulatorValue, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": int} + _defaults = {"value": 0} + _enums = {} + _refs = ["Accumulator"] + _many_refs = [] + + def getAccumulator(self): + """Measurement to which this value is connected. + """ + return self._Accumulator + + def setAccumulator(self, value): + if self._Accumulator is not None: + filtered = [x for x in self.Accumulator.AccumulatorValues if x != self] + self._Accumulator._AccumulatorValues = filtered + + self._Accumulator = value + if self._Accumulator is not None: + if self not in self._Accumulator._AccumulatorValues: + self._Accumulator._AccumulatorValues.append(self) + + Accumulator = property(getAccumulator, setAccumulator) + diff --git a/CIM16/IEC61970/Meas/Analog.py b/CIM16/IEC61970/Meas/Analog.py new file mode 100755 index 00000000..a44df18a --- /dev/null +++ b/CIM16/IEC61970/Meas/Analog.py @@ -0,0 +1,133 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.Measurement import Measurement + +class Analog(Measurement): + """Analog represents an analog Measurement.Analog represents an analog Measurement. + """ + + def __init__(self, maxValue=0.0, normalValue=0.0, positiveFlowIn=False, minValue=0.0, LimitSets=None, AnalogValues=None, SetPoint=None, *args, **kw_args): + """Initialises a new 'Analog' instance. + + @param maxValue: Normal value range maximum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values. + @param normalValue: Normal measurement value, e.g., used for percentage calculations. + @param positiveFlowIn: If true then this measurement is an active power, reactive power or current with the convention that a positive value measured at the Terminal means power is flowing into the related PowerSystemResource. + @param minValue: Normal value range minimum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values + @param LimitSets: A measurement may have zero or more limit ranges defined for it. + @param AnalogValues: The values connected to this measurement. + @param SetPoint: The Control variable associated with the Measurement + """ + #: Normal value range maximum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values. + self.maxValue = maxValue + + #: Normal measurement value, e.g., used for percentage calculations. + self.normalValue = normalValue + + #: If true then this measurement is an active power, reactive power or current with the convention that a positive value measured at the Terminal means power is flowing into the related PowerSystemResource. + self.positiveFlowIn = positiveFlowIn + + #: Normal value range minimum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values + self.minValue = minValue + + self._LimitSets = [] + self.LimitSets = [] if LimitSets is None else LimitSets + + self._AnalogValues = [] + self.AnalogValues = [] if AnalogValues is None else AnalogValues + + self._SetPoint = None + self.SetPoint = SetPoint + + super(Analog, self).__init__(*args, **kw_args) + + _attrs = ["maxValue", "normalValue", "positiveFlowIn", "minValue"] + _attr_types = {"maxValue": float, "normalValue": float, "positiveFlowIn": bool, "minValue": float} + _defaults = {"maxValue": 0.0, "normalValue": 0.0, "positiveFlowIn": False, "minValue": 0.0} + _enums = {} + _refs = ["LimitSets", "AnalogValues", "SetPoint"] + _many_refs = ["LimitSets", "AnalogValues"] + + def getLimitSets(self): + """A measurement may have zero or more limit ranges defined for it. + """ + return self._LimitSets + + def setLimitSets(self, value): + for p in self._LimitSets: + filtered = [q for q in p.Measurements if q != self] + self._LimitSets._Measurements = filtered + for r in value: + if self not in r._Measurements: + r._Measurements.append(self) + self._LimitSets = value + + LimitSets = property(getLimitSets, setLimitSets) + + def addLimitSets(self, *LimitSets): + for obj in LimitSets: + if self not in obj._Measurements: + obj._Measurements.append(self) + self._LimitSets.append(obj) + + def removeLimitSets(self, *LimitSets): + for obj in LimitSets: + if self in obj._Measurements: + obj._Measurements.remove(self) + self._LimitSets.remove(obj) + + def getAnalogValues(self): + """The values connected to this measurement. + """ + return self._AnalogValues + + def setAnalogValues(self, value): + for x in self._AnalogValues: + x.Analog = None + for y in value: + y._Analog = self + self._AnalogValues = value + + AnalogValues = property(getAnalogValues, setAnalogValues) + + def addAnalogValues(self, *AnalogValues): + for obj in AnalogValues: + obj.Analog = self + + def removeAnalogValues(self, *AnalogValues): + for obj in AnalogValues: + obj.Analog = None + + def getSetPoint(self): + """The Control variable associated with the Measurement + """ + return self._SetPoint + + def setSetPoint(self, value): + if self._SetPoint is not None: + self._SetPoint._Analog = None + + self._SetPoint = value + if self._SetPoint is not None: + self._SetPoint.Analog = None + self._SetPoint._Analog = self + + SetPoint = property(getSetPoint, setSetPoint) + diff --git a/CIM16/IEC61970/Meas/AnalogLimit.py b/CIM16/IEC61970/Meas/AnalogLimit.py new file mode 100755 index 00000000..8adbea44 --- /dev/null +++ b/CIM16/IEC61970/Meas/AnalogLimit.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.Limit import Limit + +class AnalogLimit(Limit): + """Limit values for Analog measurementsLimit values for Analog measurements + """ + + def __init__(self, value=0.0, LimitSet=None, *args, **kw_args): + """Initialises a new 'AnalogLimit' instance. + + @param value: The value to supervise against. + @param LimitSet: The set of limits. + """ + #: The value to supervise against. + self.value = value + + self._LimitSet = None + self.LimitSet = LimitSet + + super(AnalogLimit, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": float} + _defaults = {"value": 0.0} + _enums = {} + _refs = ["LimitSet"] + _many_refs = [] + + def getLimitSet(self): + """The set of limits. + """ + return self._LimitSet + + def setLimitSet(self, value): + if self._LimitSet is not None: + filtered = [x for x in self.LimitSet.Limits if x != self] + self._LimitSet._Limits = filtered + + self._LimitSet = value + if self._LimitSet is not None: + if self not in self._LimitSet._Limits: + self._LimitSet._Limits.append(self) + + LimitSet = property(getLimitSet, setLimitSet) + diff --git a/CIM16/IEC61970/Meas/AnalogLimitSet.py b/CIM16/IEC61970/Meas/AnalogLimitSet.py new file mode 100755 index 00000000..58b5926e --- /dev/null +++ b/CIM16/IEC61970/Meas/AnalogLimitSet.py @@ -0,0 +1,97 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.LimitSet import LimitSet + +class AnalogLimitSet(LimitSet): + """An AnalogLimitSet specifies a set of Limits that are associated with an Analog measurement.An AnalogLimitSet specifies a set of Limits that are associated with an Analog measurement. + """ + + def __init__(self, Limits=None, Measurements=None, *args, **kw_args): + """Initialises a new 'AnalogLimitSet' instance. + + @param Limits: The limit values used for supervision of Measurements. + @param Measurements: The Measurements using the LimitSet. + """ + self._Limits = [] + self.Limits = [] if Limits is None else Limits + + self._Measurements = [] + self.Measurements = [] if Measurements is None else Measurements + + super(AnalogLimitSet, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Limits", "Measurements"] + _many_refs = ["Limits", "Measurements"] + + def getLimits(self): + """The limit values used for supervision of Measurements. + """ + return self._Limits + + def setLimits(self, value): + for x in self._Limits: + x.LimitSet = None + for y in value: + y._LimitSet = self + self._Limits = value + + Limits = property(getLimits, setLimits) + + def addLimits(self, *Limits): + for obj in Limits: + obj.LimitSet = self + + def removeLimits(self, *Limits): + for obj in Limits: + obj.LimitSet = None + + def getMeasurements(self): + """The Measurements using the LimitSet. + """ + return self._Measurements + + def setMeasurements(self, value): + for p in self._Measurements: + filtered = [q for q in p.LimitSets if q != self] + self._Measurements._LimitSets = filtered + for r in value: + if self not in r._LimitSets: + r._LimitSets.append(self) + self._Measurements = value + + Measurements = property(getMeasurements, setMeasurements) + + def addMeasurements(self, *Measurements): + for obj in Measurements: + if self not in obj._LimitSets: + obj._LimitSets.append(self) + self._Measurements.append(obj) + + def removeMeasurements(self, *Measurements): + for obj in Measurements: + if self in obj._LimitSets: + obj._LimitSets.remove(self) + self._Measurements.remove(obj) + diff --git a/CIM16/IEC61970/Meas/AnalogValue.py b/CIM16/IEC61970/Meas/AnalogValue.py new file mode 100755 index 00000000..2e56f462 --- /dev/null +++ b/CIM16/IEC61970/Meas/AnalogValue.py @@ -0,0 +1,116 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.MeasurementValue import MeasurementValue + +class AnalogValue(MeasurementValue): + """AnalogValue represents an analog MeasurementValue.AnalogValue represents an analog MeasurementValue. + """ + + def __init__(self, value=0.0, AltTieMeas=None, Analog=None, AltGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'AnalogValue' instance. + + @param value: The value to supervise. + @param AltTieMeas: The usage of the measurement within the control area specification. + @param Analog: Measurement to which this value is connected. + @param AltGeneratingUnit: The alternate generating unit for which this measurement value applies. + """ + #: The value to supervise. + self.value = value + + self._AltTieMeas = [] + self.AltTieMeas = [] if AltTieMeas is None else AltTieMeas + + self._Analog = None + self.Analog = Analog + + self._AltGeneratingUnit = [] + self.AltGeneratingUnit = [] if AltGeneratingUnit is None else AltGeneratingUnit + + super(AnalogValue, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": float} + _defaults = {"value": 0.0} + _enums = {} + _refs = ["AltTieMeas", "Analog", "AltGeneratingUnit"] + _many_refs = ["AltTieMeas", "AltGeneratingUnit"] + + def getAltTieMeas(self): + """The usage of the measurement within the control area specification. + """ + return self._AltTieMeas + + def setAltTieMeas(self, value): + for x in self._AltTieMeas: + x.AnalogValue = None + for y in value: + y._AnalogValue = self + self._AltTieMeas = value + + AltTieMeas = property(getAltTieMeas, setAltTieMeas) + + def addAltTieMeas(self, *AltTieMeas): + for obj in AltTieMeas: + obj.AnalogValue = self + + def removeAltTieMeas(self, *AltTieMeas): + for obj in AltTieMeas: + obj.AnalogValue = None + + def getAnalog(self): + """Measurement to which this value is connected. + """ + return self._Analog + + def setAnalog(self, value): + if self._Analog is not None: + filtered = [x for x in self.Analog.AnalogValues if x != self] + self._Analog._AnalogValues = filtered + + self._Analog = value + if self._Analog is not None: + if self not in self._Analog._AnalogValues: + self._Analog._AnalogValues.append(self) + + Analog = property(getAnalog, setAnalog) + + def getAltGeneratingUnit(self): + """The alternate generating unit for which this measurement value applies. + """ + return self._AltGeneratingUnit + + def setAltGeneratingUnit(self, value): + for x in self._AltGeneratingUnit: + x.AnalogValue = None + for y in value: + y._AnalogValue = self + self._AltGeneratingUnit = value + + AltGeneratingUnit = property(getAltGeneratingUnit, setAltGeneratingUnit) + + def addAltGeneratingUnit(self, *AltGeneratingUnit): + for obj in AltGeneratingUnit: + obj.AnalogValue = self + + def removeAltGeneratingUnit(self, *AltGeneratingUnit): + for obj in AltGeneratingUnit: + obj.AnalogValue = None + diff --git a/CIM16/IEC61970/Meas/Command.py b/CIM16/IEC61970/Meas/Command.py new file mode 100755 index 00000000..6ca4f63a --- /dev/null +++ b/CIM16/IEC61970/Meas/Command.py @@ -0,0 +1,88 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.Control import Control + +class Command(Control): + """A Command is a discrete control used for supervisory control.A Command is a discrete control used for supervisory control. + """ + + def __init__(self, value=0, normalValue=0, Discrete=None, ValueAliasSet=None, *args, **kw_args): + """Initialises a new 'Command' instance. + + @param value: The value representing the actuator output + @param normalValue: Normal value for Control.value e.g. used for percentage scaling + @param Discrete: The Measurement variable used for control. + @param ValueAliasSet: The Commands using the set for translation. + """ + #: The value representing the actuator output + self.value = value + + #: Normal value for Control.value e.g. used for percentage scaling + self.normalValue = normalValue + + self._Discrete = None + self.Discrete = Discrete + + self._ValueAliasSet = None + self.ValueAliasSet = ValueAliasSet + + super(Command, self).__init__(*args, **kw_args) + + _attrs = ["value", "normalValue"] + _attr_types = {"value": int, "normalValue": int} + _defaults = {"value": 0, "normalValue": 0} + _enums = {} + _refs = ["Discrete", "ValueAliasSet"] + _many_refs = [] + + def getDiscrete(self): + """The Measurement variable used for control. + """ + return self._Discrete + + def setDiscrete(self, value): + if self._Discrete is not None: + self._Discrete._Command = None + + self._Discrete = value + if self._Discrete is not None: + self._Discrete.Command = None + self._Discrete._Command = self + + Discrete = property(getDiscrete, setDiscrete) + + def getValueAliasSet(self): + """The Commands using the set for translation. + """ + return self._ValueAliasSet + + def setValueAliasSet(self, value): + if self._ValueAliasSet is not None: + filtered = [x for x in self.ValueAliasSet.Commands if x != self] + self._ValueAliasSet._Commands = filtered + + self._ValueAliasSet = value + if self._ValueAliasSet is not None: + if self not in self._ValueAliasSet._Commands: + self._ValueAliasSet._Commands.append(self) + + ValueAliasSet = property(getValueAliasSet, setValueAliasSet) + diff --git a/CIM16/IEC61970/Meas/Control.py b/CIM16/IEC61970/Meas/Control.py new file mode 100755 index 00000000..9aa565f3 --- /dev/null +++ b/CIM16/IEC61970/Meas/Control.py @@ -0,0 +1,117 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Control(IdentifiedObject): + """Control is used for supervisory/device control. It represents control outputs that are used to change the state in a process, e.g. close or open breaker, a set point value or a raise lower command.Control is used for supervisory/device control. It represents control outputs that are used to change the state in a process, e.g. close or open breaker, a set point value or a raise lower command. + """ + + def __init__(self, unitSymbol="N", unitMultiplier="M", operationInProgress=False, timeStamp='', RemoteControl=None, RegulatingCondEq=None, ControlType=None, *args, **kw_args): + """Initialises a new 'Control' instance. + + @param unitSymbol: The unit of measure of the controlled quantity. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param unitMultiplier: The unit multiplier of the controlled quantity. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param operationInProgress: Indicates that a client is currently sending control commands that has not completed + @param timeStamp: The last time a control output was sent + @param RemoteControl: The remote point controlling the physical actuator. + @param RegulatingCondEq: Regulating device governed by this control output. + @param ControlType: The type of Control + """ + #: The unit of measure of the controlled quantity. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.unitSymbol = unitSymbol + + #: The unit multiplier of the controlled quantity. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.unitMultiplier = unitMultiplier + + #: Indicates that a client is currently sending control commands that has not completed + self.operationInProgress = operationInProgress + + #: The last time a control output was sent + self.timeStamp = timeStamp + + self._RemoteControl = None + self.RemoteControl = RemoteControl + + self._RegulatingCondEq = None + self.RegulatingCondEq = RegulatingCondEq + + self._ControlType = None + self.ControlType = ControlType + + super(Control, self).__init__(*args, **kw_args) + + _attrs = ["unitSymbol", "unitMultiplier", "operationInProgress", "timeStamp"] + _attr_types = {"unitSymbol": str, "unitMultiplier": str, "operationInProgress": bool, "timeStamp": str} + _defaults = {"unitSymbol": "N", "unitMultiplier": "M", "operationInProgress": False, "timeStamp": ''} + _enums = {"unitSymbol": "UnitSymbol", "unitMultiplier": "UnitMultiplier"} + _refs = ["RemoteControl", "RegulatingCondEq", "ControlType"] + _many_refs = [] + + def getRemoteControl(self): + """The remote point controlling the physical actuator. + """ + return self._RemoteControl + + def setRemoteControl(self, value): + if self._RemoteControl is not None: + self._RemoteControl._Control = None + + self._RemoteControl = value + if self._RemoteControl is not None: + self._RemoteControl.Control = None + self._RemoteControl._Control = self + + RemoteControl = property(getRemoteControl, setRemoteControl) + + def getRegulatingCondEq(self): + """Regulating device governed by this control output. + """ + return self._RegulatingCondEq + + def setRegulatingCondEq(self, value): + if self._RegulatingCondEq is not None: + filtered = [x for x in self.RegulatingCondEq.Controls if x != self] + self._RegulatingCondEq._Controls = filtered + + self._RegulatingCondEq = value + if self._RegulatingCondEq is not None: + if self not in self._RegulatingCondEq._Controls: + self._RegulatingCondEq._Controls.append(self) + + RegulatingCondEq = property(getRegulatingCondEq, setRegulatingCondEq) + + def getControlType(self): + """The type of Control + """ + return self._ControlType + + def setControlType(self, value): + if self._ControlType is not None: + filtered = [x for x in self.ControlType.Controls if x != self] + self._ControlType._Controls = filtered + + self._ControlType = value + if self._ControlType is not None: + if self not in self._ControlType._Controls: + self._ControlType._Controls.append(self) + + ControlType = property(getControlType, setControlType) + diff --git a/CIM16/IEC61970/Meas/ControlType.py b/CIM16/IEC61970/Meas/ControlType.py new file mode 100755 index 00000000..9b3b7ddd --- /dev/null +++ b/CIM16/IEC61970/Meas/ControlType.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ControlType(IdentifiedObject): + """Specifies the type of Control, e.g. BreakerOn/Off, GeneratorVoltageSetPoint, TieLineFlow etc. The ControlType.name shall be unique among all specified types and describe the type. The ControlType.aliasName is meant to be used for localization.Specifies the type of Control, e.g. BreakerOn/Off, GeneratorVoltageSetPoint, TieLineFlow etc. The ControlType.name shall be unique among all specified types and describe the type. The ControlType.aliasName is meant to be used for localization. + """ + + def __init__(self, Controls=None, *args, **kw_args): + """Initialises a new 'ControlType' instance. + + @param Controls: The Controls having the ControlType + """ + self._Controls = [] + self.Controls = [] if Controls is None else Controls + + super(ControlType, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Controls"] + _many_refs = ["Controls"] + + def getControls(self): + """The Controls having the ControlType + """ + return self._Controls + + def setControls(self, value): + for x in self._Controls: + x.ControlType = None + for y in value: + y._ControlType = self + self._Controls = value + + Controls = property(getControls, setControls) + + def addControls(self, *Controls): + for obj in Controls: + obj.ControlType = self + + def removeControls(self, *Controls): + for obj in Controls: + obj.ControlType = None + diff --git a/CIM16/IEC61970/Meas/Discrete.py b/CIM16/IEC61970/Meas/Discrete.py new file mode 100755 index 00000000..78f3df9c --- /dev/null +++ b/CIM16/IEC61970/Meas/Discrete.py @@ -0,0 +1,118 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.Measurement import Measurement + +class Discrete(Measurement): + """Discrete represents a discrete Measurement, i.e. a Measurement reprsenting discrete values, e.g. a Breaker position.Discrete represents a discrete Measurement, i.e. a Measurement reprsenting discrete values, e.g. a Breaker position. + """ + + def __init__(self, normalValue=0, minValue=0, maxValue=0, Command=None, DiscreteValues=None, ValueAliasSet=None, *args, **kw_args): + """Initialises a new 'Discrete' instance. + + @param normalValue: Normal measurement value, e.g., used for percentage calculations. + @param minValue: Normal value range minimum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values + @param maxValue: Normal value range maximum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values. + @param Command: The Control variable associated with the Measurement. + @param DiscreteValues: The values connected to this measurement. + @param ValueAliasSet: The ValueAliasSet used for translation of a MeasurementValue.value to a name + """ + #: Normal measurement value, e.g., used for percentage calculations. + self.normalValue = normalValue + + #: Normal value range minimum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values + self.minValue = minValue + + #: Normal value range maximum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values. + self.maxValue = maxValue + + self._Command = None + self.Command = Command + + self._DiscreteValues = [] + self.DiscreteValues = [] if DiscreteValues is None else DiscreteValues + + self._ValueAliasSet = None + self.ValueAliasSet = ValueAliasSet + + super(Discrete, self).__init__(*args, **kw_args) + + _attrs = ["normalValue", "minValue", "maxValue"] + _attr_types = {"normalValue": int, "minValue": int, "maxValue": int} + _defaults = {"normalValue": 0, "minValue": 0, "maxValue": 0} + _enums = {} + _refs = ["Command", "DiscreteValues", "ValueAliasSet"] + _many_refs = ["DiscreteValues"] + + def getCommand(self): + """The Control variable associated with the Measurement. + """ + return self._Command + + def setCommand(self, value): + if self._Command is not None: + self._Command._Discrete = None + + self._Command = value + if self._Command is not None: + self._Command.Discrete = None + self._Command._Discrete = self + + Command = property(getCommand, setCommand) + + def getDiscreteValues(self): + """The values connected to this measurement. + """ + return self._DiscreteValues + + def setDiscreteValues(self, value): + for x in self._DiscreteValues: + x.Discrete = None + for y in value: + y._Discrete = self + self._DiscreteValues = value + + DiscreteValues = property(getDiscreteValues, setDiscreteValues) + + def addDiscreteValues(self, *DiscreteValues): + for obj in DiscreteValues: + obj.Discrete = self + + def removeDiscreteValues(self, *DiscreteValues): + for obj in DiscreteValues: + obj.Discrete = None + + def getValueAliasSet(self): + """The ValueAliasSet used for translation of a MeasurementValue.value to a name + """ + return self._ValueAliasSet + + def setValueAliasSet(self, value): + if self._ValueAliasSet is not None: + filtered = [x for x in self.ValueAliasSet.Discretes if x != self] + self._ValueAliasSet._Discretes = filtered + + self._ValueAliasSet = value + if self._ValueAliasSet is not None: + if self not in self._ValueAliasSet._Discretes: + self._ValueAliasSet._Discretes.append(self) + + ValueAliasSet = property(getValueAliasSet, setValueAliasSet) + diff --git a/CIM16/IEC61970/Meas/DiscreteValue.py b/CIM16/IEC61970/Meas/DiscreteValue.py new file mode 100755 index 00000000..c9d76770 --- /dev/null +++ b/CIM16/IEC61970/Meas/DiscreteValue.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.MeasurementValue import MeasurementValue + +class DiscreteValue(MeasurementValue): + """DiscreteValue represents a discrete MeasurementValue.DiscreteValue represents a discrete MeasurementValue. + """ + + def __init__(self, value=0, Discrete=None, *args, **kw_args): + """Initialises a new 'DiscreteValue' instance. + + @param value: The value to supervise. + @param Discrete: Measurement to which this value is connected. + """ + #: The value to supervise. + self.value = value + + self._Discrete = None + self.Discrete = Discrete + + super(DiscreteValue, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": int} + _defaults = {"value": 0} + _enums = {} + _refs = ["Discrete"] + _many_refs = [] + + def getDiscrete(self): + """Measurement to which this value is connected. + """ + return self._Discrete + + def setDiscrete(self, value): + if self._Discrete is not None: + filtered = [x for x in self.Discrete.DiscreteValues if x != self] + self._Discrete._DiscreteValues = filtered + + self._Discrete = value + if self._Discrete is not None: + if self not in self._Discrete._DiscreteValues: + self._Discrete._DiscreteValues.append(self) + + Discrete = property(getDiscrete, setDiscrete) + diff --git a/CIM16/IEC61970/Meas/Limit.py b/CIM16/IEC61970/Meas/Limit.py new file mode 100755 index 00000000..2602e69b --- /dev/null +++ b/CIM16/IEC61970/Meas/Limit.py @@ -0,0 +1,70 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Limit(IdentifiedObject): + """Specifies one limit value for a Measurement. A Measurement typically has several limits that are kept together by the LimitSet class. The actual meaning and use of a Limit instance (i.e., if it is an alarm or warning limit or if it is a high or low limit) is not captured in the Limit class. However the name of a Limit instance may indicate both meaning and use.Specifies one limit value for a Measurement. A Measurement typically has several limits that are kept together by the LimitSet class. The actual meaning and use of a Limit instance (i.e., if it is an alarm or warning limit or if it is a high or low limit) is not captured in the Limit class. However the name of a Limit instance may indicate both meaning and use. + """ + + def __init__(self, Procedures=None, *args, **kw_args): + """Initialises a new 'Limit' instance. + + @param Procedures: + """ + self._Procedures = [] + self.Procedures = [] if Procedures is None else Procedures + + super(Limit, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Procedures"] + _many_refs = ["Procedures"] + + def getProcedures(self): + + return self._Procedures + + def setProcedures(self, value): + for p in self._Procedures: + filtered = [q for q in p.Limits if q != self] + self._Procedures._Limits = filtered + for r in value: + if self not in r._Limits: + r._Limits.append(self) + self._Procedures = value + + Procedures = property(getProcedures, setProcedures) + + def addProcedures(self, *Procedures): + for obj in Procedures: + if self not in obj._Limits: + obj._Limits.append(self) + self._Procedures.append(obj) + + def removeProcedures(self, *Procedures): + for obj in Procedures: + if self in obj._Limits: + obj._Limits.remove(self) + self._Procedures.remove(obj) + diff --git a/CIM16/IEC61970/Meas/LimitSet.py b/CIM16/IEC61970/Meas/LimitSet.py new file mode 100755 index 00000000..7b9a9d50 --- /dev/null +++ b/CIM16/IEC61970/Meas/LimitSet.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class LimitSet(IdentifiedObject): + """Specifies a set of Limits that are associated with a Measurement. A Measurement may have several LimitSets corresponding to seasonal or other changing conditions. The condition is captured in the name and description attributes. The same LimitSet may be used for several Measurements. In particular percentage limits are used this way.Specifies a set of Limits that are associated with a Measurement. A Measurement may have several LimitSets corresponding to seasonal or other changing conditions. The condition is captured in the name and description attributes. The same LimitSet may be used for several Measurements. In particular percentage limits are used this way. + """ + + def __init__(self, isPercentageLimits=False, *args, **kw_args): + """Initialises a new 'LimitSet' instance. + + @param isPercentageLimits: Tells if the limit values are in percentage of normalValue or the specified Unit for Measurements and Controls. + """ + #: Tells if the limit values are in percentage of normalValue or the specified Unit for Measurements and Controls. + self.isPercentageLimits = isPercentageLimits + + super(LimitSet, self).__init__(*args, **kw_args) + + _attrs = ["isPercentageLimits"] + _attr_types = {"isPercentageLimits": bool} + _defaults = {"isPercentageLimits": False} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Meas/Measurement.py b/CIM16/IEC61970/Meas/Measurement.py new file mode 100755 index 00000000..085fc1ad --- /dev/null +++ b/CIM16/IEC61970/Meas/Measurement.py @@ -0,0 +1,180 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Measurement(IdentifiedObject): + """A Measurement represents any measured, calculated or non-measured non-calculated quantity. Any piece of equipment may contain Measurements, e.g. a substation may have temperature measurements and door open indications, a transformer may have oil temperature and tank pressure measurements, a bay may contain a number of power flow measurements and a Breaker may contain a switch status measurement. The PSR - Measurement association is intended to capture this use of Measurement and is included in the naming hierarchy based on EquipmentContainer. The naming hierarchy typically has Measurements as leafs, e.g. Substation-VoltageLevel-Bay-Switch-Measurement. Some Measurements represent quantities related to a particular sensor location in the network, e.g. a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. The sensing position is not captured in the PSR - Measurement association. Instead it is captured by the Measurement - Terminal association that is used to define the sensing location in the network topology. The location is defined by the connection of the Terminal to ConductingEquipment. Two possible paths exist: 1) Measurement-Terminal- ConnectivityNode-Terminal-ConductingEquipment 2) Measurement-Terminal-ConductingEquipment Alternative 2 is the only allowed use. When the sensor location is needed both Measurement-PSR and Measurement-Terminal are used. The Measurement-Terminal association is never used alone.A Measurement represents any measured, calculated or non-measured non-calculated quantity. Any piece of equipment may contain Measurements, e.g. a substation may have temperature measurements and door open indications, a transformer may have oil temperature and tank pressure measurements, a bay may contain a number of power flow measurements and a Breaker may contain a switch status measurement. The PSR - Measurement association is intended to capture this use of Measurement and is included in the naming hierarchy based on EquipmentContainer. The naming hierarchy typically has Measurements as leafs, e.g. Substation-VoltageLevel-Bay-Switch-Measurement. Some Measurements represent quantities related to a particular sensor location in the network, e.g. a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. The sensing position is not captured in the PSR - Measurement association. Instead it is captured by the Measurement - Terminal association that is used to define the sensing location in the network topology. The location is defined by the connection of the Terminal to ConductingEquipment. Two possible paths exist: 1) Measurement-Terminal- ConnectivityNode-Terminal-ConductingEquipment 2) Measurement-Terminal-ConductingEquipment Alternative 2 is the only allowed use. When the sensor location is needed both Measurement-PSR and Measurement-Terminal are used. The Measurement-Terminal association is never used alone. + """ + + def __init__(self, phases="s12N", measurementType='', unitMultiplier="M", unitSymbol="N", Terminal=None, PowerSystemResource=None, Locations=None, Asset=None, Documents=None, *args, **kw_args): + """Initialises a new 'Measurement' instance. + + @param phases: Indicates to which phases the measurement applies and avoids the need to use 'measurementType' to also encode phase information (which would explode the types). Since Controls have associations with Measurements, they will have the capability to handle each phase. The phase information in Measurement, along with 'measurementType' and 'phaseConnection' uniquely defines a Measurement for a device, based on normal network phase. Their meaning will not change when the computed energizing phasing is changed due to jumpers or other reasons. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param measurementType: Specifies the type of Measurement, e.g. IndoorTemperature, OutDoorTemperature, BusVoltage, GeneratorVoltage, LineFlow etc. + @param unitMultiplier: The unit multiplier of the measured quantity. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param unitSymbol: The unit of measure of the measured quantity. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "degC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param Terminal: One or more measurements may be associated with a terminal in the network + @param PowerSystemResource: The PowerSystemResource that contains the Measurement in the naming hierarchy + @param Locations: + @param Asset: + @param Documents: Measurements are specified in types of documents, such as procedures. + """ + #: Indicates to which phases the measurement applies and avoids the need to use 'measurementType' to also encode phase information (which would explode the types). Since Controls have associations with Measurements, they will have the capability to handle each phase. The phase information in Measurement, along with 'measurementType' and 'phaseConnection' uniquely defines a Measurement for a device, based on normal network phase. Their meaning will not change when the computed energizing phasing is changed due to jumpers or other reasons. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.phases = phases + + #: Specifies the type of Measurement, e.g. IndoorTemperature, OutDoorTemperature, BusVoltage, GeneratorVoltage, LineFlow etc. + self.measurementType = measurementType + + #: The unit multiplier of the measured quantity. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.unitMultiplier = unitMultiplier + + #: The unit of measure of the measured quantity. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "degC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.unitSymbol = unitSymbol + + self._Terminal = None + self.Terminal = Terminal + + self._PowerSystemResource = None + self.PowerSystemResource = PowerSystemResource + + self._Locations = [] + self.Locations = [] if Locations is None else Locations + + self._Asset = None + self.Asset = Asset + + self._Documents = [] + self.Documents = [] if Documents is None else Documents + + super(Measurement, self).__init__(*args, **kw_args) + + _attrs = ["phases", "measurementType", "unitMultiplier", "unitSymbol"] + _attr_types = {"phases": str, "measurementType": str, "unitMultiplier": str, "unitSymbol": str} + _defaults = {"phases": "s12N", "measurementType": '', "unitMultiplier": "M", "unitSymbol": "N"} + _enums = {"phases": "PhaseCode", "unitMultiplier": "UnitMultiplier", "unitSymbol": "UnitSymbol"} + _refs = ["Terminal", "PowerSystemResource", "Locations", "Asset", "Documents"] + _many_refs = ["Locations", "Documents"] + + def getTerminal(self): + """One or more measurements may be associated with a terminal in the network + """ + return self._Terminal + + def setTerminal(self, value): + if self._Terminal is not None: + filtered = [x for x in self.Terminal.Measurements if x != self] + self._Terminal._Measurements = filtered + + self._Terminal = value + if self._Terminal is not None: + if self not in self._Terminal._Measurements: + self._Terminal._Measurements.append(self) + + Terminal = property(getTerminal, setTerminal) + + def getPowerSystemResource(self): + """The PowerSystemResource that contains the Measurement in the naming hierarchy + """ + return self._PowerSystemResource + + def setPowerSystemResource(self, value): + if self._PowerSystemResource is not None: + filtered = [x for x in self.PowerSystemResource.Measurements if x != self] + self._PowerSystemResource._Measurements = filtered + + self._PowerSystemResource = value + if self._PowerSystemResource is not None: + if self not in self._PowerSystemResource._Measurements: + self._PowerSystemResource._Measurements.append(self) + + PowerSystemResource = property(getPowerSystemResource, setPowerSystemResource) + + def getLocations(self): + + return self._Locations + + def setLocations(self, value): + for p in self._Locations: + filtered = [q for q in p.Measurements if q != self] + self._Locations._Measurements = filtered + for r in value: + if self not in r._Measurements: + r._Measurements.append(self) + self._Locations = value + + Locations = property(getLocations, setLocations) + + def addLocations(self, *Locations): + for obj in Locations: + if self not in obj._Measurements: + obj._Measurements.append(self) + self._Locations.append(obj) + + def removeLocations(self, *Locations): + for obj in Locations: + if self in obj._Measurements: + obj._Measurements.remove(self) + self._Locations.remove(obj) + + def getAsset(self): + + return self._Asset + + def setAsset(self, value): + if self._Asset is not None: + filtered = [x for x in self.Asset.Measurements if x != self] + self._Asset._Measurements = filtered + + self._Asset = value + if self._Asset is not None: + if self not in self._Asset._Measurements: + self._Asset._Measurements.append(self) + + Asset = property(getAsset, setAsset) + + def getDocuments(self): + """Measurements are specified in types of documents, such as procedures. + """ + return self._Documents + + def setDocuments(self, value): + for p in self._Documents: + filtered = [q for q in p.Measurements if q != self] + self._Documents._Measurements = filtered + for r in value: + if self not in r._Measurements: + r._Measurements.append(self) + self._Documents = value + + Documents = property(getDocuments, setDocuments) + + def addDocuments(self, *Documents): + for obj in Documents: + if self not in obj._Measurements: + obj._Measurements.append(self) + self._Documents.append(obj) + + def removeDocuments(self, *Documents): + for obj in Documents: + if self in obj._Measurements: + obj._Measurements.remove(self) + self._Documents.remove(obj) + diff --git a/CIM16/IEC61970/Meas/MeasurementValue.py b/CIM16/IEC61970/Meas/MeasurementValue.py new file mode 100755 index 00000000..d0d4e24e --- /dev/null +++ b/CIM16/IEC61970/Meas/MeasurementValue.py @@ -0,0 +1,184 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class MeasurementValue(IdentifiedObject): + """The current state for a measurement. A state value is an instance of a measurement from a specific source. Measurements can be associated with many state values, each representing a different source for the measurement.The current state for a measurement. A state value is an instance of a measurement from a specific source. Measurements can be associated with many state values, each representing a different source for the measurement. + """ + + def __init__(self, sensorAccuracy=0.0, timeStamp='', GmlValues=None, MeasurementValueQuality=None, ProcedureDataSets=None, MeasurementValueSource=None, ErpPerson=None, RemoteSource=None, *args, **kw_args): + """Initialises a new 'MeasurementValue' instance. + + @param sensorAccuracy: The limit, expressed as a percentage of the sensor maximum, that errors will not exceed when the sensor is used under reference conditions. + @param timeStamp: The time when the value was last updated + @param GmlValues: + @param MeasurementValueQuality: A MeasurementValue has a MeasurementValueQuality associated with it. + @param ProcedureDataSets: + @param MeasurementValueSource: A reference to the type of source that updates the MeasurementValue, e.g. SCADA, CCLink, manual, etc. User conventions for the names of sources are contained in the introduction to IEC 61970-301. + @param ErpPerson: + @param RemoteSource: Link to the physical telemetered point associated with this measurement. + """ + #: The limit, expressed as a percentage of the sensor maximum, that errors will not exceed when the sensor is used under reference conditions. + self.sensorAccuracy = sensorAccuracy + + #: The time when the value was last updated + self.timeStamp = timeStamp + + self._GmlValues = [] + self.GmlValues = [] if GmlValues is None else GmlValues + + self._MeasurementValueQuality = None + self.MeasurementValueQuality = MeasurementValueQuality + + self._ProcedureDataSets = [] + self.ProcedureDataSets = [] if ProcedureDataSets is None else ProcedureDataSets + + self._MeasurementValueSource = None + self.MeasurementValueSource = MeasurementValueSource + + self._ErpPerson = None + self.ErpPerson = ErpPerson + + self._RemoteSource = None + self.RemoteSource = RemoteSource + + super(MeasurementValue, self).__init__(*args, **kw_args) + + _attrs = ["sensorAccuracy", "timeStamp"] + _attr_types = {"sensorAccuracy": float, "timeStamp": str} + _defaults = {"sensorAccuracy": 0.0, "timeStamp": ''} + _enums = {} + _refs = ["GmlValues", "MeasurementValueQuality", "ProcedureDataSets", "MeasurementValueSource", "ErpPerson", "RemoteSource"] + _many_refs = ["GmlValues", "ProcedureDataSets"] + + def getGmlValues(self): + + return self._GmlValues + + def setGmlValues(self, value): + for x in self._GmlValues: + x.MeasurementValue = None + for y in value: + y._MeasurementValue = self + self._GmlValues = value + + GmlValues = property(getGmlValues, setGmlValues) + + def addGmlValues(self, *GmlValues): + for obj in GmlValues: + obj.MeasurementValue = self + + def removeGmlValues(self, *GmlValues): + for obj in GmlValues: + obj.MeasurementValue = None + + def getMeasurementValueQuality(self): + """A MeasurementValue has a MeasurementValueQuality associated with it. + """ + return self._MeasurementValueQuality + + def setMeasurementValueQuality(self, value): + if self._MeasurementValueQuality is not None: + self._MeasurementValueQuality._MeasurementValue = None + + self._MeasurementValueQuality = value + if self._MeasurementValueQuality is not None: + self._MeasurementValueQuality.MeasurementValue = None + self._MeasurementValueQuality._MeasurementValue = self + + MeasurementValueQuality = property(getMeasurementValueQuality, setMeasurementValueQuality) + + def getProcedureDataSets(self): + + return self._ProcedureDataSets + + def setProcedureDataSets(self, value): + for p in self._ProcedureDataSets: + filtered = [q for q in p.MeasurementValues if q != self] + self._ProcedureDataSets._MeasurementValues = filtered + for r in value: + if self not in r._MeasurementValues: + r._MeasurementValues.append(self) + self._ProcedureDataSets = value + + ProcedureDataSets = property(getProcedureDataSets, setProcedureDataSets) + + def addProcedureDataSets(self, *ProcedureDataSets): + for obj in ProcedureDataSets: + if self not in obj._MeasurementValues: + obj._MeasurementValues.append(self) + self._ProcedureDataSets.append(obj) + + def removeProcedureDataSets(self, *ProcedureDataSets): + for obj in ProcedureDataSets: + if self in obj._MeasurementValues: + obj._MeasurementValues.remove(self) + self._ProcedureDataSets.remove(obj) + + def getMeasurementValueSource(self): + """A reference to the type of source that updates the MeasurementValue, e.g. SCADA, CCLink, manual, etc. User conventions for the names of sources are contained in the introduction to IEC 61970-301. + """ + return self._MeasurementValueSource + + def setMeasurementValueSource(self, value): + if self._MeasurementValueSource is not None: + filtered = [x for x in self.MeasurementValueSource.MeasurementValues if x != self] + self._MeasurementValueSource._MeasurementValues = filtered + + self._MeasurementValueSource = value + if self._MeasurementValueSource is not None: + if self not in self._MeasurementValueSource._MeasurementValues: + self._MeasurementValueSource._MeasurementValues.append(self) + + MeasurementValueSource = property(getMeasurementValueSource, setMeasurementValueSource) + + def getErpPerson(self): + + return self._ErpPerson + + def setErpPerson(self, value): + if self._ErpPerson is not None: + filtered = [x for x in self.ErpPerson.MeasurementValues if x != self] + self._ErpPerson._MeasurementValues = filtered + + self._ErpPerson = value + if self._ErpPerson is not None: + if self not in self._ErpPerson._MeasurementValues: + self._ErpPerson._MeasurementValues.append(self) + + ErpPerson = property(getErpPerson, setErpPerson) + + def getRemoteSource(self): + """Link to the physical telemetered point associated with this measurement. + """ + return self._RemoteSource + + def setRemoteSource(self, value): + if self._RemoteSource is not None: + self._RemoteSource._MeasurementValue = None + + self._RemoteSource = value + if self._RemoteSource is not None: + self._RemoteSource.MeasurementValue = None + self._RemoteSource._MeasurementValue = self + + RemoteSource = property(getRemoteSource, setRemoteSource) + diff --git a/CIM16/IEC61970/Meas/MeasurementValueQuality.py b/CIM16/IEC61970/Meas/MeasurementValueQuality.py new file mode 100755 index 00000000..4b9e0dfb --- /dev/null +++ b/CIM16/IEC61970/Meas/MeasurementValueQuality.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.Quality61850 import Quality61850 + +class MeasurementValueQuality(Quality61850): + """Measurement quality flags. Bits 0-10 are defined for substation automation in draft IEC 61850 part 7-3. Bits 11-15 are reserved for future expansion by that document. Bits 16-31 are reserved for EMS applications.Measurement quality flags. Bits 0-10 are defined for substation automation in draft IEC 61850 part 7-3. Bits 11-15 are reserved for future expansion by that document. Bits 16-31 are reserved for EMS applications. + """ + + def __init__(self, MeasurementValue=None, *args, **kw_args): + """Initialises a new 'MeasurementValueQuality' instance. + + @param MeasurementValue: A MeasurementValue has a MeasurementValueQuality associated with it. + """ + self._MeasurementValue = None + self.MeasurementValue = MeasurementValue + + super(MeasurementValueQuality, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["MeasurementValue"] + _many_refs = [] + + def getMeasurementValue(self): + """A MeasurementValue has a MeasurementValueQuality associated with it. + """ + return self._MeasurementValue + + def setMeasurementValue(self, value): + if self._MeasurementValue is not None: + self._MeasurementValue._MeasurementValueQuality = None + + self._MeasurementValue = value + if self._MeasurementValue is not None: + self._MeasurementValue.MeasurementValueQuality = None + self._MeasurementValue._MeasurementValueQuality = self + + MeasurementValue = property(getMeasurementValue, setMeasurementValue) + diff --git a/CIM16/IEC61970/Meas/MeasurementValueSource.py b/CIM16/IEC61970/Meas/MeasurementValueSource.py new file mode 100755 index 00000000..bd441e7e --- /dev/null +++ b/CIM16/IEC61970/Meas/MeasurementValueSource.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class MeasurementValueSource(IdentifiedObject): + """MeasurementValueSource describes the alternative sources updating a MeasurementValue. User conventions for how to use the MeasurementValueSource attributes are described in the introduction to IEC 61970-301.MeasurementValueSource describes the alternative sources updating a MeasurementValue. User conventions for how to use the MeasurementValueSource attributes are described in the introduction to IEC 61970-301. + """ + + def __init__(self, MeasurementValues=None, *args, **kw_args): + """Initialises a new 'MeasurementValueSource' instance. + + @param MeasurementValues: The MeasurementValues updated by the source + """ + self._MeasurementValues = [] + self.MeasurementValues = [] if MeasurementValues is None else MeasurementValues + + super(MeasurementValueSource, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["MeasurementValues"] + _many_refs = ["MeasurementValues"] + + def getMeasurementValues(self): + """The MeasurementValues updated by the source + """ + return self._MeasurementValues + + def setMeasurementValues(self, value): + for x in self._MeasurementValues: + x.MeasurementValueSource = None + for y in value: + y._MeasurementValueSource = self + self._MeasurementValues = value + + MeasurementValues = property(getMeasurementValues, setMeasurementValues) + + def addMeasurementValues(self, *MeasurementValues): + for obj in MeasurementValues: + obj.MeasurementValueSource = self + + def removeMeasurementValues(self, *MeasurementValues): + for obj in MeasurementValues: + obj.MeasurementValueSource = None + diff --git a/CIM16/IEC61970/Meas/Quality61850.py b/CIM16/IEC61970/Meas/Quality61850.py new file mode 100755 index 00000000..d7781044 --- /dev/null +++ b/CIM16/IEC61970/Meas/Quality61850.py @@ -0,0 +1,87 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class Quality61850(Element): + """Quality flags in this class are as defined in IEC 61850, except for estimatorReplaced, which has been included in this class for convenience.Quality flags in this class are as defined in IEC 61850, except for estimatorReplaced, which has been included in this class for convenience. + """ + + def __init__(self, overFlow=False, estimatorReplaced=False, validity="QUESTIONABLE", operatorBlocked=False, oldData=False, failure=False, source="SUBSTITUTED", outOfRange=False, badReference=False, suspect=False, test=False, oscillatory=False, *args, **kw_args): + """Initialises a new 'Quality61850' instance. + + @param overFlow: Measurement value is beyond the capability of being represented properly. For example, a counter value overflows from maximum count back to a value of zero. + @param estimatorReplaced: Value has been replaced by State Estimator. estimatorReplaced is not an IEC61850 quality bit but has been put in this class for convenience. + @param validity: Validity of the measurement value. Values are: "QUESTIONABLE", "INVALID", "GOOD" + @param operatorBlocked: Measurement value is blocked and hence unavailable for transmission. + @param oldData: Measurement value is old and possibly invalid, as it has not been successfully updated during a specified time interval. + @param failure: This identifier indicates that a supervision function has detected an internal or external failure, e.g. communication failure. + @param source: Source gives information related to the origin of a value. The value may be acquired from the process, defaulted or substituted. Values are: "SUBSTITUTED", "DEFAULTED", "PROCESS" + @param outOfRange: Measurement value is beyond a predefined range of value. + @param badReference: Measurement value may be incorrect due to a reference being out of calibration. + @param suspect: A correlation function has detected that the value is not consitent with other values. Typically set by a network State Estimator. + @param test: Measurement value is transmitted for test purposes. + @param oscillatory: To prevent some overload of the communication it is sensible to detect and suppress oscillating (fast changing) binary inputs. If a signal changes in a defined time (tosc) twice in the same direction (from 0 to 1 or from 1 to 0) then oscillation is detected and the detail quality identifier 'oscillatory' is set. If it is detected a configured numbers of transient changes could be passed by. In this time the validity status 'questionable' is set. If after this defined numbers of changes the signal is still in the oscillating state the value shall be set either to the opposite state of the previous stable value or to a defined default value. In this case the validity status 'questionable' is reset and 'invalid' is set as long as the signal is oscillating. If it is configured such that no transient changes should be passed by then the validity status 'invalid' is set immediately in addition to the detail quality identifier 'oscillatory' (used for status information only). + """ + #: Measurement value is beyond the capability of being represented properly. For example, a counter value overflows from maximum count back to a value of zero. + self.overFlow = overFlow + + #: Value has been replaced by State Estimator. estimatorReplaced is not an IEC61850 quality bit but has been put in this class for convenience. + self.estimatorReplaced = estimatorReplaced + + #: Validity of the measurement value. Values are: "QUESTIONABLE", "INVALID", "GOOD" + self.validity = validity + + #: Measurement value is blocked and hence unavailable for transmission. + self.operatorBlocked = operatorBlocked + + #: Measurement value is old and possibly invalid, as it has not been successfully updated during a specified time interval. + self.oldData = oldData + + #: This identifier indicates that a supervision function has detected an internal or external failure, e.g. communication failure. + self.failure = failure + + #: Source gives information related to the origin of a value. The value may be acquired from the process, defaulted or substituted. Values are: "SUBSTITUTED", "DEFAULTED", "PROCESS" + self.source = source + + #: Measurement value is beyond a predefined range of value. + self.outOfRange = outOfRange + + #: Measurement value may be incorrect due to a reference being out of calibration. + self.badReference = badReference + + #: A correlation function has detected that the value is not consitent with other values. Typically set by a network State Estimator. + self.suspect = suspect + + #: Measurement value is transmitted for test purposes. + self.test = test + + #: To prevent some overload of the communication it is sensible to detect and suppress oscillating (fast changing) binary inputs. If a signal changes in a defined time (tosc) twice in the same direction (from 0 to 1 or from 1 to 0) then oscillation is detected and the detail quality identifier 'oscillatory' is set. If it is detected a configured numbers of transient changes could be passed by. In this time the validity status 'questionable' is set. If after this defined numbers of changes the signal is still in the oscillating state the value shall be set either to the opposite state of the previous stable value or to a defined default value. In this case the validity status 'questionable' is reset and 'invalid' is set as long as the signal is oscillating. If it is configured such that no transient changes should be passed by then the validity status 'invalid' is set immediately in addition to the detail quality identifier 'oscillatory' (used for status information only). + self.oscillatory = oscillatory + + super(Quality61850, self).__init__(*args, **kw_args) + + _attrs = ["overFlow", "estimatorReplaced", "validity", "operatorBlocked", "oldData", "failure", "source", "outOfRange", "badReference", "suspect", "test", "oscillatory"] + _attr_types = {"overFlow": bool, "estimatorReplaced": bool, "validity": str, "operatorBlocked": bool, "oldData": bool, "failure": bool, "source": str, "outOfRange": bool, "badReference": bool, "suspect": bool, "test": bool, "oscillatory": bool} + _defaults = {"overFlow": False, "estimatorReplaced": False, "validity": "QUESTIONABLE", "operatorBlocked": False, "oldData": False, "failure": False, "source": "SUBSTITUTED", "outOfRange": False, "badReference": False, "suspect": False, "test": False, "oscillatory": False} + _enums = {"validity": "Validity", "source": "Source"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Meas/SetPoint.py b/CIM16/IEC61970/Meas/SetPoint.py new file mode 100755 index 00000000..ea57c4ff --- /dev/null +++ b/CIM16/IEC61970/Meas/SetPoint.py @@ -0,0 +1,75 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.Control import Control + +class SetPoint(Control): + """A SetPoint is an analog control used for supervisory control.A SetPoint is an analog control used for supervisory control. + """ + + def __init__(self, maxValue=0.0, minValue=0.0, normalValue=0.0, value=0.0, Analog=None, *args, **kw_args): + """Initialises a new 'SetPoint' instance. + + @param maxValue: Normal value range maximum for any of the Control.value. Used for scaling, e.g. in bar graphs. + @param minValue: Normal value range minimum for any of the Control.value. Used for scaling, e.g. in bar graphs. + @param normalValue: Normal value for Control.value e.g. used for percentage scaling + @param value: The value representing the actuator output + @param Analog: The Measurement variable used for control + """ + #: Normal value range maximum for any of the Control.value. Used for scaling, e.g. in bar graphs. + self.maxValue = maxValue + + #: Normal value range minimum for any of the Control.value. Used for scaling, e.g. in bar graphs. + self.minValue = minValue + + #: Normal value for Control.value e.g. used for percentage scaling + self.normalValue = normalValue + + #: The value representing the actuator output + self.value = value + + self._Analog = None + self.Analog = Analog + + super(SetPoint, self).__init__(*args, **kw_args) + + _attrs = ["maxValue", "minValue", "normalValue", "value"] + _attr_types = {"maxValue": float, "minValue": float, "normalValue": float, "value": float} + _defaults = {"maxValue": 0.0, "minValue": 0.0, "normalValue": 0.0, "value": 0.0} + _enums = {} + _refs = ["Analog"] + _many_refs = [] + + def getAnalog(self): + """The Measurement variable used for control + """ + return self._Analog + + def setAnalog(self, value): + if self._Analog is not None: + self._Analog._SetPoint = None + + self._Analog = value + if self._Analog is not None: + self._Analog.SetPoint = None + self._Analog._SetPoint = self + + Analog = property(getAnalog, setAnalog) + diff --git a/CIM16/IEC61970/Meas/StringMeasurement.py b/CIM16/IEC61970/Meas/StringMeasurement.py new file mode 100755 index 00000000..eae7f0e7 --- /dev/null +++ b/CIM16/IEC61970/Meas/StringMeasurement.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.Measurement import Measurement + +class StringMeasurement(Measurement): + """StringMeasurement represents a measurement with values of type string.StringMeasurement represents a measurement with values of type string. + """ + + def __init__(self, StringMeasurementValues=None, *args, **kw_args): + """Initialises a new 'StringMeasurement' instance. + + @param StringMeasurementValues: The values connected to this measurement. + """ + self._StringMeasurementValues = [] + self.StringMeasurementValues = [] if StringMeasurementValues is None else StringMeasurementValues + + super(StringMeasurement, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["StringMeasurementValues"] + _many_refs = ["StringMeasurementValues"] + + def getStringMeasurementValues(self): + """The values connected to this measurement. + """ + return self._StringMeasurementValues + + def setStringMeasurementValues(self, value): + for x in self._StringMeasurementValues: + x.StringMeasurement = None + for y in value: + y._StringMeasurement = self + self._StringMeasurementValues = value + + StringMeasurementValues = property(getStringMeasurementValues, setStringMeasurementValues) + + def addStringMeasurementValues(self, *StringMeasurementValues): + for obj in StringMeasurementValues: + obj.StringMeasurement = self + + def removeStringMeasurementValues(self, *StringMeasurementValues): + for obj in StringMeasurementValues: + obj.StringMeasurement = None + diff --git a/CIM16/IEC61970/Meas/StringMeasurementValue.py b/CIM16/IEC61970/Meas/StringMeasurementValue.py new file mode 100755 index 00000000..4564eca1 --- /dev/null +++ b/CIM16/IEC61970/Meas/StringMeasurementValue.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.MeasurementValue import MeasurementValue + +class StringMeasurementValue(MeasurementValue): + """StringMeasurementValue represents a measurement value of type string.StringMeasurementValue represents a measurement value of type string. + """ + + def __init__(self, value='', StringMeasurement=None, *args, **kw_args): + """Initialises a new 'StringMeasurementValue' instance. + + @param value: The value to supervise. + @param StringMeasurement: Measurement to which this value is connected. + """ + #: The value to supervise. + self.value = value + + self._StringMeasurement = None + self.StringMeasurement = StringMeasurement + + super(StringMeasurementValue, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": str} + _defaults = {"value": ''} + _enums = {} + _refs = ["StringMeasurement"] + _many_refs = [] + + def getStringMeasurement(self): + """Measurement to which this value is connected. + """ + return self._StringMeasurement + + def setStringMeasurement(self, value): + if self._StringMeasurement is not None: + filtered = [x for x in self.StringMeasurement.StringMeasurementValues if x != self] + self._StringMeasurement._StringMeasurementValues = filtered + + self._StringMeasurement = value + if self._StringMeasurement is not None: + if self not in self._StringMeasurement._StringMeasurementValues: + self._StringMeasurement._StringMeasurementValues.append(self) + + StringMeasurement = property(getStringMeasurement, setStringMeasurement) + diff --git a/CIM16/IEC61970/Meas/ValueAliasSet.py b/CIM16/IEC61970/Meas/ValueAliasSet.py new file mode 100755 index 00000000..cee9a2ec --- /dev/null +++ b/CIM16/IEC61970/Meas/ValueAliasSet.py @@ -0,0 +1,117 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ValueAliasSet(IdentifiedObject): + """Describes the translation of a set of values into a name and is intendend to facilitate cusom translations. Each ValueAliasSet has a name, description etc. A specific Measurement may represent a discrete state like Open, Closed, Intermediate etc. This requires a translation from the MeasurementValue.value number to a string, e.g. 0->'Invalid', 1->'Open', 2->'Closed', 3->'Intermediate'. Each ValueToAlias member in ValueAliasSet.Value describe a mapping for one particular value to a name.Describes the translation of a set of values into a name and is intendend to facilitate cusom translations. Each ValueAliasSet has a name, description etc. A specific Measurement may represent a discrete state like Open, Closed, Intermediate etc. This requires a translation from the MeasurementValue.value number to a string, e.g. 0->'Invalid', 1->'Open', 2->'Closed', 3->'Intermediate'. Each ValueToAlias member in ValueAliasSet.Value describe a mapping for one particular value to a name. + """ + + def __init__(self, Discretes=None, Commands=None, Values=None, *args, **kw_args): + """Initialises a new 'ValueAliasSet' instance. + + @param Discretes: The Measurements using the set for translation + @param Commands: The ValueAliasSet used for translation of a Control value to a name. + @param Values: The ValueToAlias mappings included in the set + """ + self._Discretes = [] + self.Discretes = [] if Discretes is None else Discretes + + self._Commands = [] + self.Commands = [] if Commands is None else Commands + + self._Values = [] + self.Values = [] if Values is None else Values + + super(ValueAliasSet, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Discretes", "Commands", "Values"] + _many_refs = ["Discretes", "Commands", "Values"] + + def getDiscretes(self): + """The Measurements using the set for translation + """ + return self._Discretes + + def setDiscretes(self, value): + for x in self._Discretes: + x.ValueAliasSet = None + for y in value: + y._ValueAliasSet = self + self._Discretes = value + + Discretes = property(getDiscretes, setDiscretes) + + def addDiscretes(self, *Discretes): + for obj in Discretes: + obj.ValueAliasSet = self + + def removeDiscretes(self, *Discretes): + for obj in Discretes: + obj.ValueAliasSet = None + + def getCommands(self): + """The ValueAliasSet used for translation of a Control value to a name. + """ + return self._Commands + + def setCommands(self, value): + for x in self._Commands: + x.ValueAliasSet = None + for y in value: + y._ValueAliasSet = self + self._Commands = value + + Commands = property(getCommands, setCommands) + + def addCommands(self, *Commands): + for obj in Commands: + obj.ValueAliasSet = self + + def removeCommands(self, *Commands): + for obj in Commands: + obj.ValueAliasSet = None + + def getValues(self): + """The ValueToAlias mappings included in the set + """ + return self._Values + + def setValues(self, value): + for x in self._Values: + x.ValueAliasSet = None + for y in value: + y._ValueAliasSet = self + self._Values = value + + Values = property(getValues, setValues) + + def addValues(self, *Values): + for obj in Values: + obj.ValueAliasSet = self + + def removeValues(self, *Values): + for obj in Values: + obj.ValueAliasSet = None + diff --git a/CIM16/IEC61970/Meas/ValueToAlias.py b/CIM16/IEC61970/Meas/ValueToAlias.py new file mode 100755 index 00000000..5a45c01e --- /dev/null +++ b/CIM16/IEC61970/Meas/ValueToAlias.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ValueToAlias(IdentifiedObject): + """Describes the translation of one particular value into a name, e.g. 1->'Open'Describes the translation of one particular value into a name, e.g. 1->'Open' + """ + + def __init__(self, value=0, ValueAliasSet=None, *args, **kw_args): + """Initialises a new 'ValueToAlias' instance. + + @param value: The value that is mapped + @param ValueAliasSet: The ValueAliasSet having the ValueToAlias mappings + """ + #: The value that is mapped + self.value = value + + self._ValueAliasSet = None + self.ValueAliasSet = ValueAliasSet + + super(ValueToAlias, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": int} + _defaults = {"value": 0} + _enums = {} + _refs = ["ValueAliasSet"] + _many_refs = [] + + def getValueAliasSet(self): + """The ValueAliasSet having the ValueToAlias mappings + """ + return self._ValueAliasSet + + def setValueAliasSet(self, value): + if self._ValueAliasSet is not None: + filtered = [x for x in self.ValueAliasSet.Values if x != self] + self._ValueAliasSet._Values = filtered + + self._ValueAliasSet = value + if self._ValueAliasSet is not None: + if self not in self._ValueAliasSet._Values: + self._ValueAliasSet._Values.append(self) + + ValueAliasSet = property(getValueAliasSet, setValueAliasSet) + diff --git a/CIM16/IEC61970/Meas/__init__.py b/CIM16/IEC61970/Meas/__init__.py new file mode 100755 index 00000000..f37e6fa0 --- /dev/null +++ b/CIM16/IEC61970/Meas/__init__.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""Contains entities that describe dynamic measurement data exchanged between applications. +""" + +from CIM16.IEC61970.Meas.AccumulatorLimit import AccumulatorLimit +from CIM16.IEC61970.Meas.ValueToAlias import ValueToAlias +from CIM16.IEC61970.Meas.MeasurementValueSource import MeasurementValueSource +from CIM16.IEC61970.Meas.Analog import Analog +from CIM16.IEC61970.Meas.AnalogValue import AnalogValue +from CIM16.IEC61970.Meas.Measurement import Measurement +from CIM16.IEC61970.Meas.ControlType import ControlType +from CIM16.IEC61970.Meas.StringMeasurementValue import StringMeasurementValue +from CIM16.IEC61970.Meas.StringMeasurement import StringMeasurement +from CIM16.IEC61970.Meas.AnalogLimit import AnalogLimit +from CIM16.IEC61970.Meas.SetPoint import SetPoint +from CIM16.IEC61970.Meas.Limit import Limit +from CIM16.IEC61970.Meas.Discrete import Discrete +from CIM16.IEC61970.Meas.ValueAliasSet import ValueAliasSet +from CIM16.IEC61970.Meas.Quality61850 import Quality61850 +from CIM16.IEC61970.Meas.AccumulatorValue import AccumulatorValue +from CIM16.IEC61970.Meas.Command import Command +from CIM16.IEC61970.Meas.Accumulator import Accumulator +from CIM16.IEC61970.Meas.MeasurementValueQuality import MeasurementValueQuality +from CIM16.IEC61970.Meas.MeasurementValue import MeasurementValue +from CIM16.IEC61970.Meas.DiscreteValue import DiscreteValue +from CIM16.IEC61970.Meas.AnalogLimitSet import AnalogLimitSet +from CIM16.IEC61970.Meas.LimitSet import LimitSet +from CIM16.IEC61970.Meas.AccumulatorLimitSet import AccumulatorLimitSet +from CIM16.IEC61970.Meas.Control import Control + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Meas" +nsPrefix = "cimMeas" + + +class Validity(str): + """Values are: QUESTIONABLE, INVALID, GOOD + """ + pass diff --git a/CIM16/IEC61970/OperationalLimits/ActivePowerLimit.py b/CIM16/IEC61970/OperationalLimits/ActivePowerLimit.py new file mode 100755 index 00000000..88e00cf4 --- /dev/null +++ b/CIM16/IEC61970/OperationalLimits/ActivePowerLimit.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.OperationalLimits.OperationalLimit import OperationalLimit + +class ActivePowerLimit(OperationalLimit): + """Limit on active power flow.Limit on active power flow. + """ + + def __init__(self, value=0.0, ActivePowerLimitSet=None, *args, **kw_args): + """Initialises a new 'ActivePowerLimit' instance. + + @param value: Value of active power limit. + @param ActivePowerLimitSet: + """ + #: Value of active power limit. + self.value = value + + self._ActivePowerLimitSet = None + self.ActivePowerLimitSet = ActivePowerLimitSet + + super(ActivePowerLimit, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": float} + _defaults = {"value": 0.0} + _enums = {} + _refs = ["ActivePowerLimitSet"] + _many_refs = [] + + def getActivePowerLimitSet(self): + + return self._ActivePowerLimitSet + + def setActivePowerLimitSet(self, value): + if self._ActivePowerLimitSet is not None: + filtered = [x for x in self.ActivePowerLimitSet.ActivePowerLimits if x != self] + self._ActivePowerLimitSet._ActivePowerLimits = filtered + + self._ActivePowerLimitSet = value + if self._ActivePowerLimitSet is not None: + if self not in self._ActivePowerLimitSet._ActivePowerLimits: + self._ActivePowerLimitSet._ActivePowerLimits.append(self) + + ActivePowerLimitSet = property(getActivePowerLimitSet, setActivePowerLimitSet) + diff --git a/CIM16/IEC61970/OperationalLimits/ActivePowerLimitSet.py b/CIM16/IEC61970/OperationalLimits/ActivePowerLimitSet.py new file mode 100755 index 00000000..b151a3cb --- /dev/null +++ b/CIM16/IEC61970/OperationalLimits/ActivePowerLimitSet.py @@ -0,0 +1,62 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.OperationalLimits.OperationalLimitSet import OperationalLimitSet + +class ActivePowerLimitSet(OperationalLimitSet): + + def __init__(self, ActivePowerLimits=None, *args, **kw_args): + """Initialises a new 'ActivePowerLimitSet' instance. + + @param ActivePowerLimits: + """ + self._ActivePowerLimits = [] + self.ActivePowerLimits = [] if ActivePowerLimits is None else ActivePowerLimits + + super(ActivePowerLimitSet, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ActivePowerLimits"] + _many_refs = ["ActivePowerLimits"] + + def getActivePowerLimits(self): + + return self._ActivePowerLimits + + def setActivePowerLimits(self, value): + for x in self._ActivePowerLimits: + x.ActivePowerLimitSet = None + for y in value: + y._ActivePowerLimitSet = self + self._ActivePowerLimits = value + + ActivePowerLimits = property(getActivePowerLimits, setActivePowerLimits) + + def addActivePowerLimits(self, *ActivePowerLimits): + for obj in ActivePowerLimits: + obj.ActivePowerLimitSet = self + + def removeActivePowerLimits(self, *ActivePowerLimits): + for obj in ActivePowerLimits: + obj.ActivePowerLimitSet = None + diff --git a/CIM16/IEC61970/OperationalLimits/ApparentPowerLimit.py b/CIM16/IEC61970/OperationalLimits/ApparentPowerLimit.py new file mode 100755 index 00000000..1d6d6bc7 --- /dev/null +++ b/CIM16/IEC61970/OperationalLimits/ApparentPowerLimit.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.OperationalLimits.OperationalLimit import OperationalLimit + +class ApparentPowerLimit(OperationalLimit): + """Apparent power limit.Apparent power limit. + """ + + def __init__(self, value=0.0, ApparentPowerLimitSet=None, *args, **kw_args): + """Initialises a new 'ApparentPowerLimit' instance. + + @param value: The apparent power limit. + @param ApparentPowerLimitSet: + """ + #: The apparent power limit. + self.value = value + + self._ApparentPowerLimitSet = None + self.ApparentPowerLimitSet = ApparentPowerLimitSet + + super(ApparentPowerLimit, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": float} + _defaults = {"value": 0.0} + _enums = {} + _refs = ["ApparentPowerLimitSet"] + _many_refs = [] + + def getApparentPowerLimitSet(self): + + return self._ApparentPowerLimitSet + + def setApparentPowerLimitSet(self, value): + if self._ApparentPowerLimitSet is not None: + filtered = [x for x in self.ApparentPowerLimitSet.ApparentPowerLimits if x != self] + self._ApparentPowerLimitSet._ApparentPowerLimits = filtered + + self._ApparentPowerLimitSet = value + if self._ApparentPowerLimitSet is not None: + if self not in self._ApparentPowerLimitSet._ApparentPowerLimits: + self._ApparentPowerLimitSet._ApparentPowerLimits.append(self) + + ApparentPowerLimitSet = property(getApparentPowerLimitSet, setApparentPowerLimitSet) + diff --git a/CIM16/IEC61970/OperationalLimits/ApparentPowerLimitSet.py b/CIM16/IEC61970/OperationalLimits/ApparentPowerLimitSet.py new file mode 100755 index 00000000..ad581d2e --- /dev/null +++ b/CIM16/IEC61970/OperationalLimits/ApparentPowerLimitSet.py @@ -0,0 +1,62 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.OperationalLimits.OperationalLimitSet import OperationalLimitSet + +class ApparentPowerLimitSet(OperationalLimitSet): + + def __init__(self, ApparentPowerLimits=None, *args, **kw_args): + """Initialises a new 'ApparentPowerLimitSet' instance. + + @param ApparentPowerLimits: + """ + self._ApparentPowerLimits = [] + self.ApparentPowerLimits = [] if ApparentPowerLimits is None else ApparentPowerLimits + + super(ApparentPowerLimitSet, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ApparentPowerLimits"] + _many_refs = ["ApparentPowerLimits"] + + def getApparentPowerLimits(self): + + return self._ApparentPowerLimits + + def setApparentPowerLimits(self, value): + for x in self._ApparentPowerLimits: + x.ApparentPowerLimitSet = None + for y in value: + y._ApparentPowerLimitSet = self + self._ApparentPowerLimits = value + + ApparentPowerLimits = property(getApparentPowerLimits, setApparentPowerLimits) + + def addApparentPowerLimits(self, *ApparentPowerLimits): + for obj in ApparentPowerLimits: + obj.ApparentPowerLimitSet = self + + def removeApparentPowerLimits(self, *ApparentPowerLimits): + for obj in ApparentPowerLimits: + obj.ApparentPowerLimitSet = None + diff --git a/CIM16/IEC61970/OperationalLimits/BranchGroup.py b/CIM16/IEC61970/OperationalLimits/BranchGroup.py new file mode 100755 index 00000000..ed73baef --- /dev/null +++ b/CIM16/IEC61970/OperationalLimits/BranchGroup.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class BranchGroup(IdentifiedObject): + """A group of branch terminals whose directed flow summation is to be monitored. Abranch group need not form a cutset of the network.A group of branch terminals whose directed flow summation is to be monitored. Abranch group need not form a cutset of the network. + """ + + def __init__(self, minimumReactivePower=0.0, maximumReactivePower=0.0, maximumActivePower=0.0, minimumActivePower=0.0, monitorActivePower=False, monitorReactivePower=False, BranchGroupTerminal=None, *args, **kw_args): + """Initialises a new 'BranchGroup' instance. + + @param minimumReactivePower: The minimum reactive power flow. + @param maximumReactivePower: The maximum reactive power flow. + @param maximumActivePower: The maximum active power flow. + @param minimumActivePower: The minimum active power flow. + @param monitorActivePower: Monitor the active power flow. + @param monitorReactivePower: Monitor the reactive power flow. + @param BranchGroupTerminal: The directed branch group terminals to be summed. + """ + #: The minimum reactive power flow. + self.minimumReactivePower = minimumReactivePower + + #: The maximum reactive power flow. + self.maximumReactivePower = maximumReactivePower + + #: The maximum active power flow. + self.maximumActivePower = maximumActivePower + + #: The minimum active power flow. + self.minimumActivePower = minimumActivePower + + #: Monitor the active power flow. + self.monitorActivePower = monitorActivePower + + #: Monitor the reactive power flow. + self.monitorReactivePower = monitorReactivePower + + self._BranchGroupTerminal = [] + self.BranchGroupTerminal = [] if BranchGroupTerminal is None else BranchGroupTerminal + + super(BranchGroup, self).__init__(*args, **kw_args) + + _attrs = ["minimumReactivePower", "maximumReactivePower", "maximumActivePower", "minimumActivePower", "monitorActivePower", "monitorReactivePower"] + _attr_types = {"minimumReactivePower": float, "maximumReactivePower": float, "maximumActivePower": float, "minimumActivePower": float, "monitorActivePower": bool, "monitorReactivePower": bool} + _defaults = {"minimumReactivePower": 0.0, "maximumReactivePower": 0.0, "maximumActivePower": 0.0, "minimumActivePower": 0.0, "monitorActivePower": False, "monitorReactivePower": False} + _enums = {} + _refs = ["BranchGroupTerminal"] + _many_refs = ["BranchGroupTerminal"] + + def getBranchGroupTerminal(self): + """The directed branch group terminals to be summed. + """ + return self._BranchGroupTerminal + + def setBranchGroupTerminal(self, value): + for x in self._BranchGroupTerminal: + x.BranchGroup = None + for y in value: + y._BranchGroup = self + self._BranchGroupTerminal = value + + BranchGroupTerminal = property(getBranchGroupTerminal, setBranchGroupTerminal) + + def addBranchGroupTerminal(self, *BranchGroupTerminal): + for obj in BranchGroupTerminal: + obj.BranchGroup = self + + def removeBranchGroupTerminal(self, *BranchGroupTerminal): + for obj in BranchGroupTerminal: + obj.BranchGroup = None + diff --git a/CIM16/IEC61970/OperationalLimits/BranchGroupTerminal.py b/CIM16/IEC61970/OperationalLimits/BranchGroupTerminal.py new file mode 100755 index 00000000..b5d8a7b6 --- /dev/null +++ b/CIM16/IEC61970/OperationalLimits/BranchGroupTerminal.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class BranchGroupTerminal(Element): + """A specific directed terminal flow for a branch group.A specific directed terminal flow for a branch group. + """ + + def __init__(self, positiveFlowIn=False, BranchGroup=None, Terminal=None, *args, **kw_args): + """Initialises a new 'BranchGroupTerminal' instance. + + @param positiveFlowIn: The flow into the terminal is summed if set true. The flow out of the terminanl is summed if set false. + @param BranchGroup: The branch group to which the directed branch group terminals belong. + @param Terminal: The terminal to be summed. + """ + #: The flow into the terminal is summed if set true. The flow out of the terminanl is summed if set false. + self.positiveFlowIn = positiveFlowIn + + self._BranchGroup = None + self.BranchGroup = BranchGroup + + self._Terminal = None + self.Terminal = Terminal + + super(BranchGroupTerminal, self).__init__(*args, **kw_args) + + _attrs = ["positiveFlowIn"] + _attr_types = {"positiveFlowIn": bool} + _defaults = {"positiveFlowIn": False} + _enums = {} + _refs = ["BranchGroup", "Terminal"] + _many_refs = [] + + def getBranchGroup(self): + """The branch group to which the directed branch group terminals belong. + """ + return self._BranchGroup + + def setBranchGroup(self, value): + if self._BranchGroup is not None: + filtered = [x for x in self.BranchGroup.BranchGroupTerminal if x != self] + self._BranchGroup._BranchGroupTerminal = filtered + + self._BranchGroup = value + if self._BranchGroup is not None: + if self not in self._BranchGroup._BranchGroupTerminal: + self._BranchGroup._BranchGroupTerminal.append(self) + + BranchGroup = property(getBranchGroup, setBranchGroup) + + def getTerminal(self): + """The terminal to be summed. + """ + return self._Terminal + + def setTerminal(self, value): + if self._Terminal is not None: + filtered = [x for x in self.Terminal.BranchGroupTerminal if x != self] + self._Terminal._BranchGroupTerminal = filtered + + self._Terminal = value + if self._Terminal is not None: + if self not in self._Terminal._BranchGroupTerminal: + self._Terminal._BranchGroupTerminal.append(self) + + Terminal = property(getTerminal, setTerminal) + diff --git a/CIM16/IEC61970/OperationalLimits/CurrentLimit.py b/CIM16/IEC61970/OperationalLimits/CurrentLimit.py new file mode 100755 index 00000000..918b411d --- /dev/null +++ b/CIM16/IEC61970/OperationalLimits/CurrentLimit.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.OperationalLimits.OperationalLimit import OperationalLimit + +class CurrentLimit(OperationalLimit): + """Operational limit on current.Operational limit on current. + """ + + def __init__(self, value=0.0, CurrentLimitSet=None, *args, **kw_args): + """Initialises a new 'CurrentLimit' instance. + + @param value: Limit on current flow. + @param CurrentLimitSet: + """ + #: Limit on current flow. + self.value = value + + self._CurrentLimitSet = None + self.CurrentLimitSet = CurrentLimitSet + + super(CurrentLimit, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": float} + _defaults = {"value": 0.0} + _enums = {} + _refs = ["CurrentLimitSet"] + _many_refs = [] + + def getCurrentLimitSet(self): + + return self._CurrentLimitSet + + def setCurrentLimitSet(self, value): + if self._CurrentLimitSet is not None: + filtered = [x for x in self.CurrentLimitSet.CurrentLimits if x != self] + self._CurrentLimitSet._CurrentLimits = filtered + + self._CurrentLimitSet = value + if self._CurrentLimitSet is not None: + if self not in self._CurrentLimitSet._CurrentLimits: + self._CurrentLimitSet._CurrentLimits.append(self) + + CurrentLimitSet = property(getCurrentLimitSet, setCurrentLimitSet) + diff --git a/CIM16/IEC61970/OperationalLimits/CurrentLimitSet.py b/CIM16/IEC61970/OperationalLimits/CurrentLimitSet.py new file mode 100755 index 00000000..1f07823c --- /dev/null +++ b/CIM16/IEC61970/OperationalLimits/CurrentLimitSet.py @@ -0,0 +1,62 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.OperationalLimits.OperationalLimitSet import OperationalLimitSet + +class CurrentLimitSet(OperationalLimitSet): + + def __init__(self, CurrentLimits=None, *args, **kw_args): + """Initialises a new 'CurrentLimitSet' instance. + + @param CurrentLimits: + """ + self._CurrentLimits = [] + self.CurrentLimits = [] if CurrentLimits is None else CurrentLimits + + super(CurrentLimitSet, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["CurrentLimits"] + _many_refs = ["CurrentLimits"] + + def getCurrentLimits(self): + + return self._CurrentLimits + + def setCurrentLimits(self, value): + for x in self._CurrentLimits: + x.CurrentLimitSet = None + for y in value: + y._CurrentLimitSet = self + self._CurrentLimits = value + + CurrentLimits = property(getCurrentLimits, setCurrentLimits) + + def addCurrentLimits(self, *CurrentLimits): + for obj in CurrentLimits: + obj.CurrentLimitSet = self + + def removeCurrentLimits(self, *CurrentLimits): + for obj in CurrentLimits: + obj.CurrentLimitSet = None + diff --git a/CIM16/IEC61970/OperationalLimits/OperationalLimit.py b/CIM16/IEC61970/OperationalLimits/OperationalLimit.py new file mode 100755 index 00000000..719df496 --- /dev/null +++ b/CIM16/IEC61970/OperationalLimits/OperationalLimit.py @@ -0,0 +1,81 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class OperationalLimit(IdentifiedObject): + """A value associated with a specific kind of limit.A value associated with a specific kind of limit. + """ + + def __init__(self, OperationalLimitType=None, OperationalLimitSet=None, *args, **kw_args): + """Initialises a new 'OperationalLimit' instance. + + @param OperationalLimitType: The limit type associated with this limit. + @param OperationalLimitSet: The limit set to which the limit values belong. + """ + self._OperationalLimitType = None + self.OperationalLimitType = OperationalLimitType + + self._OperationalLimitSet = None + self.OperationalLimitSet = OperationalLimitSet + + super(OperationalLimit, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["OperationalLimitType", "OperationalLimitSet"] + _many_refs = [] + + def getOperationalLimitType(self): + """The limit type associated with this limit. + """ + return self._OperationalLimitType + + def setOperationalLimitType(self, value): + if self._OperationalLimitType is not None: + filtered = [x for x in self.OperationalLimitType.OperationalLimit if x != self] + self._OperationalLimitType._OperationalLimit = filtered + + self._OperationalLimitType = value + if self._OperationalLimitType is not None: + if self not in self._OperationalLimitType._OperationalLimit: + self._OperationalLimitType._OperationalLimit.append(self) + + OperationalLimitType = property(getOperationalLimitType, setOperationalLimitType) + + def getOperationalLimitSet(self): + """The limit set to which the limit values belong. + """ + return self._OperationalLimitSet + + def setOperationalLimitSet(self, value): + if self._OperationalLimitSet is not None: + filtered = [x for x in self.OperationalLimitSet.OperationalLimitValue if x != self] + self._OperationalLimitSet._OperationalLimitValue = filtered + + self._OperationalLimitSet = value + if self._OperationalLimitSet is not None: + if self not in self._OperationalLimitSet._OperationalLimitValue: + self._OperationalLimitSet._OperationalLimitValue.append(self) + + OperationalLimitSet = property(getOperationalLimitSet, setOperationalLimitSet) + diff --git a/CIM16/IEC61970/OperationalLimits/OperationalLimitSet.py b/CIM16/IEC61970/OperationalLimits/OperationalLimitSet.py new file mode 100755 index 00000000..aaab3665 --- /dev/null +++ b/CIM16/IEC61970/OperationalLimits/OperationalLimitSet.py @@ -0,0 +1,86 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class OperationalLimitSet(IdentifiedObject): + """A set of limits associated with equipmnet. Sets of limits might apply to a specific temperature, or season for example. A set of limits may contain may different severities of limit levels that would apply to the same equipment. The set may contain limits of different types such as apparent power and current limits or high and low voltage limits that are logically applied together as a set.A set of limits associated with equipmnet. Sets of limits might apply to a specific temperature, or season for example. A set of limits may contain may different severities of limit levels that would apply to the same equipment. The set may contain limits of different types such as apparent power and current limits or high and low voltage limits that are logically applied together as a set. + """ + + def __init__(self, Terminal=None, OperationalLimitValue=None, *args, **kw_args): + """Initialises a new 'OperationalLimitSet' instance. + + @param Terminal: The terminal specifically associated to this operational limit set. If no terminal is associated, all terminals of the equipment are implied. + @param OperationalLimitValue: Values of equipment limits. + """ + self._Terminal = None + self.Terminal = Terminal + + self._OperationalLimitValue = [] + self.OperationalLimitValue = [] if OperationalLimitValue is None else OperationalLimitValue + + super(OperationalLimitSet, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Terminal", "OperationalLimitValue"] + _many_refs = ["OperationalLimitValue"] + + def getTerminal(self): + """The terminal specifically associated to this operational limit set. If no terminal is associated, all terminals of the equipment are implied. + """ + return self._Terminal + + def setTerminal(self, value): + if self._Terminal is not None: + filtered = [x for x in self.Terminal.OperationalLimitSet if x != self] + self._Terminal._OperationalLimitSet = filtered + + self._Terminal = value + if self._Terminal is not None: + if self not in self._Terminal._OperationalLimitSet: + self._Terminal._OperationalLimitSet.append(self) + + Terminal = property(getTerminal, setTerminal) + + def getOperationalLimitValue(self): + """Values of equipment limits. + """ + return self._OperationalLimitValue + + def setOperationalLimitValue(self, value): + for x in self._OperationalLimitValue: + x.OperationalLimitSet = None + for y in value: + y._OperationalLimitSet = self + self._OperationalLimitValue = value + + OperationalLimitValue = property(getOperationalLimitValue, setOperationalLimitValue) + + def addOperationalLimitValue(self, *OperationalLimitValue): + for obj in OperationalLimitValue: + obj.OperationalLimitSet = self + + def removeOperationalLimitValue(self, *OperationalLimitValue): + for obj in OperationalLimitValue: + obj.OperationalLimitSet = None + diff --git a/CIM16/IEC61970/OperationalLimits/OperationalLimitType.py b/CIM16/IEC61970/OperationalLimits/OperationalLimitType.py new file mode 100755 index 00000000..78ecafdd --- /dev/null +++ b/CIM16/IEC61970/OperationalLimits/OperationalLimitType.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class OperationalLimitType(IdentifiedObject): + """A type of limit. The meaning of a specific limit is described in this class.A type of limit. The meaning of a specific limit is described in this class. + """ + + def __init__(self, direction="low", acceptableDuration=0.0, OperationalLimit=None, *args, **kw_args): + """Initialises a new 'OperationalLimitType' instance. + + @param direction: The direction of the limit. Values are: "low", "high", "absoluteValue" + @param acceptableDuration: The nominal acceptable duration of the limit. Limits are commonly expressed in terms of the a time limit for which the limit is normally acceptable. The actual acceptable duration of a specific limit may depend on other local factors such as temperature or wind speed. + @param OperationalLimit: The operational limits associated with this type of limit. + """ + #: The direction of the limit. Values are: "low", "high", "absoluteValue" + self.direction = direction + + #: The nominal acceptable duration of the limit. Limits are commonly expressed in terms of the a time limit for which the limit is normally acceptable. The actual acceptable duration of a specific limit may depend on other local factors such as temperature or wind speed. + self.acceptableDuration = acceptableDuration + + self._OperationalLimit = [] + self.OperationalLimit = [] if OperationalLimit is None else OperationalLimit + + super(OperationalLimitType, self).__init__(*args, **kw_args) + + _attrs = ["direction", "acceptableDuration"] + _attr_types = {"direction": str, "acceptableDuration": float} + _defaults = {"direction": "low", "acceptableDuration": 0.0} + _enums = {"direction": "OperationalLimitDirectionKind"} + _refs = ["OperationalLimit"] + _many_refs = ["OperationalLimit"] + + def getOperationalLimit(self): + """The operational limits associated with this type of limit. + """ + return self._OperationalLimit + + def setOperationalLimit(self, value): + for x in self._OperationalLimit: + x.OperationalLimitType = None + for y in value: + y._OperationalLimitType = self + self._OperationalLimit = value + + OperationalLimit = property(getOperationalLimit, setOperationalLimit) + + def addOperationalLimit(self, *OperationalLimit): + for obj in OperationalLimit: + obj.OperationalLimitType = self + + def removeOperationalLimit(self, *OperationalLimit): + for obj in OperationalLimit: + obj.OperationalLimitType = None + diff --git a/CIM16/IEC61970/OperationalLimits/VoltageLimit.py b/CIM16/IEC61970/OperationalLimits/VoltageLimit.py new file mode 100755 index 00000000..c0d067e8 --- /dev/null +++ b/CIM16/IEC61970/OperationalLimits/VoltageLimit.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.OperationalLimits.OperationalLimit import OperationalLimit + +class VoltageLimit(OperationalLimit): + """Operational limit applied to voltage.Operational limit applied to voltage. + """ + + def __init__(self, value=0.0, VoltageLimitSet=None, *args, **kw_args): + """Initialises a new 'VoltageLimit' instance. + + @param value: Limit on voltage. High or low limit depends on the OperatoinalLimit.limitKind + @param VoltageLimitSet: + """ + #: Limit on voltage. High or low limit depends on the OperatoinalLimit.limitKind + self.value = value + + self._VoltageLimitSet = None + self.VoltageLimitSet = VoltageLimitSet + + super(VoltageLimit, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": float} + _defaults = {"value": 0.0} + _enums = {} + _refs = ["VoltageLimitSet"] + _many_refs = [] + + def getVoltageLimitSet(self): + + return self._VoltageLimitSet + + def setVoltageLimitSet(self, value): + if self._VoltageLimitSet is not None: + filtered = [x for x in self.VoltageLimitSet.VoltageLimits if x != self] + self._VoltageLimitSet._VoltageLimits = filtered + + self._VoltageLimitSet = value + if self._VoltageLimitSet is not None: + if self not in self._VoltageLimitSet._VoltageLimits: + self._VoltageLimitSet._VoltageLimits.append(self) + + VoltageLimitSet = property(getVoltageLimitSet, setVoltageLimitSet) + diff --git a/CIM16/IEC61970/OperationalLimits/VoltageLimitSet.py b/CIM16/IEC61970/OperationalLimits/VoltageLimitSet.py new file mode 100755 index 00000000..d17f3c96 --- /dev/null +++ b/CIM16/IEC61970/OperationalLimits/VoltageLimitSet.py @@ -0,0 +1,62 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.OperationalLimits.OperationalLimitSet import OperationalLimitSet + +class VoltageLimitSet(OperationalLimitSet): + + def __init__(self, VoltageLimits=None, *args, **kw_args): + """Initialises a new 'VoltageLimitSet' instance. + + @param VoltageLimits: + """ + self._VoltageLimits = [] + self.VoltageLimits = [] if VoltageLimits is None else VoltageLimits + + super(VoltageLimitSet, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["VoltageLimits"] + _many_refs = ["VoltageLimits"] + + def getVoltageLimits(self): + + return self._VoltageLimits + + def setVoltageLimits(self, value): + for x in self._VoltageLimits: + x.VoltageLimitSet = None + for y in value: + y._VoltageLimitSet = self + self._VoltageLimits = value + + VoltageLimits = property(getVoltageLimits, setVoltageLimits) + + def addVoltageLimits(self, *VoltageLimits): + for obj in VoltageLimits: + obj.VoltageLimitSet = self + + def removeVoltageLimits(self, *VoltageLimits): + for obj in VoltageLimits: + obj.VoltageLimitSet = None + diff --git a/CIM16/IEC61970/OperationalLimits/__init__.py b/CIM16/IEC61970/OperationalLimits/__init__.py new file mode 100755 index 00000000..d6ff272c --- /dev/null +++ b/CIM16/IEC61970/OperationalLimits/__init__.py @@ -0,0 +1,45 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The OperationalLimits package models a specification of limits associated with equipment and other operational entities. +""" + +from CIM16.IEC61970.OperationalLimits.ApparentPowerLimit import ApparentPowerLimit +from CIM16.IEC61970.OperationalLimits.ActivePowerLimit import ActivePowerLimit +from CIM16.IEC61970.OperationalLimits.OperationalLimitType import OperationalLimitType +from CIM16.IEC61970.OperationalLimits.BranchGroup import BranchGroup +from CIM16.IEC61970.OperationalLimits.OperationalLimitSet import OperationalLimitSet +from CIM16.IEC61970.OperationalLimits.ActivePowerLimitSet import ActivePowerLimitSet +from CIM16.IEC61970.OperationalLimits.CurrentLimit import CurrentLimit +from CIM16.IEC61970.OperationalLimits.CurrentLimitSet import CurrentLimitSet +from CIM16.IEC61970.OperationalLimits.ApparentPowerLimitSet import ApparentPowerLimitSet +from CIM16.IEC61970.OperationalLimits.BranchGroupTerminal import BranchGroupTerminal +from CIM16.IEC61970.OperationalLimits.VoltageLimitSet import VoltageLimitSet +from CIM16.IEC61970.OperationalLimits.VoltageLimit import VoltageLimit +from CIM16.IEC61970.OperationalLimits.OperationalLimit import OperationalLimit + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#OperationalLimits" +nsPrefix = "cimOperationalLimits" + + +class OperationalLimitDirectionKind(str): + """Values are: low, high, absoluteValue + """ + pass diff --git a/CIM16/IEC61970/Outage/ClearanceTag.py b/CIM16/IEC61970/Outage/ClearanceTag.py new file mode 100755 index 00000000..130ae7ea --- /dev/null +++ b/CIM16/IEC61970/Outage/ClearanceTag.py @@ -0,0 +1,133 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ClearanceTag(IdentifiedObject): + """A clearance tag that is used to authorize and schedule work on conducting equipment in the field. Tagged equipment is not available for commercial service.A clearance tag that is used to authorize and schedule work on conducting equipment in the field. Tagged equipment is not available for commercial service. + """ + + def __init__(self, workStartTime='', phaseCheckReqFlag=False, deenergizeReqFlag=False, authorityName='', tagIssueTime='', groundReqFlag=False, workDescription='', workEndTime='', ConductingEquipment=None, SafetyDocument=None, ClearanceTagType=None, *args, **kw_args): + """Initialises a new 'ClearanceTag' instance. + + @param workStartTime: The time at which the clearance tag is scheduled to be set. + @param phaseCheckReqFlag: Set true if equipment phasing must be checked + @param deenergizeReqFlag: Set true if equipment must be deenergized + @param authorityName: The name of the person who is authorized to issue the tag + @param tagIssueTime: The time at which the clearance tag was issued + @param groundReqFlag: Set true if equipment must be grounded + @param workDescription: Description of the work to be performed + @param workEndTime: The time at which the clearance tag is scheduled to be removed + @param ConductingEquipment: Conducting equipment may have multiple clearance tags for authorized field work + @param SafetyDocument: + @param ClearanceTagType: The type of tag, depending on the purpose of the work to be performed and/or the type of supervisory control allowed. + """ + #: The time at which the clearance tag is scheduled to be set. + self.workStartTime = workStartTime + + #: Set true if equipment phasing must be checked + self.phaseCheckReqFlag = phaseCheckReqFlag + + #: Set true if equipment must be deenergized + self.deenergizeReqFlag = deenergizeReqFlag + + #: The name of the person who is authorized to issue the tag + self.authorityName = authorityName + + #: The time at which the clearance tag was issued + self.tagIssueTime = tagIssueTime + + #: Set true if equipment must be grounded + self.groundReqFlag = groundReqFlag + + #: Description of the work to be performed + self.workDescription = workDescription + + #: The time at which the clearance tag is scheduled to be removed + self.workEndTime = workEndTime + + self._ConductingEquipment = None + self.ConductingEquipment = ConductingEquipment + + self._SafetyDocument = None + self.SafetyDocument = SafetyDocument + + self._ClearanceTagType = None + self.ClearanceTagType = ClearanceTagType + + super(ClearanceTag, self).__init__(*args, **kw_args) + + _attrs = ["workStartTime", "phaseCheckReqFlag", "deenergizeReqFlag", "authorityName", "tagIssueTime", "groundReqFlag", "workDescription", "workEndTime"] + _attr_types = {"workStartTime": str, "phaseCheckReqFlag": bool, "deenergizeReqFlag": bool, "authorityName": str, "tagIssueTime": str, "groundReqFlag": bool, "workDescription": str, "workEndTime": str} + _defaults = {"workStartTime": '', "phaseCheckReqFlag": False, "deenergizeReqFlag": False, "authorityName": '', "tagIssueTime": '', "groundReqFlag": False, "workDescription": '', "workEndTime": ''} + _enums = {} + _refs = ["ConductingEquipment", "SafetyDocument", "ClearanceTagType"] + _many_refs = [] + + def getConductingEquipment(self): + """Conducting equipment may have multiple clearance tags for authorized field work + """ + return self._ConductingEquipment + + def setConductingEquipment(self, value): + if self._ConductingEquipment is not None: + filtered = [x for x in self.ConductingEquipment.ClearanceTags if x != self] + self._ConductingEquipment._ClearanceTags = filtered + + self._ConductingEquipment = value + if self._ConductingEquipment is not None: + if self not in self._ConductingEquipment._ClearanceTags: + self._ConductingEquipment._ClearanceTags.append(self) + + ConductingEquipment = property(getConductingEquipment, setConductingEquipment) + + def getSafetyDocument(self): + + return self._SafetyDocument + + def setSafetyDocument(self, value): + if self._SafetyDocument is not None: + filtered = [x for x in self.SafetyDocument.ClearanceTags if x != self] + self._SafetyDocument._ClearanceTags = filtered + + self._SafetyDocument = value + if self._SafetyDocument is not None: + if self not in self._SafetyDocument._ClearanceTags: + self._SafetyDocument._ClearanceTags.append(self) + + SafetyDocument = property(getSafetyDocument, setSafetyDocument) + + def getClearanceTagType(self): + """The type of tag, depending on the purpose of the work to be performed and/or the type of supervisory control allowed. + """ + return self._ClearanceTagType + + def setClearanceTagType(self, value): + if self._ClearanceTagType is not None: + filtered = [x for x in self.ClearanceTagType.ClearanceTags if x != self] + self._ClearanceTagType._ClearanceTags = filtered + + self._ClearanceTagType = value + if self._ClearanceTagType is not None: + if self not in self._ClearanceTagType._ClearanceTags: + self._ClearanceTagType._ClearanceTags.append(self) + + ClearanceTagType = property(getClearanceTagType, setClearanceTagType) + diff --git a/CIM16/IEC61970/Outage/ClearanceTagType.py b/CIM16/IEC61970/Outage/ClearanceTagType.py new file mode 100755 index 00000000..527db332 --- /dev/null +++ b/CIM16/IEC61970/Outage/ClearanceTagType.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ClearanceTagType(IdentifiedObject): + """Type of ClearanceTag. Could indicate the type of work to be performed and/or the type of supervisory control.Type of ClearanceTag. Could indicate the type of work to be performed and/or the type of supervisory control. + """ + + def __init__(self, ClearanceTags=None, *args, **kw_args): + """Initialises a new 'ClearanceTagType' instance. + + @param ClearanceTags: The ClearanceTags currently being defined for this type. + """ + self._ClearanceTags = [] + self.ClearanceTags = [] if ClearanceTags is None else ClearanceTags + + super(ClearanceTagType, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ClearanceTags"] + _many_refs = ["ClearanceTags"] + + def getClearanceTags(self): + """The ClearanceTags currently being defined for this type. + """ + return self._ClearanceTags + + def setClearanceTags(self, value): + for x in self._ClearanceTags: + x.ClearanceTagType = None + for y in value: + y._ClearanceTagType = self + self._ClearanceTags = value + + ClearanceTags = property(getClearanceTags, setClearanceTags) + + def addClearanceTags(self, *ClearanceTags): + for obj in ClearanceTags: + obj.ClearanceTagType = self + + def removeClearanceTags(self, *ClearanceTags): + for obj in ClearanceTags: + obj.ClearanceTagType = None + diff --git a/CIM16/IEC61970/Outage/OutageSchedule.py b/CIM16/IEC61970/Outage/OutageSchedule.py new file mode 100755 index 00000000..6415ba13 --- /dev/null +++ b/CIM16/IEC61970/Outage/OutageSchedule.py @@ -0,0 +1,105 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IrregularIntervalSchedule import IrregularIntervalSchedule + +class OutageSchedule(IrregularIntervalSchedule): + """The period of time that a piece of equipment is out of service, for example, for maintenance or testing; including the equipment's active power rating while under maintenance. The X-axis represents absolute time and the Y-axis represents the equipment's available rating while out of service.The period of time that a piece of equipment is out of service, for example, for maintenance or testing; including the equipment's active power rating while under maintenance. The X-axis represents absolute time and the Y-axis represents the equipment's available rating while out of service. + """ + + def __init__(self, PlannedOutage=None, SwitchingOperations=None, PowerSystemResource=None, *args, **kw_args): + """Initialises a new 'OutageSchedule' instance. + + @param PlannedOutage: + @param SwitchingOperations: An OutageSchedule may operate many switches. + @param PowerSystemResource: A power system resource may have an outage schedule + """ + self._PlannedOutage = None + self.PlannedOutage = PlannedOutage + + self._SwitchingOperations = [] + self.SwitchingOperations = [] if SwitchingOperations is None else SwitchingOperations + + self._PowerSystemResource = None + self.PowerSystemResource = PowerSystemResource + + super(OutageSchedule, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["PlannedOutage", "SwitchingOperations", "PowerSystemResource"] + _many_refs = ["SwitchingOperations"] + + def getPlannedOutage(self): + + return self._PlannedOutage + + def setPlannedOutage(self, value): + if self._PlannedOutage is not None: + filtered = [x for x in self.PlannedOutage.OutageSchedules if x != self] + self._PlannedOutage._OutageSchedules = filtered + + self._PlannedOutage = value + if self._PlannedOutage is not None: + if self not in self._PlannedOutage._OutageSchedules: + self._PlannedOutage._OutageSchedules.append(self) + + PlannedOutage = property(getPlannedOutage, setPlannedOutage) + + def getSwitchingOperations(self): + """An OutageSchedule may operate many switches. + """ + return self._SwitchingOperations + + def setSwitchingOperations(self, value): + for x in self._SwitchingOperations: + x.OutageSchedule = None + for y in value: + y._OutageSchedule = self + self._SwitchingOperations = value + + SwitchingOperations = property(getSwitchingOperations, setSwitchingOperations) + + def addSwitchingOperations(self, *SwitchingOperations): + for obj in SwitchingOperations: + obj.OutageSchedule = self + + def removeSwitchingOperations(self, *SwitchingOperations): + for obj in SwitchingOperations: + obj.OutageSchedule = None + + def getPowerSystemResource(self): + """A power system resource may have an outage schedule + """ + return self._PowerSystemResource + + def setPowerSystemResource(self, value): + if self._PowerSystemResource is not None: + self._PowerSystemResource._OutageSchedule = None + + self._PowerSystemResource = value + if self._PowerSystemResource is not None: + self._PowerSystemResource.OutageSchedule = None + self._PowerSystemResource._OutageSchedule = self + + PowerSystemResource = property(getPowerSystemResource, setPowerSystemResource) + diff --git a/CIM16/IEC61970/Outage/SwitchingOperation.py b/CIM16/IEC61970/Outage/SwitchingOperation.py new file mode 100755 index 00000000..fa91d82f --- /dev/null +++ b/CIM16/IEC61970/Outage/SwitchingOperation.py @@ -0,0 +1,100 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class SwitchingOperation(IdentifiedObject): + """A SwitchingOperation is used to define individual switch operations for an OutageSchedule. This OutageSchedule may be associated with another item of Substation such as a Transformer, Line, or Generator; or with the Switch itself as a PowerSystemResource. A Switch may be referenced by many OutageSchedules.A SwitchingOperation is used to define individual switch operations for an OutageSchedule. This OutageSchedule may be associated with another item of Substation such as a Transformer, Line, or Generator; or with the Switch itself as a PowerSystemResource. A Switch may be referenced by many OutageSchedules. + """ + + def __init__(self, operationTime='', newState="open", OutageSchedule=None, Switches=None, *args, **kw_args): + """Initialises a new 'SwitchingOperation' instance. + + @param operationTime: Time of operation in same units as OutageSchedule.xAxixUnits. + @param newState: The switch position that shall result from this SwitchingOperation Values are: "open", "close" + @param OutageSchedule: An OutageSchedule may operate many switches. + @param Switches: A switch may be operated by many schedules. + """ + #: Time of operation in same units as OutageSchedule.xAxixUnits. + self.operationTime = operationTime + + #: The switch position that shall result from this SwitchingOperation Values are: "open", "close" + self.newState = newState + + self._OutageSchedule = None + self.OutageSchedule = OutageSchedule + + self._Switches = [] + self.Switches = [] if Switches is None else Switches + + super(SwitchingOperation, self).__init__(*args, **kw_args) + + _attrs = ["operationTime", "newState"] + _attr_types = {"operationTime": str, "newState": str} + _defaults = {"operationTime": '', "newState": "open"} + _enums = {"newState": "SwitchState"} + _refs = ["OutageSchedule", "Switches"] + _many_refs = ["Switches"] + + def getOutageSchedule(self): + """An OutageSchedule may operate many switches. + """ + return self._OutageSchedule + + def setOutageSchedule(self, value): + if self._OutageSchedule is not None: + filtered = [x for x in self.OutageSchedule.SwitchingOperations if x != self] + self._OutageSchedule._SwitchingOperations = filtered + + self._OutageSchedule = value + if self._OutageSchedule is not None: + if self not in self._OutageSchedule._SwitchingOperations: + self._OutageSchedule._SwitchingOperations.append(self) + + OutageSchedule = property(getOutageSchedule, setOutageSchedule) + + def getSwitches(self): + """A switch may be operated by many schedules. + """ + return self._Switches + + def setSwitches(self, value): + for p in self._Switches: + filtered = [q for q in p.SwitchingOperations if q != self] + self._Switches._SwitchingOperations = filtered + for r in value: + if self not in r._SwitchingOperations: + r._SwitchingOperations.append(self) + self._Switches = value + + Switches = property(getSwitches, setSwitches) + + def addSwitches(self, *Switches): + for obj in Switches: + if self not in obj._SwitchingOperations: + obj._SwitchingOperations.append(self) + self._Switches.append(obj) + + def removeSwitches(self, *Switches): + for obj in Switches: + if self in obj._SwitchingOperations: + obj._SwitchingOperations.remove(self) + self._Switches.remove(obj) + diff --git a/CIM16/IEC61970/Outage/__init__.py b/CIM16/IEC61970/Outage/__init__.py new file mode 100755 index 00000000..7add7300 --- /dev/null +++ b/CIM16/IEC61970/Outage/__init__.py @@ -0,0 +1,36 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""An extension to the Core and Wires packages that models information on the current and planned network configuration. These entities are optional within typical network applications. +""" + +from CIM16.IEC61970.Outage.SwitchingOperation import SwitchingOperation +from CIM16.IEC61970.Outage.OutageSchedule import OutageSchedule +from CIM16.IEC61970.Outage.ClearanceTagType import ClearanceTagType +from CIM16.IEC61970.Outage.ClearanceTag import ClearanceTag + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Outage" +nsPrefix = "cimOutage" + + +class SwitchState(str): + """Values are: open, close + """ + pass diff --git a/CIM16/IEC61970/Protection/CurrentRelay.py b/CIM16/IEC61970/Protection/CurrentRelay.py new file mode 100755 index 00000000..19cb48fb --- /dev/null +++ b/CIM16/IEC61970/Protection/CurrentRelay.py @@ -0,0 +1,67 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Protection.ProtectionEquipment import ProtectionEquipment + +class CurrentRelay(ProtectionEquipment): + """A device that checks current flow values in any direction or designated directionA device that checks current flow values in any direction or designated direction + """ + + def __init__(self, currentLimit3=0.0, currentLimit2=0.0, currentLimit1=0.0, inverseTimeFlag=False, timeDelay3=0.0, timeDelay2=0.0, timeDelay1=0.0, *args, **kw_args): + """Initialises a new 'CurrentRelay' instance. + + @param currentLimit3: Current limit #3 for inverse time pickup + @param currentLimit2: Current limit #2 for inverse time pickup + @param currentLimit1: Current limit #1 for inverse time pickup + @param inverseTimeFlag: Set true if the current relay has inverse time characteristic. + @param timeDelay3: Inverse time delay #3 for current limit #3 + @param timeDelay2: Inverse time delay #2 for current limit #2 + @param timeDelay1: Inverse time delay #1 for current limit #1 + """ + #: Current limit #3 for inverse time pickup + self.currentLimit3 = currentLimit3 + + #: Current limit #2 for inverse time pickup + self.currentLimit2 = currentLimit2 + + #: Current limit #1 for inverse time pickup + self.currentLimit1 = currentLimit1 + + #: Set true if the current relay has inverse time characteristic. + self.inverseTimeFlag = inverseTimeFlag + + #: Inverse time delay #3 for current limit #3 + self.timeDelay3 = timeDelay3 + + #: Inverse time delay #2 for current limit #2 + self.timeDelay2 = timeDelay2 + + #: Inverse time delay #1 for current limit #1 + self.timeDelay1 = timeDelay1 + + super(CurrentRelay, self).__init__(*args, **kw_args) + + _attrs = ["currentLimit3", "currentLimit2", "currentLimit1", "inverseTimeFlag", "timeDelay3", "timeDelay2", "timeDelay1"] + _attr_types = {"currentLimit3": float, "currentLimit2": float, "currentLimit1": float, "inverseTimeFlag": bool, "timeDelay3": float, "timeDelay2": float, "timeDelay1": float} + _defaults = {"currentLimit3": 0.0, "currentLimit2": 0.0, "currentLimit1": 0.0, "inverseTimeFlag": False, "timeDelay3": 0.0, "timeDelay2": 0.0, "timeDelay1": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Protection/ProtectionEquipment.py b/CIM16/IEC61970/Protection/ProtectionEquipment.py new file mode 100755 index 00000000..f3e5d9fd --- /dev/null +++ b/CIM16/IEC61970/Protection/ProtectionEquipment.py @@ -0,0 +1,127 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Equipment import Equipment + +class ProtectionEquipment(Equipment): + """An electrical device designed to respond to input conditions in a prescribed manner and after specified conditions are met to cause contact operation or similar abrupt change in associated electric control circuits, or simply to display the detected condition. Protection equipment are associated with conducting equipment and usually operate circuit breakers.An electrical device designed to respond to input conditions in a prescribed manner and after specified conditions are met to cause contact operation or similar abrupt change in associated electric control circuits, or simply to display the detected condition. Protection equipment are associated with conducting equipment and usually operate circuit breakers. + """ + + def __init__(self, highLimit=0.0, powerDirectionFlag=False, lowLimit=0.0, unitSymbol="N", relayDelayTime=0.0, unitMultiplier="M", ConductingEquipments=None, ProtectedSwitches=None, *args, **kw_args): + """Initialises a new 'ProtectionEquipment' instance. + + @param highLimit: The maximum allowable value. + @param powerDirectionFlag: Direction same as positive active power flow value. + @param lowLimit: The minimum allowable value. + @param unitSymbol: The unit of measure of the value. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param relayDelayTime: The time delay from detection of abnormal conditions to relay operation. + @param unitMultiplier: The unit multiplier of the value. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param ConductingEquipments: Protection equipment may be used to protect specific Conducting Equipment. Multiple equipment may be protected or monitored by multiple protection equipment. + @param ProtectedSwitches: Protected switches operated by this ProtectionEquipment. + """ + #: The maximum allowable value. + self.highLimit = highLimit + + #: Direction same as positive active power flow value. + self.powerDirectionFlag = powerDirectionFlag + + #: The minimum allowable value. + self.lowLimit = lowLimit + + #: The unit of measure of the value. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.unitSymbol = unitSymbol + + #: The time delay from detection of abnormal conditions to relay operation. + self.relayDelayTime = relayDelayTime + + #: The unit multiplier of the value. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.unitMultiplier = unitMultiplier + + self._ConductingEquipments = [] + self.ConductingEquipments = [] if ConductingEquipments is None else ConductingEquipments + + self._ProtectedSwitches = [] + self.ProtectedSwitches = [] if ProtectedSwitches is None else ProtectedSwitches + + super(ProtectionEquipment, self).__init__(*args, **kw_args) + + _attrs = ["highLimit", "powerDirectionFlag", "lowLimit", "unitSymbol", "relayDelayTime", "unitMultiplier"] + _attr_types = {"highLimit": float, "powerDirectionFlag": bool, "lowLimit": float, "unitSymbol": str, "relayDelayTime": float, "unitMultiplier": str} + _defaults = {"highLimit": 0.0, "powerDirectionFlag": False, "lowLimit": 0.0, "unitSymbol": "N", "relayDelayTime": 0.0, "unitMultiplier": "M"} + _enums = {"unitSymbol": "UnitSymbol", "unitMultiplier": "UnitMultiplier"} + _refs = ["ConductingEquipments", "ProtectedSwitches"] + _many_refs = ["ConductingEquipments", "ProtectedSwitches"] + + def getConductingEquipments(self): + """Protection equipment may be used to protect specific Conducting Equipment. Multiple equipment may be protected or monitored by multiple protection equipment. + """ + return self._ConductingEquipments + + def setConductingEquipments(self, value): + for p in self._ConductingEquipments: + filtered = [q for q in p.ProtectionEquipments if q != self] + self._ConductingEquipments._ProtectionEquipments = filtered + for r in value: + if self not in r._ProtectionEquipments: + r._ProtectionEquipments.append(self) + self._ConductingEquipments = value + + ConductingEquipments = property(getConductingEquipments, setConductingEquipments) + + def addConductingEquipments(self, *ConductingEquipments): + for obj in ConductingEquipments: + if self not in obj._ProtectionEquipments: + obj._ProtectionEquipments.append(self) + self._ConductingEquipments.append(obj) + + def removeConductingEquipments(self, *ConductingEquipments): + for obj in ConductingEquipments: + if self in obj._ProtectionEquipments: + obj._ProtectionEquipments.remove(self) + self._ConductingEquipments.remove(obj) + + def getProtectedSwitches(self): + """Protected switches operated by this ProtectionEquipment. + """ + return self._ProtectedSwitches + + def setProtectedSwitches(self, value): + for p in self._ProtectedSwitches: + filtered = [q for q in p.ProtectionEquipments if q != self] + self._ProtectedSwitches._ProtectionEquipments = filtered + for r in value: + if self not in r._ProtectionEquipments: + r._ProtectionEquipments.append(self) + self._ProtectedSwitches = value + + ProtectedSwitches = property(getProtectedSwitches, setProtectedSwitches) + + def addProtectedSwitches(self, *ProtectedSwitches): + for obj in ProtectedSwitches: + if self not in obj._ProtectionEquipments: + obj._ProtectionEquipments.append(self) + self._ProtectedSwitches.append(obj) + + def removeProtectedSwitches(self, *ProtectedSwitches): + for obj in ProtectedSwitches: + if self in obj._ProtectionEquipments: + obj._ProtectionEquipments.remove(self) + self._ProtectedSwitches.remove(obj) + diff --git a/CIM16/IEC61970/Protection/RecloseSequence.py b/CIM16/IEC61970/Protection/RecloseSequence.py new file mode 100755 index 00000000..549c094a --- /dev/null +++ b/CIM16/IEC61970/Protection/RecloseSequence.py @@ -0,0 +1,68 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class RecloseSequence(IdentifiedObject): + """A reclose sequence (open and close) is defined for each possible reclosure of a breaker.A reclose sequence (open and close) is defined for each possible reclosure of a breaker. + """ + + def __init__(self, recloseStep=0, recloseDelay=0.0, ProtectedSwitch=None, *args, **kw_args): + """Initialises a new 'RecloseSequence' instance. + + @param recloseStep: Indicates the ordinal position of the reclose step relative to other steps in the sequence. + @param recloseDelay: Indicates the time lapse before the reclose step will execute a reclose. + @param ProtectedSwitch: A breaker may have zero or more automatic reclosures after a trip occurs. + """ + #: Indicates the ordinal position of the reclose step relative to other steps in the sequence. + self.recloseStep = recloseStep + + #: Indicates the time lapse before the reclose step will execute a reclose. + self.recloseDelay = recloseDelay + + self._ProtectedSwitch = None + self.ProtectedSwitch = ProtectedSwitch + + super(RecloseSequence, self).__init__(*args, **kw_args) + + _attrs = ["recloseStep", "recloseDelay"] + _attr_types = {"recloseStep": int, "recloseDelay": float} + _defaults = {"recloseStep": 0, "recloseDelay": 0.0} + _enums = {} + _refs = ["ProtectedSwitch"] + _many_refs = [] + + def getProtectedSwitch(self): + """A breaker may have zero or more automatic reclosures after a trip occurs. + """ + return self._ProtectedSwitch + + def setProtectedSwitch(self, value): + if self._ProtectedSwitch is not None: + filtered = [x for x in self.ProtectedSwitch.RecloseSequences if x != self] + self._ProtectedSwitch._RecloseSequences = filtered + + self._ProtectedSwitch = value + if self._ProtectedSwitch is not None: + if self not in self._ProtectedSwitch._RecloseSequences: + self._ProtectedSwitch._RecloseSequences.append(self) + + ProtectedSwitch = property(getProtectedSwitch, setProtectedSwitch) + diff --git a/CIM16/IEC61970/Protection/SynchrocheckRelay.py b/CIM16/IEC61970/Protection/SynchrocheckRelay.py new file mode 100755 index 00000000..608005ea --- /dev/null +++ b/CIM16/IEC61970/Protection/SynchrocheckRelay.py @@ -0,0 +1,51 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Protection.ProtectionEquipment import ProtectionEquipment + +class SynchrocheckRelay(ProtectionEquipment): + """A device that operates when two AC circuits are within the desired limits of frequency, phase angle, and voltage, to permit or to cause the paralleling of these two circuits. Used to prevent the paralleling of non-synchronous topological islands.A device that operates when two AC circuits are within the desired limits of frequency, phase angle, and voltage, to permit or to cause the paralleling of these two circuits. Used to prevent the paralleling of non-synchronous topological islands. + """ + + def __init__(self, maxFreqDiff=0.0, maxAngleDiff=0.0, maxVoltDiff=0.0, *args, **kw_args): + """Initialises a new 'SynchrocheckRelay' instance. + + @param maxFreqDiff: The maximum allowable frequency difference across the open device + @param maxAngleDiff: The maximum allowable voltage vector phase angle difference across the open device + @param maxVoltDiff: The maximum allowable difference voltage across the open device + """ + #: The maximum allowable frequency difference across the open device + self.maxFreqDiff = maxFreqDiff + + #: The maximum allowable voltage vector phase angle difference across the open device + self.maxAngleDiff = maxAngleDiff + + #: The maximum allowable difference voltage across the open device + self.maxVoltDiff = maxVoltDiff + + super(SynchrocheckRelay, self).__init__(*args, **kw_args) + + _attrs = ["maxFreqDiff", "maxAngleDiff", "maxVoltDiff"] + _attr_types = {"maxFreqDiff": float, "maxAngleDiff": float, "maxVoltDiff": float} + _defaults = {"maxFreqDiff": 0.0, "maxAngleDiff": 0.0, "maxVoltDiff": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Protection/__init__.py b/CIM16/IEC61970/Protection/__init__.py new file mode 100755 index 00000000..a42c7d57 --- /dev/null +++ b/CIM16/IEC61970/Protection/__init__.py @@ -0,0 +1,31 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""An extension to the Core and Wires packages that models information for protection equipment such as relays. These entities are used within training simulators and distribution network fault location applications. +""" + +from CIM16.IEC61970.Protection.RecloseSequence import RecloseSequence +from CIM16.IEC61970.Protection.SynchrocheckRelay import SynchrocheckRelay +from CIM16.IEC61970.Protection.CurrentRelay import CurrentRelay +from CIM16.IEC61970.Protection.ProtectionEquipment import ProtectionEquipment + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Protection" +nsPrefix = "cimProtection" + diff --git a/CIM16/IEC61970/SCADA/CommunicationLink.py b/CIM16/IEC61970/SCADA/CommunicationLink.py new file mode 100755 index 00000000..a07a0a7f --- /dev/null +++ b/CIM16/IEC61970/SCADA/CommunicationLink.py @@ -0,0 +1,71 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class CommunicationLink(PowerSystemResource): + """The connection to remote units is through one or more communication links. Reduntant links may exist. The CommunicationLink class inherit PowerSystemResource. The intention is to allow CommunicationLinks to have Measurements. These Measurements can be used to model link status as operational, out of service, unit failure etc.The connection to remote units is through one or more communication links. Reduntant links may exist. The CommunicationLink class inherit PowerSystemResource. The intention is to allow CommunicationLinks to have Measurements. These Measurements can be used to model link status as operational, out of service, unit failure etc. + """ + + def __init__(self, RemoteUnits=None, *args, **kw_args): + """Initialises a new 'CommunicationLink' instance. + + @param RemoteUnits: RTUs may be attached to communication links. + """ + self._RemoteUnits = [] + self.RemoteUnits = [] if RemoteUnits is None else RemoteUnits + + super(CommunicationLink, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["RemoteUnits"] + _many_refs = ["RemoteUnits"] + + def getRemoteUnits(self): + """RTUs may be attached to communication links. + """ + return self._RemoteUnits + + def setRemoteUnits(self, value): + for p in self._RemoteUnits: + filtered = [q for q in p.CommunicationLinks if q != self] + self._RemoteUnits._CommunicationLinks = filtered + for r in value: + if self not in r._CommunicationLinks: + r._CommunicationLinks.append(self) + self._RemoteUnits = value + + RemoteUnits = property(getRemoteUnits, setRemoteUnits) + + def addRemoteUnits(self, *RemoteUnits): + for obj in RemoteUnits: + if self not in obj._CommunicationLinks: + obj._CommunicationLinks.append(self) + self._RemoteUnits.append(obj) + + def removeRemoteUnits(self, *RemoteUnits): + for obj in RemoteUnits: + if self in obj._CommunicationLinks: + obj._CommunicationLinks.remove(self) + self._RemoteUnits.remove(obj) + diff --git a/CIM16/IEC61970/SCADA/RemoteControl.py b/CIM16/IEC61970/SCADA/RemoteControl.py new file mode 100755 index 00000000..f4ca6dcd --- /dev/null +++ b/CIM16/IEC61970/SCADA/RemoteControl.py @@ -0,0 +1,71 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.SCADA.RemotePoint import RemotePoint + +class RemoteControl(RemotePoint): + """Remote controls are ouputs that are sent by the remote unit to actuators in the process.Remote controls are ouputs that are sent by the remote unit to actuators in the process. + """ + + def __init__(self, actuatorMaximum=0.0, actuatorMinimum=0.0, remoteControlled=False, Control=None, *args, **kw_args): + """Initialises a new 'RemoteControl' instance. + + @param actuatorMaximum: The maximum set point value accepted by the remote control point. + @param actuatorMinimum: The minimum set point value accepted by the remote control point. + @param remoteControlled: Set to true if the actuator is remotely controlled. + @param Control: The Control for the RemoteControl point. + """ + #: The maximum set point value accepted by the remote control point. + self.actuatorMaximum = actuatorMaximum + + #: The minimum set point value accepted by the remote control point. + self.actuatorMinimum = actuatorMinimum + + #: Set to true if the actuator is remotely controlled. + self.remoteControlled = remoteControlled + + self._Control = None + self.Control = Control + + super(RemoteControl, self).__init__(*args, **kw_args) + + _attrs = ["actuatorMaximum", "actuatorMinimum", "remoteControlled"] + _attr_types = {"actuatorMaximum": float, "actuatorMinimum": float, "remoteControlled": bool} + _defaults = {"actuatorMaximum": 0.0, "actuatorMinimum": 0.0, "remoteControlled": False} + _enums = {} + _refs = ["Control"] + _many_refs = [] + + def getControl(self): + """The Control for the RemoteControl point. + """ + return self._Control + + def setControl(self, value): + if self._Control is not None: + self._Control._RemoteControl = None + + self._Control = value + if self._Control is not None: + self._Control.RemoteControl = None + self._Control._RemoteControl = self + + Control = property(getControl, setControl) + diff --git a/CIM16/IEC61970/SCADA/RemotePoint.py b/CIM16/IEC61970/SCADA/RemotePoint.py new file mode 100755 index 00000000..2a70c91b --- /dev/null +++ b/CIM16/IEC61970/SCADA/RemotePoint.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class RemotePoint(IdentifiedObject): + """For a RTU remote points correspond to telemetered values or control outputs. Other units (e.g. control centers) usually also contain calculated values.For a RTU remote points correspond to telemetered values or control outputs. Other units (e.g. control centers) usually also contain calculated values. + """ + + def __init__(self, RemoteUnit=None, *args, **kw_args): + """Initialises a new 'RemotePoint' instance. + + @param RemoteUnit: Remote unit this point belongs to. + """ + self._RemoteUnit = None + self.RemoteUnit = RemoteUnit + + super(RemotePoint, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["RemoteUnit"] + _many_refs = [] + + def getRemoteUnit(self): + """Remote unit this point belongs to. + """ + return self._RemoteUnit + + def setRemoteUnit(self, value): + if self._RemoteUnit is not None: + filtered = [x for x in self.RemoteUnit.RemotePoints if x != self] + self._RemoteUnit._RemotePoints = filtered + + self._RemoteUnit = value + if self._RemoteUnit is not None: + if self not in self._RemoteUnit._RemotePoints: + self._RemoteUnit._RemotePoints.append(self) + + RemoteUnit = property(getRemoteUnit, setRemoteUnit) + diff --git a/CIM16/IEC61970/SCADA/RemoteSource.py b/CIM16/IEC61970/SCADA/RemoteSource.py new file mode 100755 index 00000000..2f49d1a8 --- /dev/null +++ b/CIM16/IEC61970/SCADA/RemoteSource.py @@ -0,0 +1,75 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.SCADA.RemotePoint import RemotePoint + +class RemoteSource(RemotePoint): + """Remote sources are state variables that are telemetered or calculated within the remote unit.Remote sources are state variables that are telemetered or calculated within the remote unit. + """ + + def __init__(self, sensorMinimum=0.0, deadband=0.0, sensorMaximum=0.0, scanInterval=0.0, MeasurementValue=None, *args, **kw_args): + """Initialises a new 'RemoteSource' instance. + + @param sensorMinimum: The minimum value the telemetry item can return. + @param deadband: The smallest change in value to be reported. + @param sensorMaximum: The maximum value the telemetry item can return. + @param scanInterval: The time interval between scans. + @param MeasurementValue: Link to the physical telemetered point associated with this measurement. + """ + #: The minimum value the telemetry item can return. + self.sensorMinimum = sensorMinimum + + #: The smallest change in value to be reported. + self.deadband = deadband + + #: The maximum value the telemetry item can return. + self.sensorMaximum = sensorMaximum + + #: The time interval between scans. + self.scanInterval = scanInterval + + self._MeasurementValue = None + self.MeasurementValue = MeasurementValue + + super(RemoteSource, self).__init__(*args, **kw_args) + + _attrs = ["sensorMinimum", "deadband", "sensorMaximum", "scanInterval"] + _attr_types = {"sensorMinimum": float, "deadband": float, "sensorMaximum": float, "scanInterval": float} + _defaults = {"sensorMinimum": 0.0, "deadband": 0.0, "sensorMaximum": 0.0, "scanInterval": 0.0} + _enums = {} + _refs = ["MeasurementValue"] + _many_refs = [] + + def getMeasurementValue(self): + """Link to the physical telemetered point associated with this measurement. + """ + return self._MeasurementValue + + def setMeasurementValue(self, value): + if self._MeasurementValue is not None: + self._MeasurementValue._RemoteSource = None + + self._MeasurementValue = value + if self._MeasurementValue is not None: + self._MeasurementValue.RemoteSource = None + self._MeasurementValue._RemoteSource = self + + MeasurementValue = property(getMeasurementValue, setMeasurementValue) + diff --git a/CIM16/IEC61970/SCADA/RemoteUnit.py b/CIM16/IEC61970/SCADA/RemoteUnit.py new file mode 100755 index 00000000..5f863b6b --- /dev/null +++ b/CIM16/IEC61970/SCADA/RemoteUnit.py @@ -0,0 +1,101 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class RemoteUnit(PowerSystemResource): + """A remote unit can be a RTU, IED, substation control system, control center etc. The communication with the remote unit can be through various standard protocols (e.g. IEC 61870, IEC 61850) or non standard protocols (e.g. DNP, RP570 etc.). A remote unit contain remote data points that might be telemetered, collected or calculated. The RemoteUnit class inherit PowerSystemResource. The intention is to allow RemotUnits to have Measurements. These Measurements can be used to model unit status as operational, out of service, unit failure etc.A remote unit can be a RTU, IED, substation control system, control center etc. The communication with the remote unit can be through various standard protocols (e.g. IEC 61870, IEC 61850) or non standard protocols (e.g. DNP, RP570 etc.). A remote unit contain remote data points that might be telemetered, collected or calculated. The RemoteUnit class inherit PowerSystemResource. The intention is to allow RemotUnits to have Measurements. These Measurements can be used to model unit status as operational, out of service, unit failure etc. + """ + + def __init__(self, remoteUnitType="SubstationControlSystem", RemotePoints=None, CommunicationLinks=None, *args, **kw_args): + """Initialises a new 'RemoteUnit' instance. + + @param remoteUnitType: Type of remote unit. Values are: "SubstationControlSystem", "IED", "ControlCenter", "RTU" + @param RemotePoints: Remote points this Remote unit contains. + @param CommunicationLinks: RTUs may be attached to communication links. + """ + #: Type of remote unit. Values are: "SubstationControlSystem", "IED", "ControlCenter", "RTU" + self.remoteUnitType = remoteUnitType + + self._RemotePoints = [] + self.RemotePoints = [] if RemotePoints is None else RemotePoints + + self._CommunicationLinks = [] + self.CommunicationLinks = [] if CommunicationLinks is None else CommunicationLinks + + super(RemoteUnit, self).__init__(*args, **kw_args) + + _attrs = ["remoteUnitType"] + _attr_types = {"remoteUnitType": str} + _defaults = {"remoteUnitType": "SubstationControlSystem"} + _enums = {"remoteUnitType": "RemoteUnitType"} + _refs = ["RemotePoints", "CommunicationLinks"] + _many_refs = ["RemotePoints", "CommunicationLinks"] + + def getRemotePoints(self): + """Remote points this Remote unit contains. + """ + return self._RemotePoints + + def setRemotePoints(self, value): + for x in self._RemotePoints: + x.RemoteUnit = None + for y in value: + y._RemoteUnit = self + self._RemotePoints = value + + RemotePoints = property(getRemotePoints, setRemotePoints) + + def addRemotePoints(self, *RemotePoints): + for obj in RemotePoints: + obj.RemoteUnit = self + + def removeRemotePoints(self, *RemotePoints): + for obj in RemotePoints: + obj.RemoteUnit = None + + def getCommunicationLinks(self): + """RTUs may be attached to communication links. + """ + return self._CommunicationLinks + + def setCommunicationLinks(self, value): + for p in self._CommunicationLinks: + filtered = [q for q in p.RemoteUnits if q != self] + self._CommunicationLinks._RemoteUnits = filtered + for r in value: + if self not in r._RemoteUnits: + r._RemoteUnits.append(self) + self._CommunicationLinks = value + + CommunicationLinks = property(getCommunicationLinks, setCommunicationLinks) + + def addCommunicationLinks(self, *CommunicationLinks): + for obj in CommunicationLinks: + if self not in obj._RemoteUnits: + obj._RemoteUnits.append(self) + self._CommunicationLinks.append(obj) + + def removeCommunicationLinks(self, *CommunicationLinks): + for obj in CommunicationLinks: + if self in obj._RemoteUnits: + obj._RemoteUnits.remove(self) + self._CommunicationLinks.remove(obj) + diff --git a/CIM16/IEC61970/SCADA/__init__.py b/CIM16/IEC61970/SCADA/__init__.py new file mode 100755 index 00000000..278f4bd8 --- /dev/null +++ b/CIM16/IEC61970/SCADA/__init__.py @@ -0,0 +1,42 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""Contains entities to model information used by Supervisory Control and Data Acquisition (SCADA) applications. Supervisory control supports operator control of equipment, such as opening or closing a breaker. Data acquisition gathers telemetered data from various sources. The subtypes of the Telemetry entity deliberately match the UCA and IEC 61850 definitions. This package also supports alarm presentation but it is not expected to be used by other applications. +""" + +from CIM16.IEC61970.SCADA.RemoteSource import RemoteSource +from CIM16.IEC61970.SCADA.RemotePoint import RemotePoint +from CIM16.IEC61970.SCADA.RemoteUnit import RemoteUnit +from CIM16.IEC61970.SCADA.RemoteControl import RemoteControl +from CIM16.IEC61970.SCADA.CommunicationLink import CommunicationLink + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#SCADA" +nsPrefix = "cimSCADA" + + +class RemoteUnitType(str): + """Values are: SubstationControlSystem, IED, ControlCenter, RTU + """ + pass + +class Source(str): + """Values are: SUBSTITUTED, DEFAULTED, PROCESS + """ + pass diff --git a/CIM16/IEC61970/StateVariables/StateVariable.py b/CIM16/IEC61970/StateVariables/StateVariable.py new file mode 100755 index 00000000..f7870611 --- /dev/null +++ b/CIM16/IEC61970/StateVariables/StateVariable.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class StateVariable(Element): + """An abstract class for state variables.An abstract class for state variables. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'StateVariable' instance. + + """ + super(StateVariable, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/StateVariables/SvInjection.py b/CIM16/IEC61970/StateVariables/SvInjection.py new file mode 100755 index 00000000..6ead8edb --- /dev/null +++ b/CIM16/IEC61970/StateVariables/SvInjection.py @@ -0,0 +1,67 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.StateVariables.StateVariable import StateVariable + +class SvInjection(StateVariable): + """Injection state variable. Positive sign means flow into the TopologicalNode.Injection state variable. Positive sign means flow into the TopologicalNode. + """ + + def __init__(self, pNetInjection=0.0, qNetInjection=0.0, TopologicalNode=None, *args, **kw_args): + """Initialises a new 'SvInjection' instance. + + @param pNetInjection: The active power injected into the bus at this location. Positive sign means injection into the bus. + @param qNetInjection: The reactive power injected into the bus at this location. Positive sign means injection into the bus. + @param TopologicalNode: The topological node associated with the state injection. + """ + #: The active power injected into the bus at this location. Positive sign means injection into the bus. + self.pNetInjection = pNetInjection + + #: The reactive power injected into the bus at this location. Positive sign means injection into the bus. + self.qNetInjection = qNetInjection + + self._TopologicalNode = None + self.TopologicalNode = TopologicalNode + + super(SvInjection, self).__init__(*args, **kw_args) + + _attrs = ["pNetInjection", "qNetInjection"] + _attr_types = {"pNetInjection": float, "qNetInjection": float} + _defaults = {"pNetInjection": 0.0, "qNetInjection": 0.0} + _enums = {} + _refs = ["TopologicalNode"] + _many_refs = [] + + def getTopologicalNode(self): + """The topological node associated with the state injection. + """ + return self._TopologicalNode + + def setTopologicalNode(self, value): + if self._TopologicalNode is not None: + self._TopologicalNode._SvInjection = None + + self._TopologicalNode = value + if self._TopologicalNode is not None: + self._TopologicalNode.SvInjection = None + self._TopologicalNode._SvInjection = self + + TopologicalNode = property(getTopologicalNode, setTopologicalNode) + diff --git a/CIM16/IEC61970/StateVariables/SvPowerFlow.py b/CIM16/IEC61970/StateVariables/SvPowerFlow.py new file mode 100755 index 00000000..c5ae9b99 --- /dev/null +++ b/CIM16/IEC61970/StateVariables/SvPowerFlow.py @@ -0,0 +1,67 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.StateVariables.StateVariable import StateVariable + +class SvPowerFlow(StateVariable): + """State variable for power flow. Load convention is used for flow direction. This means flow out from the TopologicalNode into the equipment is positive.State variable for power flow. Load convention is used for flow direction. This means flow out from the TopologicalNode into the equipment is positive. + """ + + def __init__(self, p=0.0, q=0.0, Terminal=None, *args, **kw_args): + """Initialises a new 'SvPowerFlow' instance. + + @param p: The active power flow. Load sign convention is used, i.e. positive sign means flow out from a node. + @param q: The reactive power flow. Load sign convention is used, i.e. positive sign means flow out from a node. + @param Terminal: The terminal associated with the power flow state. + """ + #: The active power flow. Load sign convention is used, i.e. positive sign means flow out from a node. + self.p = p + + #: The reactive power flow. Load sign convention is used, i.e. positive sign means flow out from a node. + self.q = q + + self._Terminal = None + self.Terminal = Terminal + + super(SvPowerFlow, self).__init__(*args, **kw_args) + + _attrs = ["p", "q"] + _attr_types = {"p": float, "q": float} + _defaults = {"p": 0.0, "q": 0.0} + _enums = {} + _refs = ["Terminal"] + _many_refs = [] + + def getTerminal(self): + """The terminal associated with the power flow state. + """ + return self._Terminal + + def setTerminal(self, value): + if self._Terminal is not None: + self._Terminal._SvPowerFlow = None + + self._Terminal = value + if self._Terminal is not None: + self._Terminal.SvPowerFlow = None + self._Terminal._SvPowerFlow = self + + Terminal = property(getTerminal, setTerminal) + diff --git a/CIM16/IEC61970/StateVariables/SvShortCircuit.py b/CIM16/IEC61970/StateVariables/SvShortCircuit.py new file mode 100755 index 00000000..03941294 --- /dev/null +++ b/CIM16/IEC61970/StateVariables/SvShortCircuit.py @@ -0,0 +1,75 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.StateVariables.StateVariable import StateVariable + +class SvShortCircuit(StateVariable): + """State variable for short circuit.State variable for short circuit. + """ + + def __init__(self, sShortCircuit=0.0, r0PerR=0.0, x0PerX=0.0, xPerR=0.0, TopologicalNode=None, *args, **kw_args): + """Initialises a new 'SvShortCircuit' instance. + + @param sShortCircuit: The short circuit apparent power drawn at this node when faulted. + @param r0PerR: The ratio of zero sequence resistance to positive sequence resistance. + @param x0PerX: The ratio of zero sequence reactance per positive sequence reactance. + @param xPerR: Ratio of positive sequence reactance per postive sequence resistance. + @param TopologicalNode: The topological node associated with the short circuit state. + """ + #: The short circuit apparent power drawn at this node when faulted. + self.sShortCircuit = sShortCircuit + + #: The ratio of zero sequence resistance to positive sequence resistance. + self.r0PerR = r0PerR + + #: The ratio of zero sequence reactance per positive sequence reactance. + self.x0PerX = x0PerX + + #: Ratio of positive sequence reactance per postive sequence resistance. + self.xPerR = xPerR + + self._TopologicalNode = None + self.TopologicalNode = TopologicalNode + + super(SvShortCircuit, self).__init__(*args, **kw_args) + + _attrs = ["sShortCircuit", "r0PerR", "x0PerX", "xPerR"] + _attr_types = {"sShortCircuit": float, "r0PerR": float, "x0PerX": float, "xPerR": float} + _defaults = {"sShortCircuit": 0.0, "r0PerR": 0.0, "x0PerX": 0.0, "xPerR": 0.0} + _enums = {} + _refs = ["TopologicalNode"] + _many_refs = [] + + def getTopologicalNode(self): + """The topological node associated with the short circuit state. + """ + return self._TopologicalNode + + def setTopologicalNode(self, value): + if self._TopologicalNode is not None: + self._TopologicalNode._SvShortCircuit = None + + self._TopologicalNode = value + if self._TopologicalNode is not None: + self._TopologicalNode.SvShortCircuit = None + self._TopologicalNode._SvShortCircuit = self + + TopologicalNode = property(getTopologicalNode, setTopologicalNode) + diff --git a/CIM16/IEC61970/StateVariables/SvShuntCompensatorSections.py b/CIM16/IEC61970/StateVariables/SvShuntCompensatorSections.py new file mode 100755 index 00000000..0d6972a5 --- /dev/null +++ b/CIM16/IEC61970/StateVariables/SvShuntCompensatorSections.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.StateVariables.StateVariable import StateVariable + +class SvShuntCompensatorSections(StateVariable): + """State variable for the number of sections in service for a shunt compensator.State variable for the number of sections in service for a shunt compensator. + """ + + def __init__(self, sections=0.0, ShuntCompensator=None, *args, **kw_args): + """Initialises a new 'SvShuntCompensatorSections' instance. + + @param sections: The number of sections in service as a continous variable. To get integer value scale with ShuntCompensator.bPerSection. + @param ShuntCompensator: The shunt compensator for which the state applies. + """ + #: The number of sections in service as a continous variable. To get integer value scale with ShuntCompensator.bPerSection. + self.sections = sections + + self._ShuntCompensator = None + self.ShuntCompensator = ShuntCompensator + + super(SvShuntCompensatorSections, self).__init__(*args, **kw_args) + + _attrs = ["sections"] + _attr_types = {"sections": float} + _defaults = {"sections": 0.0} + _enums = {} + _refs = ["ShuntCompensator"] + _many_refs = [] + + def getShuntCompensator(self): + """The shunt compensator for which the state applies. + """ + return self._ShuntCompensator + + def setShuntCompensator(self, value): + if self._ShuntCompensator is not None: + self._ShuntCompensator._SvShuntCompensatorSections = None + + self._ShuntCompensator = value + if self._ShuntCompensator is not None: + self._ShuntCompensator.SvShuntCompensatorSections = None + self._ShuntCompensator._SvShuntCompensatorSections = self + + ShuntCompensator = property(getShuntCompensator, setShuntCompensator) + diff --git a/CIM16/IEC61970/StateVariables/SvStatus.py b/CIM16/IEC61970/StateVariables/SvStatus.py new file mode 100755 index 00000000..c04cf5c9 --- /dev/null +++ b/CIM16/IEC61970/StateVariables/SvStatus.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.StateVariables.StateVariable import StateVariable + +class SvStatus(StateVariable): + """State variable for status.State variable for status. + """ + + def __init__(self, inService=False, ConductingEquipment=None, *args, **kw_args): + """Initialises a new 'SvStatus' instance. + + @param inService: The in service status as a result of topology processing. + @param ConductingEquipment: The conducting equipment associated with the status state. + """ + #: The in service status as a result of topology processing. + self.inService = inService + + self._ConductingEquipment = None + self.ConductingEquipment = ConductingEquipment + + super(SvStatus, self).__init__(*args, **kw_args) + + _attrs = ["inService"] + _attr_types = {"inService": bool} + _defaults = {"inService": False} + _enums = {} + _refs = ["ConductingEquipment"] + _many_refs = [] + + def getConductingEquipment(self): + """The conducting equipment associated with the status state. + """ + return self._ConductingEquipment + + def setConductingEquipment(self, value): + if self._ConductingEquipment is not None: + self._ConductingEquipment._SvStatus = None + + self._ConductingEquipment = value + if self._ConductingEquipment is not None: + self._ConductingEquipment.SvStatus = None + self._ConductingEquipment._SvStatus = self + + ConductingEquipment = property(getConductingEquipment, setConductingEquipment) + diff --git a/CIM16/IEC61970/StateVariables/SvTapStep.py b/CIM16/IEC61970/StateVariables/SvTapStep.py new file mode 100755 index 00000000..cd2bff27 --- /dev/null +++ b/CIM16/IEC61970/StateVariables/SvTapStep.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.StateVariables.StateVariable import StateVariable + +class SvTapStep(StateVariable): + """State variable for transformer tap step. This class is to be used for taps of LTC (load tap changing) transformers, not fixed tap transformers. Normally a profile specifies only one of the attributes 'position'or 'tapRatio'.State variable for transformer tap step. This class is to be used for taps of LTC (load tap changing) transformers, not fixed tap transformers. Normally a profile specifies only one of the attributes 'position'or 'tapRatio'. + """ + + def __init__(self, position=0.0, TapChanger=None, *args, **kw_args): + """Initialises a new 'SvTapStep' instance. + + @param position: The floating point tap position. To get integer value scale with range and round off. + @param TapChanger: The tap changer associated with the tap step state. + """ + #: The floating point tap position. To get integer value scale with range and round off. + self.position = position + + self._TapChanger = None + self.TapChanger = TapChanger + + super(SvTapStep, self).__init__(*args, **kw_args) + + _attrs = ["position"] + _attr_types = {"position": float} + _defaults = {"position": 0.0} + _enums = {} + _refs = ["TapChanger"] + _many_refs = [] + + def getTapChanger(self): + """The tap changer associated with the tap step state. + """ + return self._TapChanger + + def setTapChanger(self, value): + if self._TapChanger is not None: + self._TapChanger._SvTapStep = None + + self._TapChanger = value + if self._TapChanger is not None: + self._TapChanger.SvTapStep = None + self._TapChanger._SvTapStep = self + + TapChanger = property(getTapChanger, setTapChanger) + diff --git a/CIM16/IEC61970/StateVariables/SvVoltage.py b/CIM16/IEC61970/StateVariables/SvVoltage.py new file mode 100755 index 00000000..d08719b3 --- /dev/null +++ b/CIM16/IEC61970/StateVariables/SvVoltage.py @@ -0,0 +1,67 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.StateVariables.StateVariable import StateVariable + +class SvVoltage(StateVariable): + """State variable for voltage.State variable for voltage. + """ + + def __init__(self, angle=0.0, v=0.0, TopologicalNode=None, *args, **kw_args): + """Initialises a new 'SvVoltage' instance. + + @param angle: The voltage angle in radians of the topological node. + @param v: The voltage magnitude of the topological node. + @param TopologicalNode: The topological node associated with the voltage state. + """ + #: The voltage angle in radians of the topological node. + self.angle = angle + + #: The voltage magnitude of the topological node. + self.v = v + + self._TopologicalNode = None + self.TopologicalNode = TopologicalNode + + super(SvVoltage, self).__init__(*args, **kw_args) + + _attrs = ["angle", "v"] + _attr_types = {"angle": float, "v": float} + _defaults = {"angle": 0.0, "v": 0.0} + _enums = {} + _refs = ["TopologicalNode"] + _many_refs = [] + + def getTopologicalNode(self): + """The topological node associated with the voltage state. + """ + return self._TopologicalNode + + def setTopologicalNode(self, value): + if self._TopologicalNode is not None: + self._TopologicalNode._SvVoltage = None + + self._TopologicalNode = value + if self._TopologicalNode is not None: + self._TopologicalNode.SvVoltage = None + self._TopologicalNode._SvVoltage = self + + TopologicalNode = property(getTopologicalNode, setTopologicalNode) + diff --git a/CIM16/IEC61970/StateVariables/TopologicalIsland.py b/CIM16/IEC61970/StateVariables/TopologicalIsland.py new file mode 100755 index 00000000..8959e0e0 --- /dev/null +++ b/CIM16/IEC61970/StateVariables/TopologicalIsland.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TopologicalIsland(IdentifiedObject): + """An electrically connected subset of the network. Topological islands can change as the current network state changes: e.g. due to - disconnect switches or breakers change state in a SCADA/EMS - manual creation, change or deletion of TopologicalNodes in a planning tool.An electrically connected subset of the network. Topological islands can change as the current network state changes: e.g. due to - disconnect switches or breakers change state in a SCADA/EMS - manual creation, change or deletion of TopologicalNodes in a planning tool. + """ + + def __init__(self, AngleRef_TopologicalNode=None, TopologicalNodes=None, *args, **kw_args): + """Initialises a new 'TopologicalIsland' instance. + + @param AngleRef_TopologicalNode: The angle reference for the island. Normally there is one TopologicalNode that is selected as the angle reference for each island. Other reference schemes exist, so the association is optional. + @param TopologicalNodes: A topological node belongs to a topological island + """ + self._AngleRef_TopologicalNode = None + self.AngleRef_TopologicalNode = AngleRef_TopologicalNode + + self._TopologicalNodes = [] + self.TopologicalNodes = [] if TopologicalNodes is None else TopologicalNodes + + super(TopologicalIsland, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["AngleRef_TopologicalNode", "TopologicalNodes"] + _many_refs = ["TopologicalNodes"] + + def getAngleRef_TopologicalNode(self): + """The angle reference for the island. Normally there is one TopologicalNode that is selected as the angle reference for each island. Other reference schemes exist, so the association is optional. + """ + return self._AngleRef_TopologicalNode + + def setAngleRef_TopologicalNode(self, value): + if self._AngleRef_TopologicalNode is not None: + self._AngleRef_TopologicalNode._AngleRef_TopologicalIsland = None + + self._AngleRef_TopologicalNode = value + if self._AngleRef_TopologicalNode is not None: + self._AngleRef_TopologicalNode.AngleRef_TopologicalIsland = None + self._AngleRef_TopologicalNode._AngleRef_TopologicalIsland = self + + AngleRef_TopologicalNode = property(getAngleRef_TopologicalNode, setAngleRef_TopologicalNode) + + def getTopologicalNodes(self): + """A topological node belongs to a topological island + """ + return self._TopologicalNodes + + def setTopologicalNodes(self, value): + for x in self._TopologicalNodes: + x.TopologicalIsland = None + for y in value: + y._TopologicalIsland = self + self._TopologicalNodes = value + + TopologicalNodes = property(getTopologicalNodes, setTopologicalNodes) + + def addTopologicalNodes(self, *TopologicalNodes): + for obj in TopologicalNodes: + obj.TopologicalIsland = self + + def removeTopologicalNodes(self, *TopologicalNodes): + for obj in TopologicalNodes: + obj.TopologicalIsland = None + diff --git a/CIM16/IEC61970/StateVariables/__init__.py b/CIM16/IEC61970/StateVariables/__init__.py new file mode 100755 index 00000000..19db187f --- /dev/null +++ b/CIM16/IEC61970/StateVariables/__init__.py @@ -0,0 +1,36 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""State variables for analysis solutions such as powerflow. +""" + +from CIM16.IEC61970.StateVariables.SvVoltage import SvVoltage +from CIM16.IEC61970.StateVariables.SvShortCircuit import SvShortCircuit +from CIM16.IEC61970.StateVariables.SvShuntCompensatorSections import SvShuntCompensatorSections +from CIM16.IEC61970.StateVariables.StateVariable import StateVariable +from CIM16.IEC61970.StateVariables.SvTapStep import SvTapStep +from CIM16.IEC61970.StateVariables.SvStatus import SvStatus +from CIM16.IEC61970.StateVariables.SvInjection import SvInjection +from CIM16.IEC61970.StateVariables.SvPowerFlow import SvPowerFlow +from CIM16.IEC61970.StateVariables.TopologicalIsland import TopologicalIsland + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#StateVariables" +nsPrefix = "cimStateVariables" + diff --git a/CIM16/IEC61970/Topology/BusNameMarker.py b/CIM16/IEC61970/Topology/BusNameMarker.py new file mode 100755 index 00000000..273320e5 --- /dev/null +++ b/CIM16/IEC61970/Topology/BusNameMarker.py @@ -0,0 +1,86 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class BusNameMarker(IdentifiedObject): + """Used to apply user standard names to topology buses. Typically used for 'bus/branch' case generation. Associated with one or more ConnectivityNodes that are normally a part of the bus name. The associated ConnectivityNodes are to be connected by non-retained switches. For a ring bus station configuration, all busbar connectivity nodes in the ring are typically associated. For a breaker and a half scheme, both busbars would be associated. For a ring bus, all busbars would be associated. For a 'straight' busbar configuration, only the main connectivity node at the busbar would be associated.Used to apply user standard names to topology buses. Typically used for 'bus/branch' case generation. Associated with one or more ConnectivityNodes that are normally a part of the bus name. The associated ConnectivityNodes are to be connected by non-retained switches. For a ring bus station configuration, all busbar connectivity nodes in the ring are typically associated. For a breaker and a half scheme, both busbars would be associated. For a ring bus, all busbars would be associated. For a 'straight' busbar configuration, only the main connectivity node at the busbar would be associated. + """ + + def __init__(self, Terminal=None, ReportingGroup=None, *args, **kw_args): + """Initialises a new 'BusNameMarker' instance. + + @param Terminal: A list of Terminals from the set of Terminals which are connected at the same bus (TopologicalNode) in the normal topology. At least one Terminal from the set of normally connected Terminals shall be in the list. + @param ReportingGroup: The reporting group to which this BusNameMarker belongs. + """ + self._Terminal = [] + self.Terminal = [] if Terminal is None else Terminal + + self._ReportingGroup = None + self.ReportingGroup = ReportingGroup + + super(BusNameMarker, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Terminal", "ReportingGroup"] + _many_refs = ["Terminal"] + + def getTerminal(self): + """A list of Terminals from the set of Terminals which are connected at the same bus (TopologicalNode) in the normal topology. At least one Terminal from the set of normally connected Terminals shall be in the list. + """ + return self._Terminal + + def setTerminal(self, value): + for x in self._Terminal: + x.BusNameMarker = None + for y in value: + y._BusNameMarker = self + self._Terminal = value + + Terminal = property(getTerminal, setTerminal) + + def addTerminal(self, *Terminal): + for obj in Terminal: + obj.BusNameMarker = self + + def removeTerminal(self, *Terminal): + for obj in Terminal: + obj.BusNameMarker = None + + def getReportingGroup(self): + """The reporting group to which this BusNameMarker belongs. + """ + return self._ReportingGroup + + def setReportingGroup(self, value): + if self._ReportingGroup is not None: + filtered = [x for x in self.ReportingGroup.BusNameMarker if x != self] + self._ReportingGroup._BusNameMarker = filtered + + self._ReportingGroup = value + if self._ReportingGroup is not None: + if self not in self._ReportingGroup._BusNameMarker: + self._ReportingGroup._BusNameMarker.append(self) + + ReportingGroup = property(getReportingGroup, setReportingGroup) + diff --git a/CIM16/IEC61970/Topology/TopologicalNode.py b/CIM16/IEC61970/Topology/TopologicalNode.py new file mode 100755 index 00000000..6f43387f --- /dev/null +++ b/CIM16/IEC61970/Topology/TopologicalNode.py @@ -0,0 +1,255 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TopologicalNode(IdentifiedObject): + """For a detailed substation model a TopologicalNode is a set of connectivity nodes that, in the current network state, are connected together through any type of closed switches, including jumpers. Topological nodes changes as the current network state changes (i.e., switches, breakers, etc. change state). For a planning model switch statuses are not used to form TopologicalNodes. Instead they are manually created or deleted in a model builder tool. TopologialNodes maintained this way are also called 'busses'.For a detailed substation model a TopologicalNode is a set of connectivity nodes that, in the current network state, are connected together through any type of closed switches, including jumpers. Topological nodes changes as the current network state changes (i.e., switches, breakers, etc. change state). For a planning model switch statuses are not used to form TopologicalNodes. Instead they are manually created or deleted in a model builder tool. TopologialNodes maintained this way are also called 'busses'. + """ + + def __init__(self, SvShortCircuit=None, ConnectivityNodeContainer=None, SvInjection=None, ConnectivityNodes=None, SvVoltage=None, BaseVoltage=None, TopologicalIsland=None, ReportingGroup=None, Terminal=None, AngleRef_TopologicalIsland=None, *args, **kw_args): + """Initialises a new 'TopologicalNode' instance. + + @param SvShortCircuit: The short circuit state associated with the topological node. + @param ConnectivityNodeContainer: The connectivity node container to which the toplogical node belongs. + @param SvInjection: The injection state associated with the topological node. + @param ConnectivityNodes: Several ConnectivityNode(s) may combine together to form a single TopologicalNode, depending on the current state of the network. + @param SvVoltage: The state voltage associated with the topological node. + @param BaseVoltage: The base voltage of the topologocial node. + @param TopologicalIsland: A topological node belongs to a topological island + @param ReportingGroup: The reporting group to which the topological node belongs. + @param Terminal: The terminals associated with the topological node. This can be used as an alternative to the connectivity node path to terminal, thus making it unneccesary to model connedtivity nodes in some cases. Note that the if connectivity nodes are in the model, this association would proably not be used. + @param AngleRef_TopologicalIsland: The island for which the node is an angle reference. Normally there is one angle reference node for each island. + """ + self._SvShortCircuit = None + self.SvShortCircuit = SvShortCircuit + + self._ConnectivityNodeContainer = None + self.ConnectivityNodeContainer = ConnectivityNodeContainer + + self._SvInjection = None + self.SvInjection = SvInjection + + self._ConnectivityNodes = [] + self.ConnectivityNodes = [] if ConnectivityNodes is None else ConnectivityNodes + + self._SvVoltage = None + self.SvVoltage = SvVoltage + + self._BaseVoltage = None + self.BaseVoltage = BaseVoltage + + self._TopologicalIsland = None + self.TopologicalIsland = TopologicalIsland + + self._ReportingGroup = None + self.ReportingGroup = ReportingGroup + + self._Terminal = [] + self.Terminal = [] if Terminal is None else Terminal + + self._AngleRef_TopologicalIsland = None + self.AngleRef_TopologicalIsland = AngleRef_TopologicalIsland + + super(TopologicalNode, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["SvShortCircuit", "ConnectivityNodeContainer", "SvInjection", "ConnectivityNodes", "SvVoltage", "BaseVoltage", "TopologicalIsland", "ReportingGroup", "Terminal", "AngleRef_TopologicalIsland"] + _many_refs = ["ConnectivityNodes", "Terminal"] + + def getSvShortCircuit(self): + """The short circuit state associated with the topological node. + """ + return self._SvShortCircuit + + def setSvShortCircuit(self, value): + if self._SvShortCircuit is not None: + self._SvShortCircuit._TopologicalNode = None + + self._SvShortCircuit = value + if self._SvShortCircuit is not None: + self._SvShortCircuit.TopologicalNode = None + self._SvShortCircuit._TopologicalNode = self + + SvShortCircuit = property(getSvShortCircuit, setSvShortCircuit) + + def getConnectivityNodeContainer(self): + """The connectivity node container to which the toplogical node belongs. + """ + return self._ConnectivityNodeContainer + + def setConnectivityNodeContainer(self, value): + if self._ConnectivityNodeContainer is not None: + filtered = [x for x in self.ConnectivityNodeContainer.TopologicalNode if x != self] + self._ConnectivityNodeContainer._TopologicalNode = filtered + + self._ConnectivityNodeContainer = value + if self._ConnectivityNodeContainer is not None: + if self not in self._ConnectivityNodeContainer._TopologicalNode: + self._ConnectivityNodeContainer._TopologicalNode.append(self) + + ConnectivityNodeContainer = property(getConnectivityNodeContainer, setConnectivityNodeContainer) + + def getSvInjection(self): + """The injection state associated with the topological node. + """ + return self._SvInjection + + def setSvInjection(self, value): + if self._SvInjection is not None: + self._SvInjection._TopologicalNode = None + + self._SvInjection = value + if self._SvInjection is not None: + self._SvInjection.TopologicalNode = None + self._SvInjection._TopologicalNode = self + + SvInjection = property(getSvInjection, setSvInjection) + + def getConnectivityNodes(self): + """Several ConnectivityNode(s) may combine together to form a single TopologicalNode, depending on the current state of the network. + """ + return self._ConnectivityNodes + + def setConnectivityNodes(self, value): + for x in self._ConnectivityNodes: + x.TopologicalNode = None + for y in value: + y._TopologicalNode = self + self._ConnectivityNodes = value + + ConnectivityNodes = property(getConnectivityNodes, setConnectivityNodes) + + def addConnectivityNodes(self, *ConnectivityNodes): + for obj in ConnectivityNodes: + obj.TopologicalNode = self + + def removeConnectivityNodes(self, *ConnectivityNodes): + for obj in ConnectivityNodes: + obj.TopologicalNode = None + + def getSvVoltage(self): + """The state voltage associated with the topological node. + """ + return self._SvVoltage + + def setSvVoltage(self, value): + if self._SvVoltage is not None: + self._SvVoltage._TopologicalNode = None + + self._SvVoltage = value + if self._SvVoltage is not None: + self._SvVoltage.TopologicalNode = None + self._SvVoltage._TopologicalNode = self + + SvVoltage = property(getSvVoltage, setSvVoltage) + + def getBaseVoltage(self): + """The base voltage of the topologocial node. + """ + return self._BaseVoltage + + def setBaseVoltage(self, value): + if self._BaseVoltage is not None: + filtered = [x for x in self.BaseVoltage.TopologicalNode if x != self] + self._BaseVoltage._TopologicalNode = filtered + + self._BaseVoltage = value + if self._BaseVoltage is not None: + if self not in self._BaseVoltage._TopologicalNode: + self._BaseVoltage._TopologicalNode.append(self) + + BaseVoltage = property(getBaseVoltage, setBaseVoltage) + + def getTopologicalIsland(self): + """A topological node belongs to a topological island + """ + return self._TopologicalIsland + + def setTopologicalIsland(self, value): + if self._TopologicalIsland is not None: + filtered = [x for x in self.TopologicalIsland.TopologicalNodes if x != self] + self._TopologicalIsland._TopologicalNodes = filtered + + self._TopologicalIsland = value + if self._TopologicalIsland is not None: + if self not in self._TopologicalIsland._TopologicalNodes: + self._TopologicalIsland._TopologicalNodes.append(self) + + TopologicalIsland = property(getTopologicalIsland, setTopologicalIsland) + + def getReportingGroup(self): + """The reporting group to which the topological node belongs. + """ + return self._ReportingGroup + + def setReportingGroup(self, value): + if self._ReportingGroup is not None: + filtered = [x for x in self.ReportingGroup.TopologicalNode if x != self] + self._ReportingGroup._TopologicalNode = filtered + + self._ReportingGroup = value + if self._ReportingGroup is not None: + if self not in self._ReportingGroup._TopologicalNode: + self._ReportingGroup._TopologicalNode.append(self) + + ReportingGroup = property(getReportingGroup, setReportingGroup) + + def getTerminal(self): + """The terminals associated with the topological node. This can be used as an alternative to the connectivity node path to terminal, thus making it unneccesary to model connedtivity nodes in some cases. Note that the if connectivity nodes are in the model, this association would proably not be used. + """ + return self._Terminal + + def setTerminal(self, value): + for x in self._Terminal: + x.TopologicalNode = None + for y in value: + y._TopologicalNode = self + self._Terminal = value + + Terminal = property(getTerminal, setTerminal) + + def addTerminal(self, *Terminal): + for obj in Terminal: + obj.TopologicalNode = self + + def removeTerminal(self, *Terminal): + for obj in Terminal: + obj.TopologicalNode = None + + def getAngleRef_TopologicalIsland(self): + """The island for which the node is an angle reference. Normally there is one angle reference node for each island. + """ + return self._AngleRef_TopologicalIsland + + def setAngleRef_TopologicalIsland(self, value): + if self._AngleRef_TopologicalIsland is not None: + self._AngleRef_TopologicalIsland._AngleRef_TopologicalNode = None + + self._AngleRef_TopologicalIsland = value + if self._AngleRef_TopologicalIsland is not None: + self._AngleRef_TopologicalIsland.AngleRef_TopologicalNode = None + self._AngleRef_TopologicalIsland._AngleRef_TopologicalNode = self + + AngleRef_TopologicalIsland = property(getAngleRef_TopologicalIsland, setAngleRef_TopologicalIsland) + diff --git a/CIM16/IEC61970/Topology/__init__.py b/CIM16/IEC61970/Topology/__init__.py new file mode 100755 index 00000000..63b34ae0 --- /dev/null +++ b/CIM16/IEC61970/Topology/__init__.py @@ -0,0 +1,29 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""An extension to the Core Package that in association with the Terminal class models Connectivity, that is the physical definition of how equipment is connected together. In addition it models Topology, that is the logical definition of how equipment is connected via closed switches. The Topology definition is independent of the other electrical characteristics. +""" + +from CIM16.IEC61970.Topology.BusNameMarker import BusNameMarker +from CIM16.IEC61970.Topology.TopologicalNode import TopologicalNode + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Topology" +nsPrefix = "cimTopology" + diff --git a/CIM16/IEC61970/Wires/ACLineSegment.py b/CIM16/IEC61970/Wires/ACLineSegment.py new file mode 100755 index 00000000..b2084a47 --- /dev/null +++ b/CIM16/IEC61970/Wires/ACLineSegment.py @@ -0,0 +1,251 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.Conductor import Conductor +from CIM16.IEC61970.Wires.PerLengthPhaseImpedance import PerLengthPhaseImpedance +from CIM16.IEC61970.Wires.PerLengthSequenceImpedance import PerLengthSequenceImpedance + +class ACLineSegment(Conductor): + """A wire or combination of wires, with consistent electrical characteristics, building a single electrical system, used to carry alternating current between points in the power system. For symmetrical, transposed 3ph lines, it is sufficient to use ACLineSegment attributes, which describe sequence impedances and admittances for the entire length of the segment. If per lenght impedance data is available from a library of standard types, impedances and admittances can be calculated in one of the following ways: - calculate electrical parameters from asset data, using associated ConductorInfo, with values then multiplied by Conductor.length to produce a matrix model. - calculate unbalanced electrical parameters from associated PerLengthPhaseImpedance, then multiplied by Conductor.length to produce a matrix model. - calculate transposed electrical parameters from associated PerLengthSequenceImpedance, then multiplied by Conductor.length to produce a sequence model.A wire or combination of wires, with consistent electrical characteristics, building a single electrical system, used to carry alternating current between points in the power system. For symmetrical, transposed 3ph lines, it is sufficient to use ACLineSegment attributes, which describe sequence impedances and admittances for the entire length of the segment. If per lenght impedance data is available from a library of standard types, impedances and admittances can be calculated in one of the following ways: - calculate electrical parameters from asset data, using associated ConductorInfo, with values then multiplied by Conductor.length to produce a matrix model. - calculate unbalanced electrical parameters from associated PerLengthPhaseImpedance, then multiplied by Conductor.length to produce a matrix model. - calculate transposed electrical parameters from associated PerLengthSequenceImpedance, then multiplied by Conductor.length to produce a sequence model. + """ + + def __init__(self, g0ch=0.0, r=0.0, x=0.0, gch=0.0, r0=0.0, bch=0.0, b0ch=0.0, x0=0.0, SequenceImpedance=None, ConductorAssets=None, ConductorInfo=None, Cut=None, PhaseImpedance=None, Clamp=None, ACLineSegmentPhases=None, PerLengthImpedance=None, *args, **kw_args): + """Initialises a new 'ACLineSegment' instance. + + @param g0ch: Zero sequence shunt (charging) conductance, uniformly distributed, of the entire line section. + @param r: Positive sequence series resistance of the entire line section. + @param x: Positive sequence series reactance of the entire line section. + @param gch: Positive sequence shunt (charging) conductance, uniformly distributed, of the entire line section. + @param r0: Zero sequence series resistance of the entire line section. + @param bch: Positive sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. This value represents the full charging over the full length of the line. + @param b0ch: Zero sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. + @param x0: Zero sequence series reactance of the entire line section. + @param SequenceImpedance: Sequence impedance of this line segment; used for balanced model. + @param ConductorAssets: + @param ConductorInfo: Conductor data for this line segment. + @param Cut: + @param PhaseImpedance: Phase impedance of this line segment; used for unbalanced model. + @param Clamp: + @param ACLineSegmentPhases: List of ACLineSegmentPhase objects + """ + #: Zero sequence shunt (charging) conductance, uniformly distributed, of the entire line section. + self.g0ch = g0ch + + #: Positive sequence series resistance of the entire line section. + self.r = r + + #: Positive sequence series reactance of the entire line section. + self.x = x + + #: Positive sequence shunt (charging) conductance, uniformly distributed, of the entire line section. + self.gch = gch + #: Zero sequence series resistance of the entire line section. + self.r0 = r0 + + #: Positive sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. This value represents the full charging over the full length of the line. + self.bch = bch + + #: Zero sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. + self.b0ch = b0ch + + #: Zero sequence series reactance of the entire line section. + self.x0 = x0 + + self._SequenceImpedance = None + self._PhaseImpedance = None + self._PerLengthImpedance = None + + if SequenceImpedance is not None: + if PhaseImpedance is not None or PerLengthImpedance is not None: + raise ValueError("Too many impedance models specified!") + else: + self.SequenceImpedance = SequenceImpedance + elif PhaseImpedance is not None: + if PerLengthImpedance is not None: + raise ValueError("Too many impedance models specified!") + else: + self.PhaseImpedance = PhaseImpedance + elif PerLengthImpedance is not None: + self.PerLengthImpedance = PerLengthImpedance + + self._ConductorAssets = [] + self.ConductorAssets = [] if ConductorAssets is None else ConductorAssets + + self._ConductorInfo = None + self.ConductorInfo = ConductorInfo + + self._Cut = [] + self.Cut = [] if Cut is None else Cut + + self._Clamp = [] + self.Clamp = [] if Clamp is None else Clamp + + self._ACLineSegmentPhases = [] + self.ACLineSegmentPhases = [] if ACLineSegmentPhases is None else ACLineSegmentPhases + + super(ACLineSegment, self).__init__(*args, **kw_args) + + _attrs = ["g0ch", "r", "x", "gch", "r0", "bch", "b0ch", "x0"] + _attr_types = {"g0ch": float, "r": float, "x": float, "gch": float, "r0": float, "bch": float, "b0ch": float, "x0": float} + _defaults = {"g0ch": 0.0, "r": 0.0, "x": 0.0, "gch": 0.0, "r0": 0.0, "bch": 0.0, "b0ch": 0.0, "x0": 0.0} + _enums = {} + _refs = ["SequenceImpedance", "ConductorAssets", "ConductorInfo", "Cut", "PhaseImpedance", "Clamp", "ACLineSegmentPhases", "PerLengthImpedance"] + _many_refs = ["ConductorAssets", "Cut", "Clamp", "ACLineSegmentPhases"] + + def getSequenceImpedance(self): + """Sequence impedance of this line segment; used for balanced model. + """ + if type(self.PerLengthImpedance) is PerLengthSequenceImpedance: + return self.PerLengthImpedance + else: + return None + + def setSequenceImpedance(self, value): + self.PerLengthImpedance = value + + SequenceImpedance = property(getSequenceImpedance, setSequenceImpedance) + + def getPerLengthImpedance(self): + return self._PerLengthImpedance + + def setPerLengthImpedance(self, value): + if self._PerLengthImpedance is not None: + filtered = [x for x in self.PerLengthImpedance.LineSegments if x != self] + self._PerLengthImpedance._LineSegments = filtered + + self._PerLengthImpedance = value + if self._PerLengthImpedance is not None: + if self not in self._PerLengthImpedance._LineSegments: + self._PerLengthImpedance._LineSegments.append(self) + + PerLengthImpedance = property(getPerLengthImpedance, setPerLengthImpedance) + + def getConductorAssets(self): + return self._ConductorAssets + + def setConductorAssets(self, value): + for x in self._ConductorAssets: + x.ConductorSegment = None + for y in value: + y._ConductorSegment = self + self._ConductorAssets = value + + ConductorAssets = property(getConductorAssets, setConductorAssets) + + def addConductorAssets(self, *ConductorAssets): + for obj in ConductorAssets: + obj.ConductorSegment = self + + def removeConductorAssets(self, *ConductorAssets): + for obj in ConductorAssets: + obj.ConductorSegment = None + + def getConductorInfo(self): + """Conductor data for this line segment. + """ + return self._ConductorInfo + + def setConductorInfo(self, value): + if self._ConductorInfo is not None: + filtered = [x for x in self.ConductorInfo.LineSegments if x != self] + self._ConductorInfo._LineSegments = filtered + + self._ConductorInfo = value + if self._ConductorInfo is not None: + if self not in self._ConductorInfo._LineSegments: + self._ConductorInfo._LineSegments.append(self) + + ConductorInfo = property(getConductorInfo, setConductorInfo) + + def getCut(self): + + return self._Cut + + def setCut(self, value): + for x in self._Cut: + x.ACLineSegment = None + for y in value: + y._ACLineSegment = self + self._Cut = value + + Cut = property(getCut, setCut) + + def addCut(self, *Cut): + for obj in Cut: + obj.ACLineSegment = self + + def removeCut(self, *Cut): + for obj in Cut: + obj.ACLineSegment = None + + def getPhaseImpedance(self): + """Phase impedance of this line segment; used for unbalanced model. + """ + if type(self.PerLengthImpedance) is PerLengthPhaseImpedance: + return self.PerLengthImpedance + else: + return None + + def setPhaseImpedance(self, value): + self.PerLengthImpedance = value + + PhaseImpedance = property(getPhaseImpedance, setPhaseImpedance) + + def getClamp(self): + + return self._Clamp + + def setClamp(self, value): + for x in self._Clamp: + x.ACLineSegment = None + for y in value: + y._ACLineSegment = self + self._Clamp = value + + Clamp = property(getClamp, setClamp) + + def addClamp(self, *Clamp): + for obj in Clamp: + obj.ACLineSegment = self + + def removeClamp(self, *Clamp): + for obj in Clamp: + obj.ACLineSegment = None + + def getACLineSegmentPhases(self): + return self._ACLineSegmentPhases + + def setACLineSegmentPhases(self, value): + for x in self._ACLineSegmentPhases: + x.ACLineSegment = None + for y in value: + y._ACLineSegment = self + self._ACLineSegmentPhases = value + + ACLineSegmentPhases = property(getACLineSegmentPhases, setACLineSegmentPhases) + + def addACLineSegmentPhases(self, *ACLineSegmentPhases): + for obj in ACLineSegmentPhases: + obj.ACLineSegment = self + + def removeACLineSegmentPhases(self, *ACLineSegmentPhases): + for obj in ACLineSegmentPhases: + obj.ACLineSegment = None + diff --git a/CIM16/IEC61970/Wires/Breaker.py b/CIM16/IEC61970/Wires/Breaker.py new file mode 100755 index 00000000..968eb319 --- /dev/null +++ b/CIM16/IEC61970/Wires/Breaker.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.ProtectedSwitch import ProtectedSwitch + +class Breaker(ProtectedSwitch): + """A mechanical switching device capable of making, carrying, and breaking currents under normal circuit conditions and also making, carrying for a specified time, and breaking currents under specified abnormal circuit conditions e.g. those of short circuit.A mechanical switching device capable of making, carrying, and breaking currents under normal circuit conditions and also making, carrying for a specified time, and breaking currents under specified abnormal circuit conditions e.g. those of short circuit. + """ + + def __init__(self, inTransitTime=0.0, *args, **kw_args): + """Initialises a new 'Breaker' instance. + + @param inTransitTime: The transition time from open to close. + """ + #: The transition time from open to close. + self.inTransitTime = inTransitTime + + super(Breaker, self).__init__(*args, **kw_args) + + _attrs = ["inTransitTime"] + _attr_types = {"inTransitTime": float} + _defaults = {"inTransitTime": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/BusbarSection.py b/CIM16/IEC61970/Wires/BusbarSection.py new file mode 100755 index 00000000..b0890edb --- /dev/null +++ b/CIM16/IEC61970/Wires/BusbarSection.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.Connector import Connector + +class BusbarSection(Connector): + """A conductor, or group of conductors, with negligible impedance, that serve to connect other conducting equipment within a single substation. Voltage measurements are typically obtained from VoltageTransformers that are connected to busbar sections. A bus bar section may have many physical terminals but for analysis is modelled with exactly one logical terminal.A conductor, or group of conductors, with negligible impedance, that serve to connect other conducting equipment within a single substation. Voltage measurements are typically obtained from VoltageTransformers that are connected to busbar sections. A bus bar section may have many physical terminals but for analysis is modelled with exactly one logical terminal. + """ + + def __init__(self, VoltageControlZone=None, *args, **kw_args): + """Initialises a new 'BusbarSection' instance. + + @param VoltageControlZone: A VoltageControlZone is controlled by a designated BusbarSection. + """ + self._VoltageControlZone = None + self.VoltageControlZone = VoltageControlZone + + super(BusbarSection, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["VoltageControlZone"] + _many_refs = [] + + def getVoltageControlZone(self): + """A VoltageControlZone is controlled by a designated BusbarSection. + """ + return self._VoltageControlZone + + def setVoltageControlZone(self, value): + if self._VoltageControlZone is not None: + self._VoltageControlZone._BusbarSection = None + + self._VoltageControlZone = value + if self._VoltageControlZone is not None: + self._VoltageControlZone.BusbarSection = None + self._VoltageControlZone._BusbarSection = self + + VoltageControlZone = property(getVoltageControlZone, setVoltageControlZone) + diff --git a/CIM16/IEC61970/Wires/CompositeSwitch.py b/CIM16/IEC61970/Wires/CompositeSwitch.py new file mode 100755 index 00000000..33b95ade --- /dev/null +++ b/CIM16/IEC61970/Wires/CompositeSwitch.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Equipment import Equipment + +class CompositeSwitch(Equipment): + """A model of a set of individual Switches normally enclosed within the same cabinet and possibly with interlocks that restrict the combination of switch positions. These are typically found in medium voltage distribution networks. A CompositeSwitch could represent a Ring-Main-Unit (RMU), or pad-mounted switchgear, with primitive internal devices such as an internal bus-bar plus 3 or 4 internal switches each of which may individually be open or closed. A CompositeSwitch and a set of contained Switches can also be used to represent a multi-position switch e.g. a switch that can connect a circuit to Ground, Open or Busbar.A model of a set of individual Switches normally enclosed within the same cabinet and possibly with interlocks that restrict the combination of switch positions. These are typically found in medium voltage distribution networks. A CompositeSwitch could represent a Ring-Main-Unit (RMU), or pad-mounted switchgear, with primitive internal devices such as an internal bus-bar plus 3 or 4 internal switches each of which may individually be open or closed. A CompositeSwitch and a set of contained Switches can also be used to represent a multi-position switch e.g. a switch that can connect a circuit to Ground, Open or Busbar. + """ + + def __init__(self, compositeSwitchType='', Switches=None, *args, **kw_args): + """Initialises a new 'CompositeSwitch' instance. + + @param compositeSwitchType: An alphanumeric code that can be used as a reference to extar information such as the description of the interlocking scheme if any + @param Switches: Switches contained in this Composite switch. + """ + #: An alphanumeric code that can be used as a reference to extar information such as the description of the interlocking scheme if any + self.compositeSwitchType = compositeSwitchType + + self._Switches = [] + self.Switches = [] if Switches is None else Switches + + super(CompositeSwitch, self).__init__(*args, **kw_args) + + _attrs = ["compositeSwitchType"] + _attr_types = {"compositeSwitchType": str} + _defaults = {"compositeSwitchType": ''} + _enums = {} + _refs = ["Switches"] + _many_refs = ["Switches"] + + def getSwitches(self): + """Switches contained in this Composite switch. + """ + return self._Switches + + def setSwitches(self, value): + for x in self._Switches: + x.CompositeSwitch = None + for y in value: + y._CompositeSwitch = self + self._Switches = value + + Switches = property(getSwitches, setSwitches) + + def addSwitches(self, *Switches): + for obj in Switches: + obj.CompositeSwitch = self + + def removeSwitches(self, *Switches): + for obj in Switches: + obj.CompositeSwitch = None + diff --git a/CIM16/IEC61970/Wires/Conductor.py b/CIM16/IEC61970/Wires/Conductor.py new file mode 100755 index 00000000..a9091eb9 --- /dev/null +++ b/CIM16/IEC61970/Wires/Conductor.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Conductor(ConductingEquipment): + """Combination of conducting material with consistent electrical characteristics, building a single electrical system, used to carry current between points in the power system.Combination of conducting material with consistent electrical characteristics, building a single electrical system, used to carry current between points in the power system. + """ + + def __init__(self, length=0.0, *args, **kw_args): + """Initialises a new 'Conductor' instance. + + @param length: Segment length for calculating line section capabilities + """ + #: Segment length for calculating line section capabilities + self.length = length + + super(Conductor, self).__init__(*args, **kw_args) + + _attrs = ["length"] + _attr_types = {"length": float} + _defaults = {"length": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/Connector.py b/CIM16/IEC61970/Wires/Connector.py new file mode 100755 index 00000000..cd4fa49a --- /dev/null +++ b/CIM16/IEC61970/Wires/Connector.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Connector(ConductingEquipment): + """A conductor, or group of conductors, with negligible impedance, that serve to connect other conducting equipment within a single substation and are modelled with a single logical terminal.A conductor, or group of conductors, with negligible impedance, that serve to connect other conducting equipment within a single substation and are modelled with a single logical terminal. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Connector' instance. + + """ + super(Connector, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/DCLineSegment.py b/CIM16/IEC61970/Wires/DCLineSegment.py new file mode 100755 index 00000000..062ef78d --- /dev/null +++ b/CIM16/IEC61970/Wires/DCLineSegment.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.Conductor import Conductor + +class DCLineSegment(Conductor): + """A wire or combination of wires not insulated from one another, with consistent electrical characteristics, used to carry direct current between points in the DC region of the power system.A wire or combination of wires not insulated from one another, with consistent electrical characteristics, used to carry direct current between points in the DC region of the power system. + """ + + def __init__(self, dcSegmentInductance=0.0, dcSegmentResistance=0.0, *args, **kw_args): + """Initialises a new 'DCLineSegment' instance. + + @param dcSegmentInductance: Inductance of the DC line segment. + @param dcSegmentResistance: Resistance of the DC line segment. + """ + #: Inductance of the DC line segment. + self.dcSegmentInductance = dcSegmentInductance + + #: Resistance of the DC line segment. + self.dcSegmentResistance = dcSegmentResistance + + super(DCLineSegment, self).__init__(*args, **kw_args) + + _attrs = ["dcSegmentInductance", "dcSegmentResistance"] + _attr_types = {"dcSegmentInductance": float, "dcSegmentResistance": float} + _defaults = {"dcSegmentInductance": 0.0, "dcSegmentResistance": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/Disconnector.py b/CIM16/IEC61970/Wires/Disconnector.py new file mode 100755 index 00000000..cf2a09fb --- /dev/null +++ b/CIM16/IEC61970/Wires/Disconnector.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.Switch import Switch + +class Disconnector(Switch): + """A manually operated or motor operated mechanical switching device used for changing the connections in a circuit, or for isolating a circuit or equipment from a source of power. It is required to open or close circuits when negligible current is broken or made.A manually operated or motor operated mechanical switching device used for changing the connections in a circuit, or for isolating a circuit or equipment from a source of power. It is required to open or close circuits when negligible current is broken or made. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Disconnector' instance. + + """ + super(Disconnector, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/EnergyConsumer.py b/CIM16/IEC61970/Wires/EnergyConsumer.py new file mode 100755 index 00000000..9b9c83e7 --- /dev/null +++ b/CIM16/IEC61970/Wires/EnergyConsumer.py @@ -0,0 +1,155 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class EnergyConsumer(ConductingEquipment): + """Generic user of energy - a point of consumption on the power system modelGeneric user of energy - a point of consumption on the power system model + """ + + def __init__(self, qfixedPct=0.0, customerCount=0, pfixedPct=0.0, pfixed=0.0, qfixed=0.0, ServiceDeliveryPoints=None, LoadResponse=None, PowerCutZone=None, EnergyConsumerPhases=None, p=0.0, q=0.0, *args, **kw_args): + """Initialises a new 'EnergyConsumer' instance. + + @param qfixedPct: Fixed reactive power as per cent of load group fixed reactive power. Load sign convention is used, i.e. positive sign means flow out from a node. + @param customerCount: Number of individual customers represented by this Demand + @param pfixedPct: Fixed active power as per cent of load group fixed active power. Load sign convention is used, i.e. positive sign means flow out from a node. + @param pfixed: Active power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. + @param qfixed: Reactive power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. + @param ServiceDeliveryPoints: + @param LoadResponse: The load response characteristic of this load. + @param PowerCutZone: An energy consumer is assigned to a power cut zone + @param EnergyConsumerPhases: + """ + #: Fixed reactive power as per cent of load group fixed reactive power. Load sign convention is used, i.e. positive sign means flow out from a node. + self.qfixedPct = qfixedPct + + #: Number of individual customers represented by this Demand + self.customerCount = customerCount + + #: Fixed active power as per cent of load group fixed active power. Load sign convention is used, i.e. positive sign means flow out from a node. + self.pfixedPct = pfixedPct + + #: Active power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. + self.pfixed = pfixed + + #: Reactive power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. + self.qfixed = qfixed + + self._ServiceDeliveryPoints = [] + self.ServiceDeliveryPoints = [] if ServiceDeliveryPoints is None else ServiceDeliveryPoints + + self._LoadResponse = None + self.LoadResponse = LoadResponse + + self._PowerCutZone = None + self.PowerCutZone = PowerCutZone + + self._EnergyConsumerPhases = [] + self.EnergyConsumerPhases = [] if EnergyConsumerPhases is None else EnergyConsumerPhases + + self.p = p + + self.q = q + + super(EnergyConsumer, self).__init__(*args, **kw_args) + + _attrs = ["qfixedPct", "customerCount", "pfixedPct", "pfixed", "qfixed", "p", "q"] + _attr_types = {"qfixedPct": float, "customerCount": int, "pfixedPct": float, "pfixed": float, "qfixed": float, "p": float, "q": float} + _defaults = {"qfixedPct": 0.0, "customerCount": 0, "pfixedPct": 0.0, "pfixed": 0.0, "qfixed": 0.0, "p": 0.0, "q": 0.0} + _enums = {} + _refs = ["ServiceDeliveryPoints", "LoadResponse", "PowerCutZone", "EnergyConsumerPhases"] + _many_refs = ["ServiceDeliveryPoints", "EnergyConsumerPhases"] + + def getServiceDeliveryPoints(self): + + return self._ServiceDeliveryPoints + + def setServiceDeliveryPoints(self, value): + for x in self._ServiceDeliveryPoints: + x.EnergyConsumer = None + for y in value: + y._EnergyConsumer = self + self._ServiceDeliveryPoints = value + + ServiceDeliveryPoints = property(getServiceDeliveryPoints, setServiceDeliveryPoints) + + def addServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + obj.EnergyConsumer = self + + def removeServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + obj.EnergyConsumer = None + + def getLoadResponse(self): + """The load response characteristic of this load. + """ + return self._LoadResponse + + def setLoadResponse(self, value): + if self._LoadResponse is not None: + filtered = [x for x in self.LoadResponse.EnergyConsumer if x != self] + self._LoadResponse._EnergyConsumer = filtered + + self._LoadResponse = value + if self._LoadResponse is not None: + if self not in self._LoadResponse._EnergyConsumer: + self._LoadResponse._EnergyConsumer.append(self) + + LoadResponse = property(getLoadResponse, setLoadResponse) + + def getPowerCutZone(self): + """An energy consumer is assigned to a power cut zone + """ + return self._PowerCutZone + + def setPowerCutZone(self, value): + if self._PowerCutZone is not None: + filtered = [x for x in self.PowerCutZone.EnergyConsumers if x != self] + self._PowerCutZone._EnergyConsumers = filtered + + self._PowerCutZone = value + if self._PowerCutZone is not None: + if self not in self._PowerCutZone._EnergyConsumers: + self._PowerCutZone._EnergyConsumers.append(self) + + PowerCutZone = property(getPowerCutZone, setPowerCutZone) + + def getEnergyConsumerPhases(self): + + return self._EnergyConsumerPhases + + def setEnergyConsumerPhases(self, value): + for x in self._EnergyConsumerPhases: + x.EnergyConsumer = None + for y in value: + y._EnergyConsumer = self + self._EnergyConsumerPhases = value + + EnergyConsumerPhases = property(getEnergyConsumerPhases, setEnergyConsumerPhases) + + def addEnergyConsumerPhases(self, *EnergyConsumerPhases): + for obj in EnergyConsumerPhases: + obj.EnergyConsumer = self + + def removeEnergyConsumerPhases(self, *EnergyConsumerPhases): + for obj in EnergyConsumerPhases: + obj.EnergyConsumer = None + diff --git a/CIM16/IEC61970/Wires/EnergySource.py b/CIM16/IEC61970/Wires/EnergySource.py new file mode 100755 index 00000000..4ac2d14d --- /dev/null +++ b/CIM16/IEC61970/Wires/EnergySource.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class EnergySource(ConductingEquipment): + """A generic equivalent for an energy supplier on a transmission or distribution voltage level.A generic equivalent for an energy supplier on a transmission or distribution voltage level. + """ + + def __init__(self, r0=0.0, voltageMagnitude=0.0, xn=0.0, nominalVoltage=0.0, x=0.0, r=0.0, voltageAngle=0.0, rn=0.0, x0=0.0, activePower=0.0, *args, **kw_args): + """Initialises a new 'EnergySource' instance. + + @param r0: Zero sequence Thevenin resistance. + @param voltageMagnitude: Phase-to-phase open circuit voltage magnitude. + @param xn: Negative sequence Thevenin reactance. + @param nominalVoltage: Phase-to-phase nominal voltage. + @param x: Positive sequence Thevenin reactance. + @param r: Positive sequence Thevenin resistance. + @param voltageAngle: Phase angle of a-phase open circuit. + @param rn: Negative sequence Thevenin resistance. + @param x0: Zero sequence Thevenin reactance. + @param activePower: High voltage source load + """ + #: Zero sequence Thevenin resistance. + self.r0 = r0 + + #: Phase-to-phase open circuit voltage magnitude. + self.voltageMagnitude = voltageMagnitude + + #: Negative sequence Thevenin reactance. + self.xn = xn + + #: Phase-to-phase nominal voltage. + self.nominalVoltage = nominalVoltage + + #: Positive sequence Thevenin reactance. + self.x = x + + #: Positive sequence Thevenin resistance. + self.r = r + + #: Phase angle of a-phase open circuit. + self.voltageAngle = voltageAngle + + #: Negative sequence Thevenin resistance. + self.rn = rn + + #: Zero sequence Thevenin reactance. + self.x0 = x0 + + #: High voltage source load + self.activePower = activePower + + super(EnergySource, self).__init__(*args, **kw_args) + + _attrs = ["r0", "voltageMagnitude", "xn", "nominalVoltage", "x", "r", "voltageAngle", "rn", "x0", "activePower"] + _attr_types = {"r0": float, "voltageMagnitude": float, "xn": float, "nominalVoltage": float, "x": float, "r": float, "voltageAngle": float, "rn": float, "x0": float, "activePower": float} + _defaults = {"r0": 0.0, "voltageMagnitude": 0.0, "xn": 0.0, "nominalVoltage": 0.0, "x": 0.0, "r": 0.0, "voltageAngle": 0.0, "rn": 0.0, "x0": 0.0, "activePower": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/FrequencyConverter.py b/CIM16/IEC61970/Wires/FrequencyConverter.py new file mode 100755 index 00000000..034f74d4 --- /dev/null +++ b/CIM16/IEC61970/Wires/FrequencyConverter.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.RegulatingCondEq import RegulatingCondEq + +class FrequencyConverter(RegulatingCondEq): + """A device to convert from one frequency to another (e.g., frequency F1 to F2) comprises a pair of FrequencyConverter instances. One converts from F1 to DC, the other converts the DC to F2.A device to convert from one frequency to another (e.g., frequency F1 to F2) comprises a pair of FrequencyConverter instances. One converts from F1 to DC, the other converts the DC to F2. + """ + + def __init__(self, maxU=0.0, maxP=0.0, frequency=0.0, minP=0.0, minU=0.0, operatingMode='', *args, **kw_args): + """Initialises a new 'FrequencyConverter' instance. + + @param maxU: The maximum voltage on the DC side at which the frequency converter should operate. + @param maxP: The maximum active power on the DC side at which the frequence converter should operate. + @param frequency: Frequency on the AC side. + @param minP: The minimum active power on the DC side at which the frequence converter should operate. + @param minU: The minimum voltage on the DC side at which the frequency converter should operate. + @param operatingMode: Operating mode for the frequency converter + """ + #: The maximum voltage on the DC side at which the frequency converter should operate. + self.maxU = maxU + + #: The maximum active power on the DC side at which the frequence converter should operate. + self.maxP = maxP + + #: Frequency on the AC side. + self.frequency = frequency + + #: The minimum active power on the DC side at which the frequence converter should operate. + self.minP = minP + + #: The minimum voltage on the DC side at which the frequency converter should operate. + self.minU = minU + + #: Operating mode for the frequency converter + self.operatingMode = operatingMode + + super(FrequencyConverter, self).__init__(*args, **kw_args) + + _attrs = ["maxU", "maxP", "frequency", "minP", "minU", "operatingMode"] + _attr_types = {"maxU": float, "maxP": float, "frequency": float, "minP": float, "minU": float, "operatingMode": str} + _defaults = {"maxU": 0.0, "maxP": 0.0, "frequency": 0.0, "minP": 0.0, "minU": 0.0, "operatingMode": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/Fuse.py b/CIM16/IEC61970/Wires/Fuse.py new file mode 100755 index 00000000..270d0d91 --- /dev/null +++ b/CIM16/IEC61970/Wires/Fuse.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.Switch import Switch + +class Fuse(Switch): + """An overcurrent protective device with a circuit opening fusible part that is heated and severed by the passage of overcurrent through it. A fuse is considered a switching device because it breaks current.An overcurrent protective device with a circuit opening fusible part that is heated and severed by the passage of overcurrent through it. A fuse is considered a switching device because it breaks current. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Fuse' instance. + + """ + super(Fuse, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/Ground.py b/CIM16/IEC61970/Wires/Ground.py new file mode 100755 index 00000000..272e1b4d --- /dev/null +++ b/CIM16/IEC61970/Wires/Ground.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Ground(ConductingEquipment): + """A common point for connecting grounded conducting equipment such as shunt capacitors. The power system model can have more than one ground.A common point for connecting grounded conducting equipment such as shunt capacitors. The power system model can have more than one ground. + """ + + def __init__(self, WindingInsulations=None, *args, **kw_args): + """Initialises a new 'Ground' instance. + + @param WindingInsulations: + """ + self._WindingInsulations = [] + self.WindingInsulations = [] if WindingInsulations is None else WindingInsulations + + super(Ground, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["WindingInsulations"] + _many_refs = ["WindingInsulations"] + + def getWindingInsulations(self): + + return self._WindingInsulations + + def setWindingInsulations(self, value): + for x in self._WindingInsulations: + x.Ground = None + for y in value: + y._Ground = self + self._WindingInsulations = value + + WindingInsulations = property(getWindingInsulations, setWindingInsulations) + + def addWindingInsulations(self, *WindingInsulations): + for obj in WindingInsulations: + obj.Ground = self + + def removeWindingInsulations(self, *WindingInsulations): + for obj in WindingInsulations: + obj.Ground = None + diff --git a/CIM16/IEC61970/Wires/GroundDisconnector.py b/CIM16/IEC61970/Wires/GroundDisconnector.py new file mode 100755 index 00000000..a5aee5b2 --- /dev/null +++ b/CIM16/IEC61970/Wires/GroundDisconnector.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.Switch import Switch + +class GroundDisconnector(Switch): + """A manually operated or motor operated mechanical switching device used for isolating a circuit or equipment from Ground.A manually operated or motor operated mechanical switching device used for isolating a circuit or equipment from Ground. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'GroundDisconnector' instance. + + """ + super(GroundDisconnector, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/Jumper.py b/CIM16/IEC61970/Wires/Jumper.py new file mode 100755 index 00000000..2bcdfa0c --- /dev/null +++ b/CIM16/IEC61970/Wires/Jumper.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.Switch import Switch + +class Jumper(Switch): + """A short section of conductor with negligible impedance which can be manually removed and replaced if the circuit is de-energized. Note that zero-impedance branches can be modelled by an ACLineSegment with a zero impedance ConductorTypeA short section of conductor with negligible impedance which can be manually removed and replaced if the circuit is de-energized. Note that zero-impedance branches can be modelled by an ACLineSegment with a zero impedance ConductorType + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Jumper' instance. + + """ + super(Jumper, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/Junction.py b/CIM16/IEC61970/Wires/Junction.py new file mode 100755 index 00000000..f9907c1a --- /dev/null +++ b/CIM16/IEC61970/Wires/Junction.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.Connector import Connector + +class Junction(Connector): + """A point where one or more conducting equipments are connected with zero resistance.A point where one or more conducting equipments are connected with zero resistance. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Junction' instance. + + """ + super(Junction, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/Line.py b/CIM16/IEC61970/Wires/Line.py new file mode 100755 index 00000000..9ee7f611 --- /dev/null +++ b/CIM16/IEC61970/Wires/Line.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class Line(EquipmentContainer): + """Contains equipment beyond a substation belonging to a power transmission line.Contains equipment beyond a substation belonging to a power transmission line. + """ + + def __init__(self, Region=None, *args, **kw_args): + """Initialises a new 'Line' instance. + + @param Region: A Line can be contained by a SubGeographical Region. + """ + self._Region = None + self.Region = Region + + super(Line, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Region"] + _many_refs = [] + + def getRegion(self): + """A Line can be contained by a SubGeographical Region. + """ + return self._Region + + def setRegion(self, value): + if self._Region is not None: + filtered = [x for x in self.Region.Lines if x != self] + self._Region._Lines = filtered + + self._Region = value + if self._Region is not None: + if self not in self._Region._Lines: + self._Region._Lines.append(self) + + Region = property(getRegion, setRegion) + diff --git a/CIM16/IEC61970/Wires/LoadBreakSwitch.py b/CIM16/IEC61970/Wires/LoadBreakSwitch.py new file mode 100755 index 00000000..1a73d7be --- /dev/null +++ b/CIM16/IEC61970/Wires/LoadBreakSwitch.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.ProtectedSwitch import ProtectedSwitch + +class LoadBreakSwitch(ProtectedSwitch): + """A mechanical switching device capable of making, carrying, and breaking currents under normal operating conditions.A mechanical switching device capable of making, carrying, and breaking currents under normal operating conditions. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'LoadBreakSwitch' instance. + + """ + super(LoadBreakSwitch, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/MutualCoupling.py b/CIM16/IEC61970/Wires/MutualCoupling.py new file mode 100755 index 00000000..d5a2f0c6 --- /dev/null +++ b/CIM16/IEC61970/Wires/MutualCoupling.py @@ -0,0 +1,113 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class MutualCoupling(IdentifiedObject): + """This class represents the zero sequence line mutual coupling.This class represents the zero sequence line mutual coupling. + """ + + def __init__(self, distance12=0.0, distance11=0.0, r0=0.0, distance22=0.0, distance21=0.0, b0ch=0.0, x0=0.0, g0ch=0.0, First_Terminal=None, Second_Terminal=None, *args, **kw_args): + """Initialises a new 'MutualCoupling' instance. + + @param distance12: Distance from the first line's from specified terminal to end of coupled region + @param distance11: Distance from the first line's specified terminal to start of coupled region + @param r0: Zero sequence branch-to-branch mutual impedance coupling, resistance + @param distance22: Distance from the second line's specified terminal to end of coupled region + @param distance21: Distance from the second line's specified terminal to start of coupled region + @param b0ch: Zero sequence mutual coupling shunt (charging) susceptance, uniformly distributed, of the entire line section. + @param x0: Zero sequence branch-to-branch mutual impedance coupling, reactance + @param g0ch: Zero sequence mutual coupling shunt (charging) conductance, uniformly distributed, of the entire line section. + @param First_Terminal: The starting terminal for the calculation of distances along the first branch of the mutual coupling. Normally MutualCoupling would only be used for terminals of AC line segments. The first and second terminals of a mutual coupling should point to different AC line segments. + @param Second_Terminal: The starting terminal for the calculation of distances along the second branch of the mutual coupling. + """ + #: Distance from the first line's from specified terminal to end of coupled region + self.distance12 = distance12 + + #: Distance from the first line's specified terminal to start of coupled region + self.distance11 = distance11 + + #: Zero sequence branch-to-branch mutual impedance coupling, resistance + self.r0 = r0 + + #: Distance from the second line's specified terminal to end of coupled region + self.distance22 = distance22 + + #: Distance from the second line's specified terminal to start of coupled region + self.distance21 = distance21 + + #: Zero sequence mutual coupling shunt (charging) susceptance, uniformly distributed, of the entire line section. + self.b0ch = b0ch + + #: Zero sequence branch-to-branch mutual impedance coupling, reactance + self.x0 = x0 + + #: Zero sequence mutual coupling shunt (charging) conductance, uniformly distributed, of the entire line section. + self.g0ch = g0ch + + self._First_Terminal = None + self.First_Terminal = First_Terminal + + self._Second_Terminal = None + self.Second_Terminal = Second_Terminal + + super(MutualCoupling, self).__init__(*args, **kw_args) + + _attrs = ["distance12", "distance11", "r0", "distance22", "distance21", "b0ch", "x0", "g0ch"] + _attr_types = {"distance12": float, "distance11": float, "r0": float, "distance22": float, "distance21": float, "b0ch": float, "x0": float, "g0ch": float} + _defaults = {"distance12": 0.0, "distance11": 0.0, "r0": 0.0, "distance22": 0.0, "distance21": 0.0, "b0ch": 0.0, "x0": 0.0, "g0ch": 0.0} + _enums = {} + _refs = ["First_Terminal", "Second_Terminal"] + _many_refs = [] + + def getFirst_Terminal(self): + """The starting terminal for the calculation of distances along the first branch of the mutual coupling. Normally MutualCoupling would only be used for terminals of AC line segments. The first and second terminals of a mutual coupling should point to different AC line segments. + """ + return self._First_Terminal + + def setFirst_Terminal(self, value): + if self._First_Terminal is not None: + filtered = [x for x in self.First_Terminal.HasFirst_MutualCoupling if x != self] + self._First_Terminal._HasFirst_MutualCoupling = filtered + + self._First_Terminal = value + if self._First_Terminal is not None: + if self not in self._First_Terminal._HasFirst_MutualCoupling: + self._First_Terminal._HasFirst_MutualCoupling.append(self) + + First_Terminal = property(getFirst_Terminal, setFirst_Terminal) + + def getSecond_Terminal(self): + """The starting terminal for the calculation of distances along the second branch of the mutual coupling. + """ + return self._Second_Terminal + + def setSecond_Terminal(self, value): + if self._Second_Terminal is not None: + filtered = [x for x in self.Second_Terminal.HasSecond_MutualCoupling if x != self] + self._Second_Terminal._HasSecond_MutualCoupling = filtered + + self._Second_Terminal = value + if self._Second_Terminal is not None: + if self not in self._Second_Terminal._HasSecond_MutualCoupling: + self._Second_Terminal._HasSecond_MutualCoupling.append(self) + + Second_Terminal = property(getSecond_Terminal, setSecond_Terminal) + diff --git a/CIM16/IEC61970/Wires/PerLengthPhaseImpedance.py b/CIM16/IEC61970/Wires/PerLengthPhaseImpedance.py new file mode 100755 index 00000000..f404a556 --- /dev/null +++ b/CIM16/IEC61970/Wires/PerLengthPhaseImpedance.py @@ -0,0 +1,95 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PerLengthPhaseImpedance(IdentifiedObject): + """Impedance and admittance parameters per unit length for n-wire unbalanced lines, in matrix form.Impedance and admittance parameters per unit length for n-wire unbalanced lines, in matrix form. + """ + + def __init__(self, conductorCount=0, LineSegments=None, PhaseImpedanceData=None, *args, **kw_args): + """Initialises a new 'PerLengthPhaseImpedance' instance. + + @param conductorCount: Number of phase, neutral, and other wires retained. Constrains the number of matrix elements and the phase codes that can be used with this matrix. + @param LineSegments: All line segments described by this phase impedance. + @param PhaseImpedanceData: All data that belong to this conductor phase impedance. + """ + #: Number of phase, neutral, and other wires retained. Constrains the number of matrix elements and the phase codes that can be used with this matrix. + self.conductorCount = conductorCount + + self._LineSegments = [] + self.LineSegments = [] if LineSegments is None else LineSegments + + self._PhaseImpedanceData = [] + self.PhaseImpedanceData = [] if PhaseImpedanceData is None else PhaseImpedanceData + + super(PerLengthPhaseImpedance, self).__init__(*args, **kw_args) + + _attrs = ["conductorCount"] + _attr_types = {"conductorCount": int} + _defaults = {"conductorCount": 0} + _enums = {} + _refs = ["LineSegments", "PhaseImpedanceData"] + _many_refs = ["LineSegments", "PhaseImpedanceData"] + + def getLineSegments(self): + """All line segments described by this phase impedance. + """ + return self._LineSegments + + def setLineSegments(self, value): + for x in self._LineSegments: + x.PhaseImpedance = None + for y in value: + y._PhaseImpedance = self + self._LineSegments = value + + LineSegments = property(getLineSegments, setLineSegments) + + def addLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.PhaseImpedance = self + + def removeLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.PhaseImpedance = None + + def getPhaseImpedanceData(self): + """All data that belong to this conductor phase impedance. + """ + return self._PhaseImpedanceData + + def setPhaseImpedanceData(self, value): + for x in self._PhaseImpedanceData: + x.PhaseImpedance = None + for y in value: + y._PhaseImpedance = self + self._PhaseImpedanceData = value + + PhaseImpedanceData = property(getPhaseImpedanceData, setPhaseImpedanceData) + + def addPhaseImpedanceData(self, *PhaseImpedanceData): + for obj in PhaseImpedanceData: + obj.PhaseImpedance = self + + def removePhaseImpedanceData(self, *PhaseImpedanceData): + for obj in PhaseImpedanceData: + obj.PhaseImpedance = None + diff --git a/CIM16/IEC61970/Wires/PerLengthSequenceImpedance.py b/CIM16/IEC61970/Wires/PerLengthSequenceImpedance.py new file mode 100755 index 00000000..fd84f570 --- /dev/null +++ b/CIM16/IEC61970/Wires/PerLengthSequenceImpedance.py @@ -0,0 +1,97 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PerLengthSequenceImpedance(IdentifiedObject): + """Sequence impedance and admittance parameters per unit length, for transposed lines of 1, 2, or 3 phases. For 1-phase lines, define x=x0=xself. For 2-phase lines, define x=xs-xm and x0=xs+xm.Sequence impedance and admittance parameters per unit length, for transposed lines of 1, 2, or 3 phases. For 1-phase lines, define x=x0=xself. For 2-phase lines, define x=xs-xm and x0=xs+xm. + """ + + def __init__(self, x=0.0, r=0.0, bch=0.0, r0=0.0, g0ch=0.0, b0ch=0.0, gch=0.0, x0=0.0, LineSegments=None, *args, **kw_args): + """Initialises a new 'PerLengthSequenceImpedance' instance. + + @param x: Positive sequence series reactance, per unit of length. + @param r: Positive sequence series resistance, per unit of length. + @param bch: Positive sequence shunt (charging) susceptance, per unit of length. + @param r0: Zero sequence series resistance, per unit of length. + @param g0ch: Zero sequence shunt (charging) conductance, per unit of length. + @param b0ch: Zero sequence shunt (charging) susceptance, per unit of length. + @param gch: Positive sequence shunt (charging) conductance, per unit of length. + @param x0: Zero sequence series reactance, per unit of length. + @param LineSegments: All line segments described by this sequence impedance. + """ + #: Positive sequence series reactance, per unit of length. + self.x = x + + #: Positive sequence series resistance, per unit of length. + self.r = r + + #: Positive sequence shunt (charging) susceptance, per unit of length. + self.bch = bch + + #: Zero sequence series resistance, per unit of length. + self.r0 = r0 + + #: Zero sequence shunt (charging) conductance, per unit of length. + self.g0ch = g0ch + + #: Zero sequence shunt (charging) susceptance, per unit of length. + self.b0ch = b0ch + + #: Positive sequence shunt (charging) conductance, per unit of length. + self.gch = gch + + #: Zero sequence series reactance, per unit of length. + self.x0 = x0 + + self._LineSegments = [] + self.LineSegments = [] if LineSegments is None else LineSegments + + super(PerLengthSequenceImpedance, self).__init__(*args, **kw_args) + + _attrs = ["x", "r", "bch", "r0", "g0ch", "b0ch", "gch", "x0"] + _attr_types = {"x": float, "r": float, "bch": float, "r0": float, "g0ch": float, "b0ch": float, "gch": float, "x0": float} + _defaults = {"x": 0.0, "r": 0.0, "bch": 0.0, "r0": 0.0, "g0ch": 0.0, "b0ch": 0.0, "gch": 0.0, "x0": 0.0} + _enums = {} + _refs = ["LineSegments"] + _many_refs = ["LineSegments"] + + def getLineSegments(self): + """All line segments described by this sequence impedance. + """ + return self._LineSegments + + def setLineSegments(self, value): + for x in self._LineSegments: + x.SequenceImpedance = None + for y in value: + y._SequenceImpedance = self + self._LineSegments = value + + LineSegments = property(getLineSegments, setLineSegments) + + def addLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.SequenceImpedance = self + + def removeLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.SequenceImpedance = None + diff --git a/CIM16/IEC61970/Wires/PhaseImpedanceData.py b/CIM16/IEC61970/Wires/PhaseImpedanceData.py new file mode 100755 index 00000000..45a3ef2a --- /dev/null +++ b/CIM16/IEC61970/Wires/PhaseImpedanceData.py @@ -0,0 +1,76 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class PhaseImpedanceData(Element): + """Triplet of resistance, reactance, and susceptance matrix element values.Triplet of resistance, reactance, and susceptance matrix element values. + """ + + def __init__(self, r=0.0, x=0.0, b=0.0, sequenceNumber=0, PhaseImpedance=None, *args, **kw_args): + """Initialises a new 'PhaseImpedanceData' instance. + + @param r: Resistance matrix element value, per length of unit. + @param x: Reactance matrix element value, per length of unit. + @param b: Susceptance matrix element value, per length of unit. + @param sequenceNumber: Column-wise element index, assuming a symmetrical matrix. Ranges from 1 to N + N*(N-1)/2. + @param PhaseImpedance: Conductor phase impedance to which this data belongs. + """ + #: Resistance matrix element value, per length of unit. + self.r = r + + #: Reactance matrix element value, per length of unit. + self.x = x + + #: Susceptance matrix element value, per length of unit. + self.b = b + + #: Column-wise element index, assuming a symmetrical matrix. Ranges from 1 to N + N*(N-1)/2. + self.sequenceNumber = sequenceNumber + + self._PhaseImpedance = None + self.PhaseImpedance = PhaseImpedance + + super(PhaseImpedanceData, self).__init__(*args, **kw_args) + + _attrs = ["r", "x", "b", "sequenceNumber"] + _attr_types = {"r": float, "x": float, "b": float, "sequenceNumber": int} + _defaults = {"r": 0.0, "x": 0.0, "b": 0.0, "sequenceNumber": 0} + _enums = {} + _refs = ["PhaseImpedance"] + _many_refs = [] + + def getPhaseImpedance(self): + """Conductor phase impedance to which this data belongs. + """ + return self._PhaseImpedance + + def setPhaseImpedance(self, value): + if self._PhaseImpedance is not None: + filtered = [x for x in self.PhaseImpedance.PhaseImpedanceData if x != self] + self._PhaseImpedance._PhaseImpedanceData = filtered + + self._PhaseImpedance = value + if self._PhaseImpedance is not None: + if self not in self._PhaseImpedance._PhaseImpedanceData: + self._PhaseImpedance._PhaseImpedanceData.append(self) + + PhaseImpedance = property(getPhaseImpedance, setPhaseImpedance) + diff --git a/CIM16/IEC61970/Wires/PhaseTapChanger.py b/CIM16/IEC61970/Wires/PhaseTapChanger.py new file mode 100755 index 00000000..2a2a5e51 --- /dev/null +++ b/CIM16/IEC61970/Wires/PhaseTapChanger.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.TapChanger import TapChanger + +class PhaseTapChanger(TapChanger): + """A PhaseTapChanger controls the phase angle difference across the power transformer and hence the activer power flow through it. A PhaseTapChanger may also impact the voltage magnitude.A PhaseTapChanger controls the phase angle difference across the power transformer and hence the activer power flow through it. A PhaseTapChanger may also impact the voltage magnitude. + """ + + def __init__(self, PhaseTapChangerTabular=None, TransformerEnd=None, *args, **kw_args): + """Initialises a new 'PhaseTapChanger' instance. + + @param PhaseTapChangerTabular: + @param TransformerEnd: Transformer end to which this phase tap changer belongs. + """ + self._PhaseTapChangerTabular = None + self.PhaseTapChangerTabular = PhaseTapChangerTabular + + self._TransformerEnd = None + self.TransformerEnd = TransformerEnd + + super(PhaseTapChanger, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["PhaseTapChangerTabular", "TransformerEnd"] + _many_refs = [] + + def getPhaseTapChangerTabular(self): + + return self._PhaseTapChangerTabular + + def setPhaseTapChangerTabular(self, value): + if self._PhaseTapChangerTabular is not None: + filtered = [x for x in self.PhaseTapChangerTabular.PhaseTapChanger if x != self] + self._PhaseTapChangerTabular._PhaseTapChanger = filtered + + self._PhaseTapChangerTabular = value + if self._PhaseTapChangerTabular is not None: + if self not in self._PhaseTapChangerTabular._PhaseTapChanger: + self._PhaseTapChangerTabular._PhaseTapChanger.append(self) + + PhaseTapChangerTabular = property(getPhaseTapChangerTabular, setPhaseTapChangerTabular) + + def getTransformerEnd(self): + """Transformer end to which this phase tap changer belongs. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + if self._TransformerEnd is not None: + self._TransformerEnd._PhaseTapChanger = None + + self._TransformerEnd = value + if self._TransformerEnd is not None: + self._TransformerEnd.PhaseTapChanger = None + self._TransformerEnd._PhaseTapChanger = self + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + diff --git a/CIM16/IEC61970/Wires/PhaseTapChangerAsymetrical.py b/CIM16/IEC61970/Wires/PhaseTapChangerAsymetrical.py new file mode 100755 index 00000000..b6489e57 --- /dev/null +++ b/CIM16/IEC61970/Wires/PhaseTapChangerAsymetrical.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.PhaseTapChangerNonLinear import PhaseTapChangerNonLinear + +class PhaseTapChangerAsymetrical(PhaseTapChangerNonLinear): + """In a PhaseTapChangerAsymetrical tranformer the difference voltage vector adds to the primary side voltage. The angle between the primary side voltage and the difference voltage is named the winding connection angle. The phase shift, α, depends on both the difference voltage magnitude, ΔU, and the winding connection angle.In a PhaseTapChangerAsymetrical tranformer the difference voltage vector adds to the primary side voltage. The angle between the primary side voltage and the difference voltage is named the winding connection angle. The phase shift, α, depends on both the difference voltage magnitude, ΔU, and the winding connection angle. + """ + + def __init__(self, windingConnectionAngle=0.0, *args, **kw_args): + """Initialises a new 'PhaseTapChangerAsymetrical' instance. + + @param windingConnectionAngle: The phase angle between the in-phase winding and the out-of -phase winding used for creating phase shift. It is only possible to have a symmemtrical transformer if this angle is 90 degrees. + """ + #: The phase angle between the in-phase winding and the out-of -phase winding used for creating phase shift. It is only possible to have a symmemtrical transformer if this angle is 90 degrees. + self.windingConnectionAngle = windingConnectionAngle + + super(PhaseTapChangerAsymetrical, self).__init__(*args, **kw_args) + + _attrs = ["windingConnectionAngle"] + _attr_types = {"windingConnectionAngle": float} + _defaults = {"windingConnectionAngle": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/PhaseTapChangerLinear.py b/CIM16/IEC61970/Wires/PhaseTapChangerLinear.py new file mode 100755 index 00000000..40c9d531 --- /dev/null +++ b/CIM16/IEC61970/Wires/PhaseTapChangerLinear.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.PhaseTapChanger import PhaseTapChanger + +class PhaseTapChangerLinear(PhaseTapChanger): + """PhaseTapChangerLinear describes a linear relation between the tap step and the phase angle difference across the transformer. This is a mathematical model that is an approximation of a real phase tap changer.PhaseTapChangerLinear describes a linear relation between the tap step and the phase angle difference across the transformer. This is a mathematical model that is an approximation of a real phase tap changer. + """ + + def __init__(self, stepPhaseShiftIncrement=0.0, *args, **kw_args): + """Initialises a new 'PhaseTapChangerLinear' instance. + + @param stepPhaseShiftIncrement: Phase shift per step position. A positive value indicates a positive phase shift from the winding where the tap is located to the other winding (for a two-winding transformer). The actual phase shift increment might be more accurately computed from the symmetrical or asymmetrical models or a tap step table lookup if those are available. + """ + #: Phase shift per step position. A positive value indicates a positive phase shift from the winding where the tap is located to the other winding (for a two-winding transformer). The actual phase shift increment might be more accurately computed from the symmetrical or asymmetrical models or a tap step table lookup if those are available. + self.stepPhaseShiftIncrement = stepPhaseShiftIncrement + + super(PhaseTapChangerLinear, self).__init__(*args, **kw_args) + + _attrs = ["stepPhaseShiftIncrement"] + _attr_types = {"stepPhaseShiftIncrement": float} + _defaults = {"stepPhaseShiftIncrement": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/PhaseTapChangerNonLinear.py b/CIM16/IEC61970/Wires/PhaseTapChangerNonLinear.py new file mode 100755 index 00000000..b71144a9 --- /dev/null +++ b/CIM16/IEC61970/Wires/PhaseTapChangerNonLinear.py @@ -0,0 +1,51 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.PhaseTapChanger import PhaseTapChanger + +class PhaseTapChangerNonLinear(PhaseTapChanger): + """PhaseTapChangerNonLinear describe the non linear behavior of a phase tap changer. This is a base class for the symmetrical and asymmetrical models. The details of these models can be found in the IEC 61970-301 document.PhaseTapChangerNonLinear describe the non linear behavior of a phase tap changer. This is a base class for the symmetrical and asymmetrical models. The details of these models can be found in the IEC 61970-301 document. + """ + + def __init__(self, xMedian=0.0, voltageStepIncrement=0.0, xMax=0.0, *args, **kw_args): + """Initialises a new 'PhaseTapChangerNonLinear' instance. + + @param xMedian: The reactance at the mid tap step. + @param voltageStepIncrement: The voltage step increment on the out of phase winding. This voltage step on the out of phase winding of the phase shifter. + @param xMax: The reactance at the maximum tap step. + """ + #: The reactance at the mid tap step. + self.xMedian = xMedian + + #: The voltage step increment on the out of phase winding. This voltage step on the out of phase winding of the phase shifter. + self.voltageStepIncrement = voltageStepIncrement + + #: The reactance at the maximum tap step. + self.xMax = xMax + + super(PhaseTapChangerNonLinear, self).__init__(*args, **kw_args) + + _attrs = ["xMedian", "voltageStepIncrement", "xMax"] + _attr_types = {"xMedian": float, "voltageStepIncrement": float, "xMax": float} + _defaults = {"xMedian": 0.0, "voltageStepIncrement": 0.0, "xMax": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/PhaseTapChangerSymetrical.py b/CIM16/IEC61970/Wires/PhaseTapChangerSymetrical.py new file mode 100755 index 00000000..fa9a90d6 --- /dev/null +++ b/CIM16/IEC61970/Wires/PhaseTapChangerSymetrical.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.PhaseTapChangerNonLinear import PhaseTapChangerNonLinear + +class PhaseTapChangerSymetrical(PhaseTapChangerNonLinear): + """In a PhaseTapChangerSymetrical tranformer the secondary side voltage magnitude is the same as at the primary side. The difference voltage magnitude, ΔU, is the base in an equal-sided triangle where the sides corresponds to the primary and secondary voltages. The phase angle difference correpsonds the top angle and can be expressed as follows α = 2arctan(ΔU/2)In a PhaseTapChangerSymetrical tranformer the secondary side voltage magnitude is the same as at the primary side. The difference voltage magnitude, ΔU, is the base in an equal-sided triangle where the sides corresponds to the primary and secondary voltages. The phase angle difference correpsonds the top angle and can be expressed as follows α = 2arctan(ΔU/2) + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'PhaseTapChangerSymetrical' instance. + + """ + super(PhaseTapChangerSymetrical, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/PhaseTapChangerTabular.py b/CIM16/IEC61970/Wires/PhaseTapChangerTabular.py new file mode 100755 index 00000000..fb179427 --- /dev/null +++ b/CIM16/IEC61970/Wires/PhaseTapChangerTabular.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class PhaseTapChangerTabular(Element): + """With PhaseTapChangerTabular it is possible to describe curve how the the phase angle difference and reactance varies with the tap step.With PhaseTapChangerTabular it is possible to describe curve how the the phase angle difference and reactance varies with the tap step. + """ + + def __init__(self, PhaseTapChangerTabularPoint=None, PhaseTapChanger=None, *args, **kw_args): + """Initialises a new 'PhaseTapChangerTabular' instance. + + @param PhaseTapChangerTabularPoint: + @param PhaseTapChanger: + """ + self._PhaseTapChangerTabularPoint = [] + self.PhaseTapChangerTabularPoint = [] if PhaseTapChangerTabularPoint is None else PhaseTapChangerTabularPoint + + self._PhaseTapChanger = [] + self.PhaseTapChanger = [] if PhaseTapChanger is None else PhaseTapChanger + + super(PhaseTapChangerTabular, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["PhaseTapChangerTabularPoint", "PhaseTapChanger"] + _many_refs = ["PhaseTapChangerTabularPoint", "PhaseTapChanger"] + + def getPhaseTapChangerTabularPoint(self): + + return self._PhaseTapChangerTabularPoint + + def setPhaseTapChangerTabularPoint(self, value): + for x in self._PhaseTapChangerTabularPoint: + x.PhaseTapChangerTabular = None + for y in value: + y._PhaseTapChangerTabular = self + self._PhaseTapChangerTabularPoint = value + + PhaseTapChangerTabularPoint = property(getPhaseTapChangerTabularPoint, setPhaseTapChangerTabularPoint) + + def addPhaseTapChangerTabularPoint(self, *PhaseTapChangerTabularPoint): + for obj in PhaseTapChangerTabularPoint: + obj.PhaseTapChangerTabular = self + + def removePhaseTapChangerTabularPoint(self, *PhaseTapChangerTabularPoint): + for obj in PhaseTapChangerTabularPoint: + obj.PhaseTapChangerTabular = None + + def getPhaseTapChanger(self): + + return self._PhaseTapChanger + + def setPhaseTapChanger(self, value): + for x in self._PhaseTapChanger: + x.PhaseTapChangerTabular = None + for y in value: + y._PhaseTapChangerTabular = self + self._PhaseTapChanger = value + + PhaseTapChanger = property(getPhaseTapChanger, setPhaseTapChanger) + + def addPhaseTapChanger(self, *PhaseTapChanger): + for obj in PhaseTapChanger: + obj.PhaseTapChangerTabular = self + + def removePhaseTapChanger(self, *PhaseTapChanger): + for obj in PhaseTapChanger: + obj.PhaseTapChangerTabular = None + diff --git a/CIM16/IEC61970/Wires/PhaseTapChangerTabularPoint.py b/CIM16/IEC61970/Wires/PhaseTapChangerTabularPoint.py new file mode 100755 index 00000000..6daab27c --- /dev/null +++ b/CIM16/IEC61970/Wires/PhaseTapChangerTabularPoint.py @@ -0,0 +1,71 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class PhaseTapChangerTabularPoint(Element): + """PhaseTapChangerTabularPoint describe each tap step in the curve.PhaseTapChangerTabularPoint describe each tap step in the curve. + """ + + def __init__(self, x=0.0, step=0, angle=0.0, PhaseTapChangerTabular=None, *args, **kw_args): + """Initialises a new 'PhaseTapChangerTabularPoint' instance. + + @param x: The reactance deviation in percent of nominal value. The actual reactance is calculated as follows xcal = xnom(1 + x/100). + @param step: The tap step. + @param angle: The angle difference in degrees. + @param PhaseTapChangerTabular: + """ + #: The reactance deviation in percent of nominal value. The actual reactance is calculated as follows xcal = xnom(1 + x/100). + self.x = x + + #: The tap step. + self.step = step + + #: The angle difference in degrees. + self.angle = angle + + self._PhaseTapChangerTabular = None + self.PhaseTapChangerTabular = PhaseTapChangerTabular + + super(PhaseTapChangerTabularPoint, self).__init__(*args, **kw_args) + + _attrs = ["x", "step", "angle"] + _attr_types = {"x": float, "step": int, "angle": float} + _defaults = {"x": 0.0, "step": 0, "angle": 0.0} + _enums = {} + _refs = ["PhaseTapChangerTabular"] + _many_refs = [] + + def getPhaseTapChangerTabular(self): + + return self._PhaseTapChangerTabular + + def setPhaseTapChangerTabular(self, value): + if self._PhaseTapChangerTabular is not None: + filtered = [x for x in self.PhaseTapChangerTabular.PhaseTapChangerTabularPoint if x != self] + self._PhaseTapChangerTabular._PhaseTapChangerTabularPoint = filtered + + self._PhaseTapChangerTabular = value + if self._PhaseTapChangerTabular is not None: + if self not in self._PhaseTapChangerTabular._PhaseTapChangerTabularPoint: + self._PhaseTapChangerTabular._PhaseTapChangerTabularPoint.append(self) + + PhaseTapChangerTabular = property(getPhaseTapChangerTabular, setPhaseTapChangerTabular) + diff --git a/CIM16/IEC61970/Wires/Plant.py b/CIM16/IEC61970/Wires/Plant.py new file mode 100755 index 00000000..b9e53140 --- /dev/null +++ b/CIM16/IEC61970/Wires/Plant.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class Plant(EquipmentContainer): + """A Plant is a collection of equipment for purposes of generation.A Plant is a collection of equipment for purposes of generation. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Plant' instance. + + """ + super(Plant, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/PowerTransformer.py b/CIM16/IEC61970/Wires/PowerTransformer.py new file mode 100755 index 00000000..13c8022d --- /dev/null +++ b/CIM16/IEC61970/Wires/PowerTransformer.py @@ -0,0 +1,115 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class PowerTransformer(ConductingEquipment): + """An electrical device consisting of two or more coupled windings, with or without a magnetic core, for introducing mutual coupling between electric circuits. Transformers can be used to control voltage and phase shift (active power flow). A power transformer may be composed of separate transformer tanks that need not be identical. The same power transformer can be modelled in two ways, namely with and without tanks:
  1. The power transformer that uses power transformer ends directly (without tanks) is suitable for balanced three-phase models. This is typical for transmission and sub-transmission network modelling. Such a transformer will require one power transformer end for each physical winding. There must be a one-to-one association between PowerTransformerEnd and Core::Terminal.
  2. The power transformer that uses transformer tanks is suitable for an unbalanced transformer, a balanced transformer within a single tank, or a balanced transformer made up of three tanks. This is typical for distribution network modelling and the only choice when modelling an unbalanced transformer, or a transformer that has more than three windings. Power transformer modelled with tanks will require for each tank, one transformer tank end per physical winding in the tank. There may be one, two, or three phases in the transformer tank end. Examples: 3 phases for 3-phase delta or wye connected windings, 2 for one phase-to-phase winding, and 1 for a phase-to-neutral or phase-to-ground winding. With 1 or 2 phases, more than one transformer tank end may be associated to the same 3-phase Core::Terminal instance, while with 3 phases there should be a one-to-one association.
This power transformer model is flexible in order to support different kinds of data exchange requirements. There are 5 possible ways to combine available classes and their attributes:
  1. Instance parameters - Use the r, x, r0, x0, b, b0, g, and g0 attributes on PowerTransformerEnd and ignore related TransformerStarImpedance, TransformerMeshImpedance, or TransformerCoreAdmittance. This option assumes a star connection of the series impedances. It is suitable for typical transmission, balanced three-phase transformer models, for transformers with 2 or three windings.
  2. Star instance parameters by association - Instead of the r, x, r0, x0, b, b0, g, and g0 attributes, use associations to TransformerStarImpedance and TransformerCoreAdmitance. This option is suitable in same scenarios as option 1, but when catalogue data is available for transformers.
  3. Mesh instance parameters by association: Instead of the r, x, r0, x0, b, b0, g, and g0 attributes, use associations to TransformerMeshImpedance and TransformerCoreAdmittance. This option supports transformers with more than three windings.
  4. Catalog mesh parameters by association - Instead of attributes r, x, r0, x0, b, b0, g, and g0 and associations to TransformerStarImpedance, TransformerMeshImpedance, or TransformerCoreAdmittance, use the association to TransformerEndInfo. The TransformerEnd.endNumber should match the corresponding TransformerEndInfo.endNumber, following the IEC standard convention of numbering from the highest voltage ends to the lowest, starting at 1. This matching supports higher-level use of a catalog, through just one association between TransformerTank and TransformerTankInfo, with simpler exchanges and incremental updates. The associated TransformerEndInfo will have associations to TransformerMeshImpedance and TransformerCoreAdmittance. This option supports unbalanced transformer, with more than three windings and is suitable whenever the transformer test data has been converted to an electrical model.
  5. Catalog test data by association - This is the same as option 4, except TransformerEndInfo will have associations to AssetModels::TransformerTest decendents, instead of to TransformerMeshImpedance and TransformerCoreAdmittance. This option is suitable when the test data is available, and the receiving application is able to interpret the test data.
Every profile should specify which one or more of these options are supported.An electrical device consisting of two or more coupled windings, with or without a magnetic core, for introducing mutual coupling between electric circuits. Transformers can be used to control voltage and phase shift (active power flow). A power transformer may be composed of separate transformer tanks that need not be identical. The same power transformer can be modelled in two ways, namely with and without tanks:
  1. The power transformer that uses power transformer ends directly (without tanks) is suitable for balanced three-phase models. This is typical for transmission and sub-transmission network modelling. Such a transformer will require one power transformer end for each physical winding. There must be a one-to-one association between PowerTransformerEnd and Core::Terminal.
  2. The power transformer that uses transformer tanks is suitable for an unbalanced transformer, a balanced transformer within a single tank, or a balanced transformer made up of three tanks. This is typical for distribution network modelling and the only choice when modelling an unbalanced transformer, or a transformer that has more than three windings. Power transformer modelled with tanks will require for each tank, one transformer tank end per physical winding in the tank. There may be one, two, or three phases in the transformer tank end. Examples: 3 phases for 3-phase delta or wye connected windings, 2 for one phase-to-phase winding, and 1 for a phase-to-neutral or phase-to-ground winding. With 1 or 2 phases, more than one transformer tank end may be associated to the same 3-phase Core::Terminal instance, while with 3 phases there should be a one-to-one association.
This power transformer model is flexible in order to support different kinds of data exchange requirements. There are 5 possible ways to combine available classes and their attributes:
  1. Instance parameters - Use the r, x, r0, x0, b, b0, g, and g0 attributes on PowerTransformerEnd and ignore related TransformerStarImpedance, TransformerMeshImpedance, or TransformerCoreAdmittance. This option assumes a star connection of the series impedances. It is suitable for typical transmission, balanced three-phase transformer models, for transformers with 2 or three windings.
  2. Star instance parameters by association - Instead of the r, x, r0, x0, b, b0, g, and g0 attributes, use associations to TransformerStarImpedance and TransformerCoreAdmitance. This option is suitable in same scenarios as option 1, but when catalogue data is available for transformers.
  3. Mesh instance parameters by association: Instead of the r, x, r0, x0, b, b0, g, and g0 attributes, use associations to TransformerMeshImpedance and TransformerCoreAdmittance. This option supports transformers with more than three windings.
  4. Catalog mesh parameters by association - Instead of attributes r, x, r0, x0, b, b0, g, and g0 and associations to TransformerStarImpedance, TransformerMeshImpedance, or TransformerCoreAdmittance, use the association to TransformerEndInfo. The TransformerEnd.endNumber should match the corresponding TransformerEndInfo.endNumber, following the IEC standard convention of numbering from the highest voltage ends to the lowest, starting at 1. This matching supports higher-level use of a catalog, through just one association between TransformerTank and TransformerTankInfo, with simpler exchanges and incremental updates. The associated TransformerEndInfo will have associations to TransformerMeshImpedance and TransformerCoreAdmittance. This option supports unbalanced transformer, with more than three windings and is suitable whenever the transformer test data has been converted to an electrical model.
  5. Catalog test data by association - This is the same as option 4, except TransformerEndInfo will have associations to AssetModels::TransformerTest decendents, instead of to TransformerMeshImpedance and TransformerCoreAdmittance. This option is suitable when the test data is available, and the receiving application is able to interpret the test data.
Every profile should specify which one or more of these options are supported. + """ + + def __init__(self, vectorGroup='', TransformerTanks=None, PowerTransformerInfo=None, PowerTransformerEnd=None, *args, **kw_args): + """Initialises a new 'PowerTransformer' instance. + + @param vectorGroup: Vector group of the transformer for protective relaying, e.g., Dyn1. For unbalanced transformers, this may not be simply determined from the constituent winding connections. + @param TransformerTanks: All transformers that belong to this bank. + @param PowerTransformerInfo: Power transformer data. + @param PowerTransformerEnd: + """ + #: Vector group of the transformer for protective relaying, e.g., Dyn1. For unbalanced transformers, this may not be simply determined from the constituent winding connections. + self.vectorGroup = vectorGroup + + self._TransformerTanks = [] + self.TransformerTanks = [] if TransformerTanks is None else TransformerTanks + + self._PowerTransformerInfo = None + self.PowerTransformerInfo = PowerTransformerInfo + + self._PowerTransformerEnd = [] + self.PowerTransformerEnd = [] if PowerTransformerEnd is None else PowerTransformerEnd + + super(PowerTransformer, self).__init__(*args, **kw_args) + + _attrs = ["vectorGroup"] + _attr_types = {"vectorGroup": str} + _defaults = {"vectorGroup": ''} + _enums = {} + _refs = ["TransformerTanks", "PowerTransformerInfo", "PowerTransformerEnd"] + _many_refs = ["TransformerTanks", "PowerTransformerEnd"] + + def getTransformerTanks(self): + """All transformers that belong to this bank. + """ + return self._TransformerTanks + + def setTransformerTanks(self, value): + for x in self._TransformerTanks: + x.PowerTransformer = None + for y in value: + y._PowerTransformer = self + self._TransformerTanks = value + + TransformerTanks = property(getTransformerTanks, setTransformerTanks) + + def addTransformerTanks(self, *TransformerTanks): + for obj in TransformerTanks: + obj.PowerTransformer = self + + def removeTransformerTanks(self, *TransformerTanks): + for obj in TransformerTanks: + obj.PowerTransformer = None + + def getPowerTransformerInfo(self): + """Power transformer data. + """ + return self._PowerTransformerInfo + + def setPowerTransformerInfo(self, value): + if self._PowerTransformerInfo is not None: + filtered = [x for x in self.PowerTransformerInfo.PowerTransformers if x != self] + self._PowerTransformerInfo._PowerTransformers = filtered + + self._PowerTransformerInfo = value + if self._PowerTransformerInfo is not None: + if self not in self._PowerTransformerInfo._PowerTransformers: + self._PowerTransformerInfo._PowerTransformers.append(self) + + PowerTransformerInfo = property(getPowerTransformerInfo, setPowerTransformerInfo) + + def getPowerTransformerEnd(self): + + return self._PowerTransformerEnd + + def setPowerTransformerEnd(self, value): + for x in self._PowerTransformerEnd: + x.PowerTransformer = None + for y in value: + y._PowerTransformer = self + self._PowerTransformerEnd = value + + PowerTransformerEnd = property(getPowerTransformerEnd, setPowerTransformerEnd) + + def addPowerTransformerEnd(self, *PowerTransformerEnd): + for obj in PowerTransformerEnd: + obj.PowerTransformer = self + + def removePowerTransformerEnd(self, *PowerTransformerEnd): + for obj in PowerTransformerEnd: + obj.PowerTransformer = None + diff --git a/CIM16/IEC61970/Wires/PowerTransformerEnd.py b/CIM16/IEC61970/Wires/PowerTransformerEnd.py new file mode 100755 index 00000000..6dd5f9ff --- /dev/null +++ b/CIM16/IEC61970/Wires/PowerTransformerEnd.py @@ -0,0 +1,103 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.TransformerEnd import TransformerEnd + +class PowerTransformerEnd(TransformerEnd): + """A PowerTransformerEnd is associated with each Terminal of a PowerTransformer. The impdedance values r, r0, x, and x0 of a PowerTransformerEnd represents a star equivalentas follows 1) for a two Terminal PowerTransformer the high voltage PowerTransformerEnd has non zero values on r, r0, x, and x0 while the low voltage PowerTransformerEnd has zero values for r, r0, x, and x0. 2) for a three Terminal PowerTransformer the three PowerTransformerEnds represents a star equivalent with each leg in the star represented by r, r0, x, and x0 values. 3) for a PowerTransformer with more than three Terminals the PowerTransformerEnd impedance values cannot be used. Instead use the TransformerMeshImpedance or split the transformer into multiple PowerTransformers.A PowerTransformerEnd is associated with each Terminal of a PowerTransformer. The impdedance values r, r0, x, and x0 of a PowerTransformerEnd represents a star equivalentas follows 1) for a two Terminal PowerTransformer the high voltage PowerTransformerEnd has non zero values on r, r0, x, and x0 while the low voltage PowerTransformerEnd has zero values for r, r0, x, and x0. 2) for a three Terminal PowerTransformer the three PowerTransformerEnds represents a star equivalent with each leg in the star represented by r, r0, x, and x0 values. 3) for a PowerTransformer with more than three Terminals the PowerTransformerEnd impedance values cannot be used. Instead use the TransformerMeshImpedance or split the transformer into multiple PowerTransformers. + """ + + def __init__(self, x0=0.0, b0=0.0, g0=0.0, ratedS=0.0, b=0.0, ratedU=0.0, g=0.0, r=0.0, x=0.0, r0=0.0, connectionKind="Z", PowerTransformer=None, *args, **kw_args): + """Initialises a new 'PowerTransformerEnd' instance. + + @param x0: Zero sequence series reactance of the transformer end. + @param b0: Zero sequence magnetizing branch susceptance. + @param g0: Zero sequence magnetizing branch conductance (star-model). + @param ratedS: Normal apparent power rating. + @param b: Magnetizing branch susceptance (B mag). The value can be positive or negative. + @param ratedU: Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings. + @param g: Magnetizing branch conductance (G mag). + @param r: Resistance (star-model) of the transformer end. + @param x: Positive sequence series reactance (star-model) of the transformer end. + @param r0: Zero sequence series resistance (star-model) of the transformer end. + @param connectionKind: Kind of connection. Values are: "Z", "A", "Yn", "Y", "Zn", "D", "I" + @param PowerTransformer: + """ + #: Zero sequence series reactance of the transformer end. + self.x0 = x0 + + #: Zero sequence magnetizing branch susceptance. + self.b0 = b0 + + #: Zero sequence magnetizing branch conductance (star-model). + self.g0 = g0 + + #: Normal apparent power rating. + self.ratedS = ratedS + + #: Magnetizing branch susceptance (B mag). The value can be positive or negative. + self.b = b + + #: Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings. + self.ratedU = ratedU + + #: Magnetizing branch conductance (G mag). + self.g = g + + #: Resistance (star-model) of the transformer end. + self.r = r + + #: Positive sequence series reactance (star-model) of the transformer end. + self.x = x + + #: Zero sequence series resistance (star-model) of the transformer end. + self.r0 = r0 + + #: Kind of connection. Values are: "Z", "A", "Yn", "Y", "Zn", "D", "I" + self.connectionKind = connectionKind + + self._PowerTransformer = None + self.PowerTransformer = PowerTransformer + + super(PowerTransformerEnd, self).__init__(*args, **kw_args) + + _attrs = ["x0", "b0", "g0", "ratedS", "b", "ratedU", "g", "r", "x", "r0", "connectionKind"] + _attr_types = {"x0": float, "b0": float, "g0": float, "ratedS": float, "b": float, "ratedU": float, "g": float, "r": float, "x": float, "r0": float, "connectionKind": str} + _defaults = {"x0": 0.0, "b0": 0.0, "g0": 0.0, "ratedS": 0.0, "b": 0.0, "ratedU": 0.0, "g": 0.0, "r": 0.0, "x": 0.0, "r0": 0.0, "connectionKind": "Z"} + _enums = {"connectionKind": "WindingConnection"} + _refs = ["PowerTransformer"] + _many_refs = [] + + def getPowerTransformer(self): + + return self._PowerTransformer + + def setPowerTransformer(self, value): + if self._PowerTransformer is not None: + filtered = [x for x in self.PowerTransformer.PowerTransformerEnd if x != self] + self._PowerTransformer._PowerTransformerEnd = filtered + + self._PowerTransformer = value + if self._PowerTransformer is not None: + if self not in self._PowerTransformer._PowerTransformerEnd: + self._PowerTransformer._PowerTransformerEnd.append(self) + + PowerTransformer = property(getPowerTransformer, setPowerTransformer) + diff --git a/CIM16/IEC61970/Wires/ProtectedSwitch.py b/CIM16/IEC61970/Wires/ProtectedSwitch.py new file mode 100755 index 00000000..beb441e1 --- /dev/null +++ b/CIM16/IEC61970/Wires/ProtectedSwitch.py @@ -0,0 +1,101 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.Switch import Switch + +class ProtectedSwitch(Switch): + """A ProtectedSwitch is a switching device that can be operated by ProtectionEquipment.A ProtectedSwitch is a switching device that can be operated by ProtectionEquipment. + """ + + def __init__(self, breakingCapacity=0.0, ProtectionEquipments=None, RecloseSequences=None, *args, **kw_args): + """Initialises a new 'ProtectedSwitch' instance. + + @param breakingCapacity: The maximum fault current a breaking device can break safely under prescribed conditions of use. + @param ProtectionEquipments: Protection equipments that operate this ProtectedSwitch. + @param RecloseSequences: A breaker may have zero or more automatic reclosures after a trip occurs. + """ + #: The maximum fault current a breaking device can break safely under prescribed conditions of use. + self.breakingCapacity = breakingCapacity + + self._ProtectionEquipments = [] + self.ProtectionEquipments = [] if ProtectionEquipments is None else ProtectionEquipments + + self._RecloseSequences = [] + self.RecloseSequences = [] if RecloseSequences is None else RecloseSequences + + super(ProtectedSwitch, self).__init__(*args, **kw_args) + + _attrs = ["breakingCapacity"] + _attr_types = {"breakingCapacity": float} + _defaults = {"breakingCapacity": 0.0} + _enums = {} + _refs = ["ProtectionEquipments", "RecloseSequences"] + _many_refs = ["ProtectionEquipments", "RecloseSequences"] + + def getProtectionEquipments(self): + """Protection equipments that operate this ProtectedSwitch. + """ + return self._ProtectionEquipments + + def setProtectionEquipments(self, value): + for p in self._ProtectionEquipments: + filtered = [q for q in p.ProtectedSwitches if q != self] + self._ProtectionEquipments._ProtectedSwitches = filtered + for r in value: + if self not in r._ProtectedSwitches: + r._ProtectedSwitches.append(self) + self._ProtectionEquipments = value + + ProtectionEquipments = property(getProtectionEquipments, setProtectionEquipments) + + def addProtectionEquipments(self, *ProtectionEquipments): + for obj in ProtectionEquipments: + if self not in obj._ProtectedSwitches: + obj._ProtectedSwitches.append(self) + self._ProtectionEquipments.append(obj) + + def removeProtectionEquipments(self, *ProtectionEquipments): + for obj in ProtectionEquipments: + if self in obj._ProtectedSwitches: + obj._ProtectedSwitches.remove(self) + self._ProtectionEquipments.remove(obj) + + def getRecloseSequences(self): + """A breaker may have zero or more automatic reclosures after a trip occurs. + """ + return self._RecloseSequences + + def setRecloseSequences(self, value): + for x in self._RecloseSequences: + x.ProtectedSwitch = None + for y in value: + y._ProtectedSwitch = self + self._RecloseSequences = value + + RecloseSequences = property(getRecloseSequences, setRecloseSequences) + + def addRecloseSequences(self, *RecloseSequences): + for obj in RecloseSequences: + obj.ProtectedSwitch = self + + def removeRecloseSequences(self, *RecloseSequences): + for obj in RecloseSequences: + obj.ProtectedSwitch = None + diff --git a/CIM16/IEC61970/Wires/RatioTapChanger.py b/CIM16/IEC61970/Wires/RatioTapChanger.py new file mode 100755 index 00000000..1ce31bba --- /dev/null +++ b/CIM16/IEC61970/Wires/RatioTapChanger.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.TapChanger import TapChanger + +class RatioTapChanger(TapChanger): + """A tap changer that changes the voltage ratio impacting the voltage magnitude but not the phase angle across the transformer.A tap changer that changes the voltage ratio impacting the voltage magnitude but not the phase angle across the transformer. + """ + + def __init__(self, stepVoltageIncrement=0.0, tculControlMode="reactive", RatioTapChangerTabular=None, TransformerEnd=None, step=0.0, *args, **kw_args): + """Initialises a new 'RatioTapChanger' instance. + + @param stepVoltageIncrement: Tap step increment, in per cent of nominal voltage, per step position. For a symmetrical PhaseTapChanger, the stepVoltageIncrement is used in the formula for calculation of the phase angle. For a symmetrical PhaseTapChanger, the voltage magnitude does not change with tap step. + @param tculControlMode: Specifies the regulation control mode (voltage or reactive) of the RatioTapChanger. Values are: "reactive", "volt" + @param RatioTapChangerTabular: + @param TransformerEnd: Transformer end to which this ratio tap changer belongs. + """ + #: Tap step increment, in per cent of nominal voltage, per step position. For a symmetrical PhaseTapChanger, the stepVoltageIncrement is used in the formula for calculation of the phase angle. For a symmetrical PhaseTapChanger, the voltage magnitude does not change with tap step. + self.stepVoltageIncrement = stepVoltageIncrement + + #: Specifies the regulation control mode (voltage or reactive) of the RatioTapChanger. Values are: "reactive", "volt" + self.tculControlMode = tculControlMode + + self._RatioTapChangerTabular = None + self.RatioTapChangerTabular = RatioTapChangerTabular + + self._TransformerEnd = None + self.TransformerEnd = TransformerEnd + + self.step = step + + super(RatioTapChanger, self).__init__(*args, **kw_args) + + _attrs = ["stepVoltageIncrement", "tculControlMode", "step"] + _attr_types = {"stepVoltageIncrement": float, "tculControlMode": str, "step": float} + _defaults = {"stepVoltageIncrement": 0.0, "tculControlMode": "reactive", "step": 0.0} + _enums = {"tculControlMode": "TransformerControlMode"} + _refs = ["RatioTapChangerTabular", "TransformerEnd"] + _many_refs = [] + + def getRatioTapChangerTabular(self): + + return self._RatioTapChangerTabular + + def setRatioTapChangerTabular(self, value): + if self._RatioTapChangerTabular is not None: + filtered = [x for x in self.RatioTapChangerTabular.RatioTapChanger if x != self] + self._RatioTapChangerTabular._RatioTapChanger = filtered + + self._RatioTapChangerTabular = value + if self._RatioTapChangerTabular is not None: + if self not in self._RatioTapChangerTabular._RatioTapChanger: + self._RatioTapChangerTabular._RatioTapChanger.append(self) + + RatioTapChangerTabular = property(getRatioTapChangerTabular, setRatioTapChangerTabular) + + def getTransformerEnd(self): + """Transformer end to which this ratio tap changer belongs. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + if self._TransformerEnd is not None: + self._TransformerEnd._RatioTapChanger = None + + self._TransformerEnd = value + if self._TransformerEnd is not None: + self._TransformerEnd.RatioTapChanger = None + self._TransformerEnd._RatioTapChanger = self + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + diff --git a/CIM16/IEC61970/Wires/RatioTapChangerTabular.py b/CIM16/IEC61970/Wires/RatioTapChangerTabular.py new file mode 100755 index 00000000..bab58d15 --- /dev/null +++ b/CIM16/IEC61970/Wires/RatioTapChangerTabular.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class RatioTapChangerTabular(Element): + """With RatioTapChangerTabular it is possible to describe curve how the voltage magnitude and reactance varies with the tap step.With RatioTapChangerTabular it is possible to describe curve how the voltage magnitude and reactance varies with the tap step. + """ + + def __init__(self, RatioTapChangerTabularPoint=None, RatioTapChanger=None, *args, **kw_args): + """Initialises a new 'RatioTapChangerTabular' instance. + + @param RatioTapChangerTabularPoint: + @param RatioTapChanger: + """ + self._RatioTapChangerTabularPoint = [] + self.RatioTapChangerTabularPoint = [] if RatioTapChangerTabularPoint is None else RatioTapChangerTabularPoint + + self._RatioTapChanger = [] + self.RatioTapChanger = [] if RatioTapChanger is None else RatioTapChanger + + super(RatioTapChangerTabular, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["RatioTapChangerTabularPoint", "RatioTapChanger"] + _many_refs = ["RatioTapChangerTabularPoint", "RatioTapChanger"] + + def getRatioTapChangerTabularPoint(self): + + return self._RatioTapChangerTabularPoint + + def setRatioTapChangerTabularPoint(self, value): + for x in self._RatioTapChangerTabularPoint: + x.RatioTapChangerTabular = None + for y in value: + y._RatioTapChangerTabular = self + self._RatioTapChangerTabularPoint = value + + RatioTapChangerTabularPoint = property(getRatioTapChangerTabularPoint, setRatioTapChangerTabularPoint) + + def addRatioTapChangerTabularPoint(self, *RatioTapChangerTabularPoint): + for obj in RatioTapChangerTabularPoint: + obj.RatioTapChangerTabular = self + + def removeRatioTapChangerTabularPoint(self, *RatioTapChangerTabularPoint): + for obj in RatioTapChangerTabularPoint: + obj.RatioTapChangerTabular = None + + def getRatioTapChanger(self): + + return self._RatioTapChanger + + def setRatioTapChanger(self, value): + for x in self._RatioTapChanger: + x.RatioTapChangerTabular = None + for y in value: + y._RatioTapChangerTabular = self + self._RatioTapChanger = value + + RatioTapChanger = property(getRatioTapChanger, setRatioTapChanger) + + def addRatioTapChanger(self, *RatioTapChanger): + for obj in RatioTapChanger: + obj.RatioTapChangerTabular = self + + def removeRatioTapChanger(self, *RatioTapChanger): + for obj in RatioTapChanger: + obj.RatioTapChangerTabular = None + diff --git a/CIM16/IEC61970/Wires/RatioTapChangerTabularPoint.py b/CIM16/IEC61970/Wires/RatioTapChangerTabularPoint.py new file mode 100755 index 00000000..88b3dec6 --- /dev/null +++ b/CIM16/IEC61970/Wires/RatioTapChangerTabularPoint.py @@ -0,0 +1,71 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class RatioTapChangerTabularPoint(Element): + """RatioTapChangerTabularPoint describe each tap step in the curve.RatioTapChangerTabularPoint describe each tap step in the curve. + """ + + def __init__(self, x=0.0, ratio=0.0, step=0, RatioTapChangerTabular=None, *args, **kw_args): + """Initialises a new 'RatioTapChangerTabularPoint' instance. + + @param x: The reactance deviation in percent of nominal value. The actual reactance is calculated as follows xcal = xnom(1 + x/100). + @param ratio: The voltage ratio in per unit. Hence this is a value close to one. + @param step: The tap step. + @param RatioTapChangerTabular: + """ + #: The reactance deviation in percent of nominal value. The actual reactance is calculated as follows xcal = xnom(1 + x/100). + self.x = x + + #: The voltage ratio in per unit. Hence this is a value close to one. + self.ratio = ratio + + #: The tap step. + self.step = step + + self._RatioTapChangerTabular = None + self.RatioTapChangerTabular = RatioTapChangerTabular + + super(RatioTapChangerTabularPoint, self).__init__(*args, **kw_args) + + _attrs = ["x", "ratio", "step"] + _attr_types = {"x": float, "ratio": float, "step": int} + _defaults = {"x": 0.0, "ratio": 0.0, "step": 0} + _enums = {} + _refs = ["RatioTapChangerTabular"] + _many_refs = [] + + def getRatioTapChangerTabular(self): + + return self._RatioTapChangerTabular + + def setRatioTapChangerTabular(self, value): + if self._RatioTapChangerTabular is not None: + filtered = [x for x in self.RatioTapChangerTabular.RatioTapChangerTabularPoint if x != self] + self._RatioTapChangerTabular._RatioTapChangerTabularPoint = filtered + + self._RatioTapChangerTabular = value + if self._RatioTapChangerTabular is not None: + if self not in self._RatioTapChangerTabular._RatioTapChangerTabularPoint: + self._RatioTapChangerTabular._RatioTapChangerTabularPoint.append(self) + + RatioTapChangerTabular = property(getRatioTapChangerTabular, setRatioTapChangerTabular) + diff --git a/CIM16/IEC61970/Wires/ReactiveCapabilityCurve.py b/CIM16/IEC61970/Wires/ReactiveCapabilityCurve.py new file mode 100755 index 00000000..6d7b5d49 --- /dev/null +++ b/CIM16/IEC61970/Wires/ReactiveCapabilityCurve.py @@ -0,0 +1,105 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Curve import Curve + +class ReactiveCapabilityCurve(Curve): + """Reactive power rating envelope versus the synchronous machine's active power, in both the generating and motoring modes. For each active power value there is a corresponding high and low reactive power limit value. Typically there will be a separate curve for each coolant condition, such as hydrogen pressure. The Y1 axis values represent reactive minimum and the Y2 axis values represent reactive maximum.Reactive power rating envelope versus the synchronous machine's active power, in both the generating and motoring modes. For each active power value there is a corresponding high and low reactive power limit value. Typically there will be a separate curve for each coolant condition, such as hydrogen pressure. The Y1 axis values represent reactive minimum and the Y2 axis values represent reactive maximum. + """ + + def __init__(self, hydrogenPressure=0.0, coolantTemperature=0.0, InitiallyUsedBySynchronousMachines=None, SynchronousMachines=None, *args, **kw_args): + """Initialises a new 'ReactiveCapabilityCurve' instance. + + @param hydrogenPressure: The hydrogen coolant pressure + @param coolantTemperature: The machine's coolant temperature (e.g., ambient air or stator circulating water). + @param InitiallyUsedBySynchronousMachines: Synchronous machines using this curve as default. + @param SynchronousMachines: Synchronous machines using this curve. + """ + #: The hydrogen coolant pressure + self.hydrogenPressure = hydrogenPressure + + #: The machine's coolant temperature (e.g., ambient air or stator circulating water). + self.coolantTemperature = coolantTemperature + + self._InitiallyUsedBySynchronousMachines = [] + self.InitiallyUsedBySynchronousMachines = [] if InitiallyUsedBySynchronousMachines is None else InitiallyUsedBySynchronousMachines + + self._SynchronousMachines = [] + self.SynchronousMachines = [] if SynchronousMachines is None else SynchronousMachines + + super(ReactiveCapabilityCurve, self).__init__(*args, **kw_args) + + _attrs = ["hydrogenPressure", "coolantTemperature"] + _attr_types = {"hydrogenPressure": float, "coolantTemperature": float} + _defaults = {"hydrogenPressure": 0.0, "coolantTemperature": 0.0} + _enums = {} + _refs = ["InitiallyUsedBySynchronousMachines", "SynchronousMachines"] + _many_refs = ["InitiallyUsedBySynchronousMachines", "SynchronousMachines"] + + def getInitiallyUsedBySynchronousMachines(self): + """Synchronous machines using this curve as default. + """ + return self._InitiallyUsedBySynchronousMachines + + def setInitiallyUsedBySynchronousMachines(self, value): + for x in self._InitiallyUsedBySynchronousMachines: + x.InitialReactiveCapabilityCurve = None + for y in value: + y._InitialReactiveCapabilityCurve = self + self._InitiallyUsedBySynchronousMachines = value + + InitiallyUsedBySynchronousMachines = property(getInitiallyUsedBySynchronousMachines, setInitiallyUsedBySynchronousMachines) + + def addInitiallyUsedBySynchronousMachines(self, *InitiallyUsedBySynchronousMachines): + for obj in InitiallyUsedBySynchronousMachines: + obj.InitialReactiveCapabilityCurve = self + + def removeInitiallyUsedBySynchronousMachines(self, *InitiallyUsedBySynchronousMachines): + for obj in InitiallyUsedBySynchronousMachines: + obj.InitialReactiveCapabilityCurve = None + + def getSynchronousMachines(self): + """Synchronous machines using this curve. + """ + return self._SynchronousMachines + + def setSynchronousMachines(self, value): + for p in self._SynchronousMachines: + filtered = [q for q in p.ReactiveCapabilityCurves if q != self] + self._SynchronousMachines._ReactiveCapabilityCurves = filtered + for r in value: + if self not in r._ReactiveCapabilityCurves: + r._ReactiveCapabilityCurves.append(self) + self._SynchronousMachines = value + + SynchronousMachines = property(getSynchronousMachines, setSynchronousMachines) + + def addSynchronousMachines(self, *SynchronousMachines): + for obj in SynchronousMachines: + if self not in obj._ReactiveCapabilityCurves: + obj._ReactiveCapabilityCurves.append(self) + self._SynchronousMachines.append(obj) + + def removeSynchronousMachines(self, *SynchronousMachines): + for obj in SynchronousMachines: + if self in obj._ReactiveCapabilityCurves: + obj._ReactiveCapabilityCurves.remove(self) + self._SynchronousMachines.remove(obj) + diff --git a/CIM16/IEC61970/Wires/Recloser.py b/CIM16/IEC61970/Wires/Recloser.py new file mode 100755 index 00000000..711df573 --- /dev/null +++ b/CIM16/IEC61970/Wires/Recloser.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.ProtectedSwitch import ProtectedSwitch + +class Recloser(ProtectedSwitch): + """Pole-mounted fault interrupter with built-in phase and ground relays, current transformer (CT), and supplemental controls.Pole-mounted fault interrupter with built-in phase and ground relays, current transformer (CT), and supplemental controls. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Recloser' instance. + + """ + super(Recloser, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/RectifierInverter.py b/CIM16/IEC61970/Wires/RectifierInverter.py new file mode 100755 index 00000000..778f753f --- /dev/null +++ b/CIM16/IEC61970/Wires/RectifierInverter.py @@ -0,0 +1,87 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class RectifierInverter(ConductingEquipment): + """Bi-directional AC-DC conversion equipment that can be used to control DC current, DC voltage, DC power flow, or firing angle.Bi-directional AC-DC conversion equipment that can be used to control DC current, DC voltage, DC power flow, or firing angle. + """ + + def __init__(self, ratedU=0.0, maxU=0.0, bridges=0, compoundResistance=0.0, commutatingResistance=0.0, minP=0.0, operatingMode='', minU=0.0, commutatingReactance=0.0, maxP=0.0, frequency=0.0, minCompoundVoltage=0.0, *args, **kw_args): + """Initialises a new 'RectifierInverter' instance. + + @param ratedU: Rectifier/inverter primary base voltage + @param maxU: The maximum voltage on the DC side at which the converter should operate. + @param bridges: Number of bridges + @param compoundResistance: Compounding resistance. + @param commutatingResistance: Commutating resistance. + @param minP: The minimum active power on the DC side at which the converter should operate. + @param operatingMode: Operating mode for the converter. + @param minU: The minimum voltage on the DC side at which the converter should operate. + @param commutatingReactance: Commutating reactance at AC bus frequency. + @param maxP: The maximum active power on the DC side at which the fconverter should operate. + @param frequency: Frequency on the AC side. + @param minCompoundVoltage: Minimum compounded DC voltage + """ + #: Rectifier/inverter primary base voltage + self.ratedU = ratedU + + #: The maximum voltage on the DC side at which the converter should operate. + self.maxU = maxU + + #: Number of bridges + self.bridges = bridges + + #: Compounding resistance. + self.compoundResistance = compoundResistance + + #: Commutating resistance. + self.commutatingResistance = commutatingResistance + + #: The minimum active power on the DC side at which the converter should operate. + self.minP = minP + + #: Operating mode for the converter. + self.operatingMode = operatingMode + + #: The minimum voltage on the DC side at which the converter should operate. + self.minU = minU + + #: Commutating reactance at AC bus frequency. + self.commutatingReactance = commutatingReactance + + #: The maximum active power on the DC side at which the fconverter should operate. + self.maxP = maxP + + #: Frequency on the AC side. + self.frequency = frequency + + #: Minimum compounded DC voltage + self.minCompoundVoltage = minCompoundVoltage + + super(RectifierInverter, self).__init__(*args, **kw_args) + + _attrs = ["ratedU", "maxU", "bridges", "compoundResistance", "commutatingResistance", "minP", "operatingMode", "minU", "commutatingReactance", "maxP", "frequency", "minCompoundVoltage"] + _attr_types = {"ratedU": float, "maxU": float, "bridges": int, "compoundResistance": float, "commutatingResistance": float, "minP": float, "operatingMode": str, "minU": float, "commutatingReactance": float, "maxP": float, "frequency": float, "minCompoundVoltage": float} + _defaults = {"ratedU": 0.0, "maxU": 0.0, "bridges": 0, "compoundResistance": 0.0, "commutatingResistance": 0.0, "minP": 0.0, "operatingMode": '', "minU": 0.0, "commutatingReactance": 0.0, "maxP": 0.0, "frequency": 0.0, "minCompoundVoltage": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/RegulatingCondEq.py b/CIM16/IEC61970/Wires/RegulatingCondEq.py new file mode 100755 index 00000000..9fe5cebd --- /dev/null +++ b/CIM16/IEC61970/Wires/RegulatingCondEq.py @@ -0,0 +1,86 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class RegulatingCondEq(ConductingEquipment): + """A type of conducting equipment that can regulate a quanity (i.e. voltage or flow) at a specific point in the network.A type of conducting equipment that can regulate a quanity (i.e. voltage or flow) at a specific point in the network. + """ + + def __init__(self, Controls=None, RegulatingControl=None, *args, **kw_args): + """Initialises a new 'RegulatingCondEq' instance. + + @param Controls: The controller outputs used to actually govern a regulating device, e.g. the magnetization of a synchronous machine or capacitor bank breaker actuator. + @param RegulatingControl: The regulating control scheme in which this equipment participates. + """ + self._Controls = [] + self.Controls = [] if Controls is None else Controls + + self._RegulatingControl = None + self.RegulatingControl = RegulatingControl + + super(RegulatingCondEq, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Controls", "RegulatingControl"] + _many_refs = ["Controls"] + + def getControls(self): + """The controller outputs used to actually govern a regulating device, e.g. the magnetization of a synchronous machine or capacitor bank breaker actuator. + """ + return self._Controls + + def setControls(self, value): + for x in self._Controls: + x.RegulatingCondEq = None + for y in value: + y._RegulatingCondEq = self + self._Controls = value + + Controls = property(getControls, setControls) + + def addControls(self, *Controls): + for obj in Controls: + obj.RegulatingCondEq = self + + def removeControls(self, *Controls): + for obj in Controls: + obj.RegulatingCondEq = None + + def getRegulatingControl(self): + """The regulating control scheme in which this equipment participates. + """ + return self._RegulatingControl + + def setRegulatingControl(self, value): + if self._RegulatingControl is not None: + filtered = [x for x in self.RegulatingControl.RegulatingCondEq if x != self] + self._RegulatingControl._RegulatingCondEq = filtered + + self._RegulatingControl = value + if self._RegulatingControl is not None: + if self not in self._RegulatingControl._RegulatingCondEq: + self._RegulatingControl._RegulatingCondEq.append(self) + + RegulatingControl = property(getRegulatingControl, setRegulatingControl) + diff --git a/CIM16/IEC61970/Wires/RegulatingControl.py b/CIM16/IEC61970/Wires/RegulatingControl.py new file mode 100755 index 00000000..0582c733 --- /dev/null +++ b/CIM16/IEC61970/Wires/RegulatingControl.py @@ -0,0 +1,134 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class RegulatingControl(PowerSystemResource): + """Specifies a set of equipment that works together to control a power system quantity such as voltage or flow.Specifies a set of equipment that works together to control a power system quantity such as voltage or flow. + """ + + def __init__(self, mode="fixed", targetRange=0.0, discrete=False, targetValue=0.0, monitoredPhase="s12N", RegulatingCondEq=None, Terminal=None, RegulationSchedule=None, targetDeadband=0, *args, **kw_args): + """Initialises a new 'RegulatingControl' instance. + + @param mode: The regulating control mode presently available. This specifications allows for determining the kind of regualation without need for obtaining the units from a schedule. Values are: "fixed", "timeScheduled", "voltage", "admittance", "reactivePower", "powerFactor", "currentFlow", "activePower", "temperature" + @param targetRange: This is the case input target range. This performs the same function as the value2 attribute on the regulation schedule in the case that schedules are not used. The units of those appropriate for the mode. + @param discrete: The regulation is performed in a discrete mode. + @param targetValue: The target value specified for case input. This value can be used for the target value wihout the use of schedules. The value has the units appropriate to the mode attribute. + @param monitoredPhase: Phase voltage controlling this regulator, measured at regulator location. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param RegulatingCondEq: The equipment that participates in this regulating control scheme. + @param Terminal: The terminal associated with this regulating control. + @param RegulationSchedule: Schedule for this Regulating regulating control. + """ + #: The regulating control mode presently available. This specifications allows for determining the kind of regualation without need for obtaining the units from a schedule. Values are: "fixed", "timeScheduled", "voltage", "admittance", "reactivePower", "powerFactor", "currentFlow", "activePower", "temperature" + self.mode = mode + + #: This is the case input target range. This performs the same function as the value2 attribute on the regulation schedule in the case that schedules are not used. The units of those appropriate for the mode. + self.targetRange = targetRange + + #: The regulation is performed in a discrete mode. + self.discrete = discrete + + #: The target value specified for case input. This value can be used for the target value wihout the use of schedules. The value has the units appropriate to the mode attribute. + self.targetValue = targetValue + + #: Phase voltage controlling this regulator, measured at regulator location. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.monitoredPhase = monitoredPhase + + self._RegulatingCondEq = [] + self.RegulatingCondEq = [] if RegulatingCondEq is None else RegulatingCondEq + + self._Terminal = None + self.Terminal = Terminal + + self._RegulationSchedule = [] + self.RegulationSchedule = [] if RegulationSchedule is None else RegulationSchedule + + self.targetDeadband = targetDeadband + + super(RegulatingControl, self).__init__(*args, **kw_args) + + _attrs = ["mode", "targetRange", "discrete", "targetValue", "monitoredPhase", "targetDeadband"] + _attr_types = {"mode": str, "targetRange": float, "discrete": bool, "targetValue": float, "monitoredPhase": str, "targetDeadband": float} + _defaults = {"mode": "fixed", "targetRange": 0.0, "discrete": False, "targetValue": 0.0, "monitoredPhase": "s12N", "targetDeadband": 0.0} + _enums = {"mode": "RegulatingControlModeKind", "monitoredPhase": "PhaseCode"} + _refs = ["RegulatingCondEq", "Terminal", "RegulationSchedule"] + _many_refs = ["RegulatingCondEq", "RegulationSchedule"] + + def getRegulatingCondEq(self): + """The equipment that participates in this regulating control scheme. + """ + return self._RegulatingCondEq + + def setRegulatingCondEq(self, value): + for x in self._RegulatingCondEq: + x.RegulatingControl = None + for y in value: + y._RegulatingControl = self + self._RegulatingCondEq = value + + RegulatingCondEq = property(getRegulatingCondEq, setRegulatingCondEq) + + def addRegulatingCondEq(self, *RegulatingCondEq): + for obj in RegulatingCondEq: + obj.RegulatingControl = self + + def removeRegulatingCondEq(self, *RegulatingCondEq): + for obj in RegulatingCondEq: + obj.RegulatingControl = None + + def getTerminal(self): + """The terminal associated with this regulating control. + """ + return self._Terminal + + def setTerminal(self, value): + if self._Terminal is not None: + filtered = [x for x in self.Terminal.RegulatingControl if x != self] + self._Terminal._RegulatingControl = filtered + + self._Terminal = value + if self._Terminal is not None: + if self not in self._Terminal._RegulatingControl: + self._Terminal._RegulatingControl.append(self) + + Terminal = property(getTerminal, setTerminal) + + def getRegulationSchedule(self): + """Schedule for this Regulating regulating control. + """ + return self._RegulationSchedule + + def setRegulationSchedule(self, value): + for x in self._RegulationSchedule: + x.RegulatingControl = None + for y in value: + y._RegulatingControl = self + self._RegulationSchedule = value + + RegulationSchedule = property(getRegulationSchedule, setRegulationSchedule) + + def addRegulationSchedule(self, *RegulationSchedule): + for obj in RegulationSchedule: + obj.RegulatingControl = self + + def removeRegulationSchedule(self, *RegulationSchedule): + for obj in RegulationSchedule: + obj.RegulatingControl = None + diff --git a/CIM16/IEC61970/Wires/RegulationSchedule.py b/CIM16/IEC61970/Wires/RegulationSchedule.py new file mode 100755 index 00000000..ffdb4fc2 --- /dev/null +++ b/CIM16/IEC61970/Wires/RegulationSchedule.py @@ -0,0 +1,86 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.LoadModel.SeasonDayTypeSchedule import SeasonDayTypeSchedule + +class RegulationSchedule(SeasonDayTypeSchedule): + """A pre-established pattern over time for a controlled variable, e.g., busbar voltage.A pre-established pattern over time for a controlled variable, e.g., busbar voltage. + """ + + def __init__(self, RegulatingControl=None, VoltageControlZones=None, *args, **kw_args): + """Initialises a new 'RegulationSchedule' instance. + + @param RegulatingControl: Regulating controls that have this Schedule. + @param VoltageControlZones: A VoltageControlZone may have a voltage regulation schedule. + """ + self._RegulatingControl = None + self.RegulatingControl = RegulatingControl + + self._VoltageControlZones = [] + self.VoltageControlZones = [] if VoltageControlZones is None else VoltageControlZones + + super(RegulationSchedule, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["RegulatingControl", "VoltageControlZones"] + _many_refs = ["VoltageControlZones"] + + def getRegulatingControl(self): + """Regulating controls that have this Schedule. + """ + return self._RegulatingControl + + def setRegulatingControl(self, value): + if self._RegulatingControl is not None: + filtered = [x for x in self.RegulatingControl.RegulationSchedule if x != self] + self._RegulatingControl._RegulationSchedule = filtered + + self._RegulatingControl = value + if self._RegulatingControl is not None: + if self not in self._RegulatingControl._RegulationSchedule: + self._RegulatingControl._RegulationSchedule.append(self) + + RegulatingControl = property(getRegulatingControl, setRegulatingControl) + + def getVoltageControlZones(self): + """A VoltageControlZone may have a voltage regulation schedule. + """ + return self._VoltageControlZones + + def setVoltageControlZones(self, value): + for x in self._VoltageControlZones: + x.RegulationSchedule = None + for y in value: + y._RegulationSchedule = self + self._VoltageControlZones = value + + VoltageControlZones = property(getVoltageControlZones, setVoltageControlZones) + + def addVoltageControlZones(self, *VoltageControlZones): + for obj in VoltageControlZones: + obj.RegulationSchedule = self + + def removeVoltageControlZones(self, *VoltageControlZones): + for obj in VoltageControlZones: + obj.RegulationSchedule = None + diff --git a/CIM16/IEC61970/Wires/Resistor.py b/CIM16/IEC61970/Wires/Resistor.py new file mode 100755 index 00000000..e665ad43 --- /dev/null +++ b/CIM16/IEC61970/Wires/Resistor.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Resistor(ConductingEquipment): + """Resistor, typically used in filter configurations or as earthing resistor for transformers. Used for electrical model of distribution networks.Resistor, typically used in filter configurations or as earthing resistor for transformers. Used for electrical model of distribution networks. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Resistor' instance. + + """ + super(Resistor, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/Sectionaliser.py b/CIM16/IEC61970/Wires/Sectionaliser.py new file mode 100755 index 00000000..a688ebaf --- /dev/null +++ b/CIM16/IEC61970/Wires/Sectionaliser.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.Switch import Switch + +class Sectionaliser(Switch): + """Automatic switch that will lock open to isolate a faulted section. It may, or may not, have load breaking capability. Its primary purpose is to provide fault sectionalising at locations where the fault current is either too high, or too low, for proper coordination of fuses.Automatic switch that will lock open to isolate a faulted section. It may, or may not, have load breaking capability. Its primary purpose is to provide fault sectionalising at locations where the fault current is either too high, or too low, for proper coordination of fuses. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Sectionaliser' instance. + + """ + super(Sectionaliser, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/SeriesCompensator.py b/CIM16/IEC61970/Wires/SeriesCompensator.py new file mode 100755 index 00000000..20eb31d3 --- /dev/null +++ b/CIM16/IEC61970/Wires/SeriesCompensator.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class SeriesCompensator(ConductingEquipment): + """A Series Compensator is a series capacitor or reactor or an AC transmission line without charging susceptance. It is a two terminal device.A Series Compensator is a series capacitor or reactor or an AC transmission line without charging susceptance. It is a two terminal device. + """ + + def __init__(self, x=0.0, r=0.0, *args, **kw_args): + """Initialises a new 'SeriesCompensator' instance. + + @param x: Positive sequence reactance. + @param r: Positive sequence resistance. + """ + #: Positive sequence reactance. + self.x = x + + #: Positive sequence resistance. + self.r = r + + super(SeriesCompensator, self).__init__(*args, **kw_args) + + _attrs = ["x", "r"] + _attr_types = {"x": float, "r": float} + _defaults = {"x": 0.0, "r": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/ShuntCompensator.py b/CIM16/IEC61970/Wires/ShuntCompensator.py new file mode 100755 index 00000000..c408f2b4 --- /dev/null +++ b/CIM16/IEC61970/Wires/ShuntCompensator.py @@ -0,0 +1,144 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.RegulatingCondEq import RegulatingCondEq + +class ShuntCompensator(RegulatingCondEq): + """A shunt capacitor or reactor or switchable bank of shunt capacitors or reactors. A section of a shunt compensator is an individual capacitor or reactor. A negative value for reactivePerSection indicates that the compensator is a reactor. ShuntCompensator is a single terminal device. Ground is implied.A shunt capacitor or reactor or switchable bank of shunt capacitors or reactors. A section of a shunt compensator is an individual capacitor or reactor. A negative value for reactivePerSection indicates that the compensator is a reactor. ShuntCompensator is a single terminal device. Ground is implied. + """ + + def __init__(self, nomQ=0.0, maxU=0.0, gPerSection=0.0, voltageSensitivity=0.0, nomU=0.0, b0PerSection=0.0, maximumSections=0, bPerSection=0.0, aVRDelay=0.0, minU=0.0, normalSections=0, reactivePerSection=0.0, switchOnCount=0, switchOnDate='', g0PerSection=0.0, SvShuntCompensatorSections=None, ShuntCompensatorPhases=None, *args, **kw_args): + """Initialises a new 'ShuntCompensator' instance. + + @param nomQ: Nominal reactive power output of the capacitor bank at the nominal voltage. This number should be positive. + @param maxU: The maximum voltage at which the capacitor bank should operate. + @param gPerSection: Positive sequence shunt (charging) conductance per section + @param voltageSensitivity: Voltage sensitivity required for the device to regulate the bus voltage, in voltage/reactive power. + @param nomU: The nominal voltage at which the nominal reactive power was measured. This should normally be within 10% of the voltage at which the capacitor is connected to the network. + @param b0PerSection: Zero sequence shunt (charging) susceptance per section + @param maximumSections: For a capacitor bank, the maximum number of sections that may be switched in. + @param bPerSection: Positive sequence shunt (charging) susceptance per section + @param aVRDelay: Time delay required for the device to be connected or disconnected by automatic voltage regulation (AVR). + @param minU: The minimum voltage at which the capacitor bank should operate. + @param normalSections: For a capacitor bank, the normal number of sections switched in. This number should correspond to the nominal reactive power (nomQ). + @param reactivePerSection: For a capacitor bank, the size in reactive power of each switchable section at the nominal voltage. + @param switchOnCount: The switch on count since the capacitor count was last reset or initialized. + @param switchOnDate: The date and time when the capacitor bank was last switched on. + @param g0PerSection: Zero sequence shunt (charging) conductance per section + @param SvShuntCompensatorSections: The state for the number of shunt compensator sections in service. + @param ShuntCompensatorPhases: + """ + #: Nominal reactive power output of the capacitor bank at the nominal voltage. This number should be positive. + self.nomQ = nomQ + + #: The maximum voltage at which the capacitor bank should operate. + self.maxU = maxU + + #: Positive sequence shunt (charging) conductance per section + self.gPerSection = gPerSection + + #: Voltage sensitivity required for the device to regulate the bus voltage, in voltage/reactive power. + self.voltageSensitivity = voltageSensitivity + + #: The nominal voltage at which the nominal reactive power was measured. This should normally be within 10% of the voltage at which the capacitor is connected to the network. + self.nomU = nomU + + #: Zero sequence shunt (charging) susceptance per section + self.b0PerSection = b0PerSection + + #: For a capacitor bank, the maximum number of sections that may be switched in. + self.maximumSections = maximumSections + + #: Positive sequence shunt (charging) susceptance per section + self.bPerSection = bPerSection + + #: Time delay required for the device to be connected or disconnected by automatic voltage regulation (AVR). + self.aVRDelay = aVRDelay + + #: The minimum voltage at which the capacitor bank should operate. + self.minU = minU + + #: For a capacitor bank, the normal number of sections switched in. This number should correspond to the nominal reactive power (nomQ). + self.normalSections = normalSections + + #: For a capacitor bank, the size in reactive power of each switchable section at the nominal voltage. + self.reactivePerSection = reactivePerSection + + #: The switch on count since the capacitor count was last reset or initialized. + self.switchOnCount = switchOnCount + + #: The date and time when the capacitor bank was last switched on. + self.switchOnDate = switchOnDate + + #: Zero sequence shunt (charging) conductance per section + self.g0PerSection = g0PerSection + + self._SvShuntCompensatorSections = None + self.SvShuntCompensatorSections = SvShuntCompensatorSections + + self._ShuntCompensatorPhases = [] + self.ShuntCompensatorPhases = [] if ShuntCompensatorPhases is None else ShuntCompensatorPhases + + super(ShuntCompensator, self).__init__(*args, **kw_args) + + _attrs = ["nomQ", "maxU", "gPerSection", "voltageSensitivity", "nomU", "b0PerSection", "maximumSections", "bPerSection", "aVRDelay", "minU", "normalSections", "reactivePerSection", "switchOnCount", "switchOnDate", "g0PerSection"] + _attr_types = {"nomQ": float, "maxU": float, "gPerSection": float, "voltageSensitivity": float, "nomU": float, "b0PerSection": float, "maximumSections": int, "bPerSection": float, "aVRDelay": float, "minU": float, "normalSections": int, "reactivePerSection": float, "switchOnCount": int, "switchOnDate": str, "g0PerSection": float} + _defaults = {"nomQ": 0.0, "maxU": 0.0, "gPerSection": 0.0, "voltageSensitivity": 0.0, "nomU": 0.0, "b0PerSection": 0.0, "maximumSections": 0, "bPerSection": 0.0, "aVRDelay": 0.0, "minU": 0.0, "normalSections": 0, "reactivePerSection": 0.0, "switchOnCount": 0, "switchOnDate": '', "g0PerSection": 0.0} + _enums = {} + _refs = ["SvShuntCompensatorSections", "ShuntCompensatorPhases"] + _many_refs = ["ShuntCompensatorPhases"] + + def getSvShuntCompensatorSections(self): + """The state for the number of shunt compensator sections in service. + """ + return self._SvShuntCompensatorSections + + def setSvShuntCompensatorSections(self, value): + if self._SvShuntCompensatorSections is not None: + self._SvShuntCompensatorSections._ShuntCompensator = None + + self._SvShuntCompensatorSections = value + if self._SvShuntCompensatorSections is not None: + self._SvShuntCompensatorSections.ShuntCompensator = None + self._SvShuntCompensatorSections._ShuntCompensator = self + + SvShuntCompensatorSections = property(getSvShuntCompensatorSections, setSvShuntCompensatorSections) + + def getShuntCompensatorPhases(self): + + return self._ShuntCompensatorPhases + + def setShuntCompensatorPhases(self, value): + for x in self._ShuntCompensatorPhases: + x.ShuntCompensator = None + for y in value: + y._ShuntCompensator = self + self._ShuntCompensatorPhases = value + + ShuntCompensatorPhases = property(getShuntCompensatorPhases, setShuntCompensatorPhases) + + def addShuntCompensatorPhases(self, *ShuntCompensatorPhases): + for obj in ShuntCompensatorPhases: + obj.ShuntCompensator = self + + def removeShuntCompensatorPhases(self, *ShuntCompensatorPhases): + for obj in ShuntCompensatorPhases: + obj.ShuntCompensator = None + diff --git a/CIM16/IEC61970/Wires/StaticVarCompensator.py b/CIM16/IEC61970/Wires/StaticVarCompensator.py new file mode 100755 index 00000000..5a133b57 --- /dev/null +++ b/CIM16/IEC61970/Wires/StaticVarCompensator.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.RegulatingCondEq import RegulatingCondEq + +class StaticVarCompensator(RegulatingCondEq): + """A facility for providing variable and controllable shunt reactive power. The SVC typically consists of a stepdown transformer, filter, thyristor-controlled reactor, and thyristor-switched capacitor arms. The SVC may operate in fixed MVar output mode or in voltage control mode. When in voltage control mode, the output of the SVC will be proportional to the deviation of voltage at the controlled bus from the voltage setpoint. The SVC characteristic slope defines the proportion. If the voltage at the controlled bus is equal to the voltage setpoint, the SVC MVar output is zero.A facility for providing variable and controllable shunt reactive power. The SVC typically consists of a stepdown transformer, filter, thyristor-controlled reactor, and thyristor-switched capacitor arms. The SVC may operate in fixed MVar output mode or in voltage control mode. When in voltage control mode, the output of the SVC will be proportional to the deviation of voltage at the controlled bus from the voltage setpoint. The SVC characteristic slope defines the proportion. If the voltage at the controlled bus is equal to the voltage setpoint, the SVC MVar output is zero. + """ + + def __init__(self, slope=0.0, sVCControlMode="off", capacitiveRating=0.0, voltageSetPoint=0.0, inductiveRating=0.0, *args, **kw_args): + """Initialises a new 'StaticVarCompensator' instance. + + @param slope: The characteristics slope of an SVC defines how the reactive power output changes in proportion to the difference between the regulated bus voltage and the voltage setpoint. + @param sVCControlMode: SVC control mode. Values are: "off", "voltage", "reactivePower" + @param capacitiveRating: Maximum available capacitive reactive power + @param voltageSetPoint: The reactive power output of the SVC is proportional to the difference between the voltage at the regulated bus and the voltage setpoint. When the regulated bus voltage is equal to the voltage setpoint, the reactive power output is zero. + @param inductiveRating: Maximum available inductive reactive power + """ + #: The characteristics slope of an SVC defines how the reactive power output changes in proportion to the difference between the regulated bus voltage and the voltage setpoint. + self.slope = slope + + #: SVC control mode. Values are: "off", "voltage", "reactivePower" + self.sVCControlMode = sVCControlMode + + #: Maximum available capacitive reactive power + self.capacitiveRating = capacitiveRating + + #: The reactive power output of the SVC is proportional to the difference between the voltage at the regulated bus and the voltage setpoint. When the regulated bus voltage is equal to the voltage setpoint, the reactive power output is zero. + self.voltageSetPoint = voltageSetPoint + + #: Maximum available inductive reactive power + self.inductiveRating = inductiveRating + + super(StaticVarCompensator, self).__init__(*args, **kw_args) + + _attrs = ["slope", "sVCControlMode", "capacitiveRating", "voltageSetPoint", "inductiveRating"] + _attr_types = {"slope": float, "sVCControlMode": str, "capacitiveRating": float, "voltageSetPoint": float, "inductiveRating": float} + _defaults = {"slope": 0.0, "sVCControlMode": "off", "capacitiveRating": 0.0, "voltageSetPoint": 0.0, "inductiveRating": 0.0} + _enums = {"sVCControlMode": "SVCControlMode"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Wires/Switch.py b/CIM16/IEC61970/Wires/Switch.py new file mode 100755 index 00000000..d3904c80 --- /dev/null +++ b/CIM16/IEC61970/Wires/Switch.py @@ -0,0 +1,225 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Switch(ConductingEquipment): + """A generic device designed to close, or open, or both, one or more electric circuits.A generic device designed to close, or open, or both, one or more electric circuits. + """ + + def __init__(self, switchOnDate='', normalOpen=False, ratedCurrent=0.0, retained=False, switchOnCount=0, SwitchingOperations=None, LoadMgmtFunctions=None, ConnectDisconnectFunctions=None, SwitchSchedules=None, SwitchPhases=None, CompositeSwitch=None, *args, **kw_args): + """Initialises a new 'Switch' instance. + + @param switchOnDate: The date and time when the switch was last switched on. + @param normalOpen: The attribute is used in cases when no Measurement for the status value is present. If the Switch has a status measurment the Discrete.normalValue is expected to match with the Switch.normalOpen. + @param ratedCurrent: The maximum continuous current carrying capacity in amps governed by the device material and construction. + @param retained: Branch is retained in a bus branch model. + @param switchOnCount: The switch on count since the switch was last reset or initialized. + @param SwitchingOperations: A switch may be operated by many schedules. + @param LoadMgmtFunctions: + @param ConnectDisconnectFunctions: + @param SwitchSchedules: A Switch can be associated with SwitchSchedules. + @param SwitchPhases: + @param CompositeSwitch: Composite switch this Switch belongs to + """ + #: The date and time when the switch was last switched on. + self.switchOnDate = switchOnDate + + #: The attribute is used in cases when no Measurement for the status value is present. If the Switch has a status measurment the Discrete.normalValue is expected to match with the Switch.normalOpen. + self.normalOpen = normalOpen + + #: The maximum continuous current carrying capacity in amps governed by the device material and construction. + self.ratedCurrent = ratedCurrent + + #: Branch is retained in a bus branch model. + self.retained = retained + + #: The switch on count since the switch was last reset or initialized. + self.switchOnCount = switchOnCount + + self._SwitchingOperations = [] + self.SwitchingOperations = [] if SwitchingOperations is None else SwitchingOperations + + self._LoadMgmtFunctions = [] + self.LoadMgmtFunctions = [] if LoadMgmtFunctions is None else LoadMgmtFunctions + + self._ConnectDisconnectFunctions = [] + self.ConnectDisconnectFunctions = [] if ConnectDisconnectFunctions is None else ConnectDisconnectFunctions + + self._SwitchSchedules = [] + self.SwitchSchedules = [] if SwitchSchedules is None else SwitchSchedules + + self._SwitchPhases = [] + self.SwitchPhases = [] if SwitchPhases is None else SwitchPhases + + self._CompositeSwitch = None + self.CompositeSwitch = CompositeSwitch + + super(Switch, self).__init__(*args, **kw_args) + + _attrs = ["switchOnDate", "normalOpen", "ratedCurrent", "retained", "switchOnCount"] + _attr_types = {"switchOnDate": str, "normalOpen": bool, "ratedCurrent": float, "retained": bool, "switchOnCount": int} + _defaults = {"switchOnDate": '', "normalOpen": False, "ratedCurrent": 0.0, "retained": False, "switchOnCount": 0} + _enums = {} + _refs = ["SwitchingOperations", "LoadMgmtFunctions", "ConnectDisconnectFunctions", "SwitchSchedules", "SwitchPhases", "CompositeSwitch"] + _many_refs = ["SwitchingOperations", "LoadMgmtFunctions", "ConnectDisconnectFunctions", "SwitchSchedules", "SwitchPhases"] + + def getSwitchingOperations(self): + """A switch may be operated by many schedules. + """ + return self._SwitchingOperations + + def setSwitchingOperations(self, value): + for p in self._SwitchingOperations: + filtered = [q for q in p.Switches if q != self] + self._SwitchingOperations._Switches = filtered + for r in value: + if self not in r._Switches: + r._Switches.append(self) + self._SwitchingOperations = value + + SwitchingOperations = property(getSwitchingOperations, setSwitchingOperations) + + def addSwitchingOperations(self, *SwitchingOperations): + for obj in SwitchingOperations: + if self not in obj._Switches: + obj._Switches.append(self) + self._SwitchingOperations.append(obj) + + def removeSwitchingOperations(self, *SwitchingOperations): + for obj in SwitchingOperations: + if self in obj._Switches: + obj._Switches.remove(self) + self._SwitchingOperations.remove(obj) + + def getLoadMgmtFunctions(self): + + return self._LoadMgmtFunctions + + def setLoadMgmtFunctions(self, value): + for p in self._LoadMgmtFunctions: + filtered = [q for q in p.Switches if q != self] + self._LoadMgmtFunctions._Switches = filtered + for r in value: + if self not in r._Switches: + r._Switches.append(self) + self._LoadMgmtFunctions = value + + LoadMgmtFunctions = property(getLoadMgmtFunctions, setLoadMgmtFunctions) + + def addLoadMgmtFunctions(self, *LoadMgmtFunctions): + for obj in LoadMgmtFunctions: + if self not in obj._Switches: + obj._Switches.append(self) + self._LoadMgmtFunctions.append(obj) + + def removeLoadMgmtFunctions(self, *LoadMgmtFunctions): + for obj in LoadMgmtFunctions: + if self in obj._Switches: + obj._Switches.remove(self) + self._LoadMgmtFunctions.remove(obj) + + def getConnectDisconnectFunctions(self): + + return self._ConnectDisconnectFunctions + + def setConnectDisconnectFunctions(self, value): + for p in self._ConnectDisconnectFunctions: + filtered = [q for q in p.Switches if q != self] + self._ConnectDisconnectFunctions._Switches = filtered + for r in value: + if self not in r._Switches: + r._Switches.append(self) + self._ConnectDisconnectFunctions = value + + ConnectDisconnectFunctions = property(getConnectDisconnectFunctions, setConnectDisconnectFunctions) + + def addConnectDisconnectFunctions(self, *ConnectDisconnectFunctions): + for obj in ConnectDisconnectFunctions: + if self not in obj._Switches: + obj._Switches.append(self) + self._ConnectDisconnectFunctions.append(obj) + + def removeConnectDisconnectFunctions(self, *ConnectDisconnectFunctions): + for obj in ConnectDisconnectFunctions: + if self in obj._Switches: + obj._Switches.remove(self) + self._ConnectDisconnectFunctions.remove(obj) + + def getSwitchSchedules(self): + """A Switch can be associated with SwitchSchedules. + """ + return self._SwitchSchedules + + def setSwitchSchedules(self, value): + for x in self._SwitchSchedules: + x.Switch = None + for y in value: + y._Switch = self + self._SwitchSchedules = value + + SwitchSchedules = property(getSwitchSchedules, setSwitchSchedules) + + def addSwitchSchedules(self, *SwitchSchedules): + for obj in SwitchSchedules: + obj.Switch = self + + def removeSwitchSchedules(self, *SwitchSchedules): + for obj in SwitchSchedules: + obj.Switch = None + + def getSwitchPhases(self): + + return self._SwitchPhases + + def setSwitchPhases(self, value): + for x in self._SwitchPhases: + x.Switch = None + for y in value: + y._Switch = self + self._SwitchPhases = value + + SwitchPhases = property(getSwitchPhases, setSwitchPhases) + + def addSwitchPhases(self, *SwitchPhases): + for obj in SwitchPhases: + obj.Switch = self + + def removeSwitchPhases(self, *SwitchPhases): + for obj in SwitchPhases: + obj.Switch = None + + def getCompositeSwitch(self): + """Composite switch this Switch belongs to + """ + return self._CompositeSwitch + + def setCompositeSwitch(self, value): + if self._CompositeSwitch is not None: + filtered = [x for x in self.CompositeSwitch.Switches if x != self] + self._CompositeSwitch._Switches = filtered + + self._CompositeSwitch = value + if self._CompositeSwitch is not None: + if self not in self._CompositeSwitch._Switches: + self._CompositeSwitch._Switches.append(self) + + CompositeSwitch = property(getCompositeSwitch, setCompositeSwitch) + diff --git a/CIM16/IEC61970/Wires/SwitchSchedule.py b/CIM16/IEC61970/Wires/SwitchSchedule.py new file mode 100755 index 00000000..4adb83fc --- /dev/null +++ b/CIM16/IEC61970/Wires/SwitchSchedule.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.LoadModel.SeasonDayTypeSchedule import SeasonDayTypeSchedule + +class SwitchSchedule(SeasonDayTypeSchedule): + """A schedule of switch positions. If RegularTimePoint.value1 is 0, the switch is open. If 1, the switch is closed.A schedule of switch positions. If RegularTimePoint.value1 is 0, the switch is open. If 1, the switch is closed. + """ + + def __init__(self, Switch=None, *args, **kw_args): + """Initialises a new 'SwitchSchedule' instance. + + @param Switch: A SwitchSchedule is associated with a Switch. + """ + self._Switch = None + self.Switch = Switch + + super(SwitchSchedule, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Switch"] + _many_refs = [] + + def getSwitch(self): + """A SwitchSchedule is associated with a Switch. + """ + return self._Switch + + def setSwitch(self, value): + if self._Switch is not None: + filtered = [x for x in self.Switch.SwitchSchedules if x != self] + self._Switch._SwitchSchedules = filtered + + self._Switch = value + if self._Switch is not None: + if self not in self._Switch._SwitchSchedules: + self._Switch._SwitchSchedules.append(self) + + Switch = property(getSwitch, setSwitch) + diff --git a/CIM16/IEC61970/Wires/SynchronousMachine.py b/CIM16/IEC61970/Wires/SynchronousMachine.py new file mode 100755 index 00000000..97f8f202 --- /dev/null +++ b/CIM16/IEC61970/Wires/SynchronousMachine.py @@ -0,0 +1,302 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.RegulatingCondEq import RegulatingCondEq + +class SynchronousMachine(RegulatingCondEq): + """An electromechanical device that operates synchronously with the network. It is a single machine operating either as a generator or synchronous condenser or pump.An electromechanical device that operates synchronously with the network. It is a single machine operating either as a generator or synchronous condenser or pump. + """ + + def __init__(self, ratedS=0.0, r2=0.0, r0=0.0, manualToAVR=0.0, qPercent=0.0, coolantCondition=0.0, condenserP=0.0, xQuadTrans=0.0, xQuadSubtrans=0.0, xQuadSync=0.0, xDirectSync=0.0, minQ=0.0, aVRToManualLag=0.0, damping=0.0, operatingMode="condenser", xDirectSubtrans=0.0, coolantType="air", aVRToManualLead=0.0, minU=0.0, maxQ=0.0, referencePriority=0, maxU=0.0, xDirectTrans=0.0, inertia=0.0, baseQ=0.0, type="condenser", r=0.0, x0=0.0, x2=0.0, x=0.0, PrimeMovers=None, GeneratingUnit=None, ReactiveCapabilityCurves=None, HydroPump=None, InitialReactiveCapabilityCurve=None, SynchronousMachineDynamics=None, *args, **kw_args): + """Initialises a new 'SynchronousMachine' instance. + + @param ratedS: Nameplate apparent power rating for the unit + @param r2: Negative sequence resistance. + @param r0: Zero sequence resistance of the synchronous machine. + @param manualToAVR: Time delay required when switching from Manual to Automatic Voltage Regulation. This value is used in the accelerating power reference frame for powerflow solutions + @param qPercent: Percent of the coordinated reactive control that comes from this machine. + @param coolantCondition: Temperature or pressure of coolant medium + @param condenserP: Active power consumed when in condenser mode operation. + @param xQuadTrans: Quadrature-axis transient reactance, also known as X'q. + @param xQuadSubtrans: Quadrature-axis subtransient reactance, also known as X'q. + @param xQuadSync: Quadrature-axis synchronous reactance (Xq) , the ratio of the component of reactive armature voltage, due to the quadrature-axis component of armature current, to this component of current, under steady state conditions and at rated frequency. + @param xDirectSync: Direct-axis synchronous reactance. The quotient of a sustained value of that AC component of armature voltage that is produced by the total direct-axis flux due to direct-axis armature current and the value of the AC component of this current, the machine running at rated speed. (Xd) + @param minQ: Minimum reactive power limit for the unit. + @param aVRToManualLag: Time delay required when switching from Automatic Voltage Regulation (AVR) to Manual for a lagging MVAr violation. + @param damping: Damping torque coefficient, a proportionality constant that, when multiplied by the angular velocity of the rotor poles with respect to the magnetic field (frequency), results in the damping torque. + @param operatingMode: Current mode of operation. Values are: "condenser", "generator" + @param xDirectSubtrans: Direct-axis subtransient reactance, also known as X'd. + @param coolantType: Method of cooling the machine. Values are: "air", "hydrogenGas", "water" + @param aVRToManualLead: Time delay required when switching from Automatic Voltage Regulation (AVR) to Manual for a leading MVAr violation. + @param minU: Minimum voltage limit for the unit. + @param maxQ: Maximum reactive power limit. This is the maximum (nameplate) limit for the unit. + @param referencePriority: Priority of unit for reference bus selection. 0 = don t care (default) 1 = highest priority. 2 is less than 1 and so on. + @param maxU: Maximum voltage limit for the unit. + @param xDirectTrans: Direct-axis transient reactance, also known as X'd. + @param inertia: The energy stored in the rotor when operating at rated speed. This value is used in the accelerating power reference frame for operator training simulator solutions. + @param baseQ: Default base reactive power value. This value represents the initial reactive power that can be used by any application function. + @param type: Modes that this synchronous machine can operate in. Values are: "condenser", "generator_or_condenser", "generator" + @param r: Positive sequence resistance of the synchronous machine. + @param x0: Zero sequence reactance of the synchronous machine. + @param x2: Negative sequence reactance. + @param x: Positive sequence reactance of the synchronous machine. + @param PrimeMovers: Prime movers that drive this SynchronousMachine. + @param GeneratingUnit: A synchronous machine may operate as a generator and as such becomes a member of a generating unit + @param ReactiveCapabilityCurves: All available Reactive capability curves for this SynchronousMachine. + @param HydroPump: The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating. + @param InitialReactiveCapabilityCurve: The default ReactiveCapabilityCurve for use by a SynchronousMachine + """ + #: Nameplate apparent power rating for the unit + self.ratedS = ratedS + + #: Negative sequence resistance. + self.r2 = r2 + + #: Zero sequence resistance of the synchronous machine. + self.r0 = r0 + + #: Time delay required when switching from Manual to Automatic Voltage Regulation. This value is used in the accelerating power reference frame for powerflow solutions + self.manualToAVR = manualToAVR + + #: Percent of the coordinated reactive control that comes from this machine. + self.qPercent = qPercent + + #: Temperature or pressure of coolant medium + self.coolantCondition = coolantCondition + + #: Active power consumed when in condenser mode operation. + self.condenserP = condenserP + + #: Quadrature-axis transient reactance, also known as X'q. + self.xQuadTrans = xQuadTrans + + #: Quadrature-axis subtransient reactance, also known as X'q. + self.xQuadSubtrans = xQuadSubtrans + + #: Quadrature-axis synchronous reactance (Xq) , the ratio of the component of reactive armature voltage, due to the quadrature-axis component of armature current, to this component of current, under steady state conditions and at rated frequency. + self.xQuadSync = xQuadSync + + #: Direct-axis synchronous reactance. The quotient of a sustained value of that AC component of armature voltage that is produced by the total direct-axis flux due to direct-axis armature current and the value of the AC component of this current, the machine running at rated speed. (Xd) + self.xDirectSync = xDirectSync + + #: Minimum reactive power limit for the unit. + self.minQ = minQ + + #: Time delay required when switching from Automatic Voltage Regulation (AVR) to Manual for a lagging MVAr violation. + self.aVRToManualLag = aVRToManualLag + + #: Damping torque coefficient, a proportionality constant that, when multiplied by the angular velocity of the rotor poles with respect to the magnetic field (frequency), results in the damping torque. + self.damping = damping + + #: Current mode of operation. Values are: "condenser", "generator" + self.operatingMode = operatingMode + + #: Direct-axis subtransient reactance, also known as X'd. + self.xDirectSubtrans = xDirectSubtrans + + #: Method of cooling the machine. Values are: "air", "hydrogenGas", "water" + self.coolantType = coolantType + + #: Time delay required when switching from Automatic Voltage Regulation (AVR) to Manual for a leading MVAr violation. + self.aVRToManualLead = aVRToManualLead + + #: Minimum voltage limit for the unit. + self.minU = minU + + #: Maximum reactive power limit. This is the maximum (nameplate) limit for the unit. + self.maxQ = maxQ + + #: Priority of unit for reference bus selection. 0 = don t care (default) 1 = highest priority. 2 is less than 1 and so on. + self.referencePriority = referencePriority + + #: Maximum voltage limit for the unit. + self.maxU = maxU + + #: Direct-axis transient reactance, also known as X'd. + self.xDirectTrans = xDirectTrans + + #: The energy stored in the rotor when operating at rated speed. This value is used in the accelerating power reference frame for operator training simulator solutions. + self.inertia = inertia + + #: Default base reactive power value. This value represents the initial reactive power that can be used by any application function. + self.baseQ = baseQ + + #: Modes that this synchronous machine can operate in. Values are: "condenser", "generator_or_condenser", "generator" + self.type = type + + #: Positive sequence resistance of the synchronous machine. + self.r = r + + #: Zero sequence reactance of the synchronous machine. + self.x0 = x0 + + #: Negative sequence reactance. + self.x2 = x2 + + #: Positive sequence reactance of the synchronous machine. + self.x = x + + self._PrimeMovers = [] + self.PrimeMovers = [] if PrimeMovers is None else PrimeMovers + + self._GeneratingUnit = None + self.GeneratingUnit = GeneratingUnit + + self._ReactiveCapabilityCurves = [] + self.ReactiveCapabilityCurves = [] if ReactiveCapabilityCurves is None else ReactiveCapabilityCurves + + self._HydroPump = None + self.HydroPump = HydroPump + + self._InitialReactiveCapabilityCurve = None + self.InitialReactiveCapabilityCurve = InitialReactiveCapabilityCurve + + self._SynchronousMachineDynamics = None + self.SynchronousMachineDynamics = SynchronousMachineDynamics + + super(SynchronousMachine, self).__init__(*args, **kw_args) + + _attrs = ["ratedS", "r2", "r0", "manualToAVR", "qPercent", "coolantCondition", "condenserP", "xQuadTrans", "xQuadSubtrans", "xQuadSync", "xDirectSync", "minQ", "aVRToManualLag", "damping", "operatingMode", "xDirectSubtrans", "coolantType", "aVRToManualLead", "minU", "maxQ", "referencePriority", "maxU", "xDirectTrans", "inertia", "baseQ", "type", "r", "x0", "x2", "x"] + _attr_types = {"ratedS": float, "r2": float, "r0": float, "manualToAVR": float, "qPercent": float, "coolantCondition": float, "condenserP": float, "xQuadTrans": float, "xQuadSubtrans": float, "xQuadSync": float, "xDirectSync": float, "minQ": float, "aVRToManualLag": float, "damping": float, "operatingMode": str, "xDirectSubtrans": float, "coolantType": str, "aVRToManualLead": float, "minU": float, "maxQ": float, "referencePriority": int, "maxU": float, "xDirectTrans": float, "inertia": float, "baseQ": float, "type": str, "r": float, "x0": float, "x2": float, "x": float} + _defaults = {"ratedS": 0.0, "r2": 0.0, "r0": 0.0, "manualToAVR": 0.0, "qPercent": 0.0, "coolantCondition": 0.0, "condenserP": 0.0, "xQuadTrans": 0.0, "xQuadSubtrans": 0.0, "xQuadSync": 0.0, "xDirectSync": 0.0, "minQ": 0.0, "aVRToManualLag": 0.0, "damping": 0.0, "operatingMode": "condenser", "xDirectSubtrans": 0.0, "coolantType": "air", "aVRToManualLead": 0.0, "minU": 0.0, "maxQ": 0.0, "referencePriority": 0, "maxU": 0.0, "xDirectTrans": 0.0, "inertia": 0.0, "baseQ": 0.0, "type": "condenser", "r": 0.0, "x0": 0.0, "x2": 0.0, "x": 0.0} + _enums = {"operatingMode": "SynchronousMachineOperatingMode", "coolantType": "CoolantType", "type": "SynchronousMachineType"} + _refs = ["PrimeMovers", "GeneratingUnit", "ReactiveCapabilityCurves", "HydroPump", "InitialReactiveCapabilityCurve", "SynchronousMachineDynamics"] + _many_refs = ["PrimeMovers", "ReactiveCapabilityCurves"] + + def getPrimeMovers(self): + """Prime movers that drive this SynchronousMachine. + """ + return self._PrimeMovers + + def setPrimeMovers(self, value): + for p in self._PrimeMovers: + filtered = [q for q in p.SynchronousMachines if q != self] + self._PrimeMovers._SynchronousMachines = filtered + for r in value: + if self not in r._SynchronousMachines: + r._SynchronousMachines.append(self) + self._PrimeMovers = value + + PrimeMovers = property(getPrimeMovers, setPrimeMovers) + + def addPrimeMovers(self, *PrimeMovers): + for obj in PrimeMovers: + if self not in obj._SynchronousMachines: + obj._SynchronousMachines.append(self) + self._PrimeMovers.append(obj) + + def removePrimeMovers(self, *PrimeMovers): + for obj in PrimeMovers: + if self in obj._SynchronousMachines: + obj._SynchronousMachines.remove(self) + self._PrimeMovers.remove(obj) + + def getGeneratingUnit(self): + """A synchronous machine may operate as a generator and as such becomes a member of a generating unit + """ + return self._GeneratingUnit + + def setGeneratingUnit(self, value): + if self._GeneratingUnit is not None: + filtered = [x for x in self.GeneratingUnit.SynchronousMachines if x != self] + self._GeneratingUnit._SynchronousMachines = filtered + + self._GeneratingUnit = value + if self._GeneratingUnit is not None: + if self not in self._GeneratingUnit._SynchronousMachines: + self._GeneratingUnit._SynchronousMachines.append(self) + + GeneratingUnit = property(getGeneratingUnit, setGeneratingUnit) + + def getReactiveCapabilityCurves(self): + """All available Reactive capability curves for this SynchronousMachine. + """ + return self._ReactiveCapabilityCurves + + def setReactiveCapabilityCurves(self, value): + for p in self._ReactiveCapabilityCurves: + filtered = [q for q in p.SynchronousMachines if q != self] + self._ReactiveCapabilityCurves._SynchronousMachines = filtered + for r in value: + if self not in r._SynchronousMachines: + r._SynchronousMachines.append(self) + self._ReactiveCapabilityCurves = value + + ReactiveCapabilityCurves = property(getReactiveCapabilityCurves, setReactiveCapabilityCurves) + + def addReactiveCapabilityCurves(self, *ReactiveCapabilityCurves): + for obj in ReactiveCapabilityCurves: + if self not in obj._SynchronousMachines: + obj._SynchronousMachines.append(self) + self._ReactiveCapabilityCurves.append(obj) + + def removeReactiveCapabilityCurves(self, *ReactiveCapabilityCurves): + for obj in ReactiveCapabilityCurves: + if self in obj._SynchronousMachines: + obj._SynchronousMachines.remove(self) + self._ReactiveCapabilityCurves.remove(obj) + + def getHydroPump(self): + """The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating. + """ + return self._HydroPump + + def setHydroPump(self, value): + if self._HydroPump is not None: + self._HydroPump._SynchronousMachine = None + + self._HydroPump = value + if self._HydroPump is not None: + self._HydroPump.SynchronousMachine = None + self._HydroPump._SynchronousMachine = self + + HydroPump = property(getHydroPump, setHydroPump) + + def getInitialReactiveCapabilityCurve(self): + """The default ReactiveCapabilityCurve for use by a SynchronousMachine + """ + return self._InitialReactiveCapabilityCurve + + def setInitialReactiveCapabilityCurve(self, value): + if self._InitialReactiveCapabilityCurve is not None: + filtered = [x for x in self.InitialReactiveCapabilityCurve.InitiallyUsedBySynchronousMachines if x != self] + self._InitialReactiveCapabilityCurve._InitiallyUsedBySynchronousMachines = filtered + + self._InitialReactiveCapabilityCurve = value + if self._InitialReactiveCapabilityCurve is not None: + if self not in self._InitialReactiveCapabilityCurve._InitiallyUsedBySynchronousMachines: + self._InitialReactiveCapabilityCurve._InitiallyUsedBySynchronousMachines.append(self) + + InitialReactiveCapabilityCurve = property(getInitialReactiveCapabilityCurve, setInitialReactiveCapabilityCurve) + + def getSynchronousMachineDynamics(self): + """The default ReactiveCapabilityCurve for use by a SynchronousMachine + """ + return self._SynchronousMachineDynamics + + def setSynchronousMachineDynamics(self, value): + if self._SynchronousMachineDynamics is not None: + self._SynchronousMachineDynamics._SynchronousMachine = None + + self._SynchronousMachineDynamics = value + if self._SynchronousMachineDynamics is not None: + self._SynchronousMachineDynamics.SynchronousMachine = None + self._SynchronousMachineDynamics._SynchronousMachine = self + SynchronousMachineDynamics = property(getSynchronousMachineDynamics, setSynchronousMachineDynamics) diff --git a/CIM16/IEC61970/Wires/TapChanger.py b/CIM16/IEC61970/Wires/TapChanger.py new file mode 100755 index 00000000..4ac9ac94 --- /dev/null +++ b/CIM16/IEC61970/Wires/TapChanger.py @@ -0,0 +1,162 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class TapChanger(PowerSystemResource): + """Mechanism for changing transformer winding tap positions.Mechanism for changing transformer winding tap positions. + """ + + def __init__(self, neutralU=0.0, regulationStatus=False, subsequentDelay=0.0, normalStep=0, ltcFlag=False, lowStep=0, neutralStep=0, initialDelay=0.0, highStep=0, TapChangerInfo=None, TapSchedules=None, TapChangerControl=None, SvTapStep=None, *args, **kw_args): + """Initialises a new 'TapChanger' instance. + + @param neutralU: Voltage at which the winding operates at the neutral tap setting. + @param regulationStatus: Specifies the default regulation status of the TapChanger. True is regulating. False is not regulating. + @param subsequentDelay: For an LTC, the delay for subsequent tap changer operation (second and later step changes) + @param normalStep: The tap step position used in 'normal' network operation for this winding. For a 'Fixed' tap changer indicates the current physical tap setting. + @param ltcFlag: Specifies whether or not a TapChanger has load tap changing capabilities. + @param lowStep: Lowest possible tap step position, retard from neutral + @param neutralStep: The neutral tap step position for this winding. + @param initialDelay: For an LTC, the delay for initial tap changer operation (first step change) + @param highStep: Highest possible tap step position, advance from neutral + @param TapChangerInfo: Data for this tap changer. + @param TapSchedules: A TapChanger can have TapSchedules. + @param TapChangerControl: + @param SvTapStep: The tap step state associated with the tap changer. + """ + #: Voltage at which the winding operates at the neutral tap setting. + self.neutralU = neutralU + + #: Specifies the default regulation status of the TapChanger. True is regulating. False is not regulating. + self.regulationStatus = regulationStatus + + #: For an LTC, the delay for subsequent tap changer operation (second and later step changes) + self.subsequentDelay = subsequentDelay + + #: The tap step position used in 'normal' network operation for this winding. For a 'Fixed' tap changer indicates the current physical tap setting. + self.normalStep = normalStep + + #: Specifies whether or not a TapChanger has load tap changing capabilities. + self.ltcFlag = ltcFlag + + #: Lowest possible tap step position, retard from neutral + self.lowStep = lowStep + + #: The neutral tap step position for this winding. + self.neutralStep = neutralStep + + #: For an LTC, the delay for initial tap changer operation (first step change) + self.initialDelay = initialDelay + + #: Highest possible tap step position, advance from neutral + self.highStep = highStep + + self._TapChangerInfo = None + self.TapChangerInfo = TapChangerInfo + + self._TapSchedules = [] + self.TapSchedules = [] if TapSchedules is None else TapSchedules + + self._TapChangerControl = None + self.TapChangerControl = TapChangerControl + + self._SvTapStep = None + self.SvTapStep = SvTapStep + + super(TapChanger, self).__init__(*args, **kw_args) + + _attrs = ["neutralU", "regulationStatus", "subsequentDelay", "normalStep", "ltcFlag", "lowStep", "neutralStep", "initialDelay", "highStep"] + _attr_types = {"neutralU": float, "regulationStatus": bool, "subsequentDelay": float, "normalStep": int, "ltcFlag": bool, "lowStep": int, "neutralStep": int, "initialDelay": float, "highStep": int} + _defaults = {"neutralU": 0.0, "regulationStatus": False, "subsequentDelay": 0.0, "normalStep": 0, "ltcFlag": False, "lowStep": 0, "neutralStep": 0, "initialDelay": 0.0, "highStep": 0} + _enums = {} + _refs = ["TapChangerInfo", "TapSchedules", "TapChangerControl", "SvTapStep"] + _many_refs = ["TapSchedules"] + + def getTapChangerInfo(self): + """Data for this tap changer. + """ + return self._TapChangerInfo + + def setTapChangerInfo(self, value): + if self._TapChangerInfo is not None: + filtered = [x for x in self.TapChangerInfo.TapChangers if x != self] + self._TapChangerInfo._TapChangers = filtered + + self._TapChangerInfo = value + if self._TapChangerInfo is not None: + if self not in self._TapChangerInfo._TapChangers: + self._TapChangerInfo._TapChangers.append(self) + + TapChangerInfo = property(getTapChangerInfo, setTapChangerInfo) + + def getTapSchedules(self): + """A TapChanger can have TapSchedules. + """ + return self._TapSchedules + + def setTapSchedules(self, value): + for x in self._TapSchedules: + x.TapChanger = None + for y in value: + y._TapChanger = self + self._TapSchedules = value + + TapSchedules = property(getTapSchedules, setTapSchedules) + + def addTapSchedules(self, *TapSchedules): + for obj in TapSchedules: + obj.TapChanger = self + + def removeTapSchedules(self, *TapSchedules): + for obj in TapSchedules: + obj.TapChanger = None + + def getTapChangerControl(self): + + return self._TapChangerControl + + def setTapChangerControl(self, value): + if self._TapChangerControl is not None: + filtered = [x for x in self.TapChangerControl.TapChanger if x != self] + self._TapChangerControl._TapChanger = filtered + + self._TapChangerControl = value + if self._TapChangerControl is not None: + if self not in self._TapChangerControl._TapChanger: + self._TapChangerControl._TapChanger.append(self) + + TapChangerControl = property(getTapChangerControl, setTapChangerControl) + + def getSvTapStep(self): + """The tap step state associated with the tap changer. + """ + return self._SvTapStep + + def setSvTapStep(self, value): + if self._SvTapStep is not None: + self._SvTapStep._TapChanger = None + + self._SvTapStep = value + if self._SvTapStep is not None: + self._SvTapStep.TapChanger = None + self._SvTapStep._TapChanger = self + + SvTapStep = property(getSvTapStep, setSvTapStep) + diff --git a/CIM16/IEC61970/Wires/TapChangerControl.py b/CIM16/IEC61970/Wires/TapChangerControl.py new file mode 100755 index 00000000..2fdce4de --- /dev/null +++ b/CIM16/IEC61970/Wires/TapChangerControl.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.RegulatingControl import RegulatingControl + +class TapChangerControl(RegulatingControl): + """TapChangerControl discribe behaviour specific to tap changers, e.g. how the voltage at the end of a line varies with the load level and compensation of the voltage drop by tap adjustment.TapChangerControl discribe behaviour specific to tap changers, e.g. how the voltage at the end of a line varies with the load level and compensation of the voltage drop by tap adjustment. + """ + + def __init__(self, lineDropR=0.0, lineDropX=0.0, reverseLineDropX=0.0, reverseLineDropR=0.0, lineDropCompensation=False, limitVoltage=0.0, TapChanger=None, *args, **kw_args): + """Initialises a new 'TapChangerControl' instance. + + @param lineDropR: Line drop compensator resistance setting for normal (forward) power flow. + @param lineDropX: Line drop compensator reactance setting for normal (forward) power flow. + @param reverseLineDropX: Line drop compensator reactance setting for reverse power flow. + @param reverseLineDropR: Line drop compensator resistance setting for reverse power flow. + @param lineDropCompensation: If true, the line drop compensation is to be applied. + @param limitVoltage: Maximum allowed regulated voltage on the PT secondary base, regardless of line drop compensation. Sometimes referred to as first-house protection. + @param TapChanger: copy from reg conduting eq + """ + #: Line drop compensator resistance setting for normal (forward) power flow. + self.lineDropR = lineDropR + + #: Line drop compensator reactance setting for normal (forward) power flow. + self.lineDropX = lineDropX + + #: Line drop compensator reactance setting for reverse power flow. + self.reverseLineDropX = reverseLineDropX + + #: Line drop compensator resistance setting for reverse power flow. + self.reverseLineDropR = reverseLineDropR + + #: If true, the line drop compensation is to be applied. + self.lineDropCompensation = lineDropCompensation + + #: Maximum allowed regulated voltage on the PT secondary base, regardless of line drop compensation. Sometimes referred to as first-house protection. + self.limitVoltage = limitVoltage + + self._TapChanger = [] + self.TapChanger = [] if TapChanger is None else TapChanger + + super(TapChangerControl, self).__init__(*args, **kw_args) + + _attrs = ["lineDropR", "lineDropX", "reverseLineDropX", "reverseLineDropR", "lineDropCompensation", "limitVoltage"] + _attr_types = {"lineDropR": float, "lineDropX": float, "reverseLineDropX": float, "reverseLineDropR": float, "lineDropCompensation": bool, "limitVoltage": float} + _defaults = {"lineDropR": 0.0, "lineDropX": 0.0, "reverseLineDropX": 0.0, "reverseLineDropR": 0.0, "lineDropCompensation": False, "limitVoltage": 0.0} + _enums = {} + _refs = ["TapChanger"] + _many_refs = ["TapChanger"] + + def getTapChanger(self): + """copy from reg conduting eq + """ + return self._TapChanger + + def setTapChanger(self, value): + for x in self._TapChanger: + x.TapChangerControl = None + for y in value: + y._TapChangerControl = self + self._TapChanger = value + + TapChanger = property(getTapChanger, setTapChanger) + + def addTapChanger(self, *TapChanger): + for obj in TapChanger: + obj.TapChangerControl = self + + def removeTapChanger(self, *TapChanger): + for obj in TapChanger: + obj.TapChangerControl = None + diff --git a/CIM16/IEC61970/Wires/TapSchedule.py b/CIM16/IEC61970/Wires/TapSchedule.py new file mode 100755 index 00000000..5bd937f2 --- /dev/null +++ b/CIM16/IEC61970/Wires/TapSchedule.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.LoadModel.SeasonDayTypeSchedule import SeasonDayTypeSchedule + +class TapSchedule(SeasonDayTypeSchedule): + """A pre-established pattern over time for a tap step.A pre-established pattern over time for a tap step. + """ + + def __init__(self, TapChanger=None, *args, **kw_args): + """Initialises a new 'TapSchedule' instance. + + @param TapChanger: A TapSchedule is associated with a TapChanger. + """ + self._TapChanger = None + self.TapChanger = TapChanger + + super(TapSchedule, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TapChanger"] + _many_refs = [] + + def getTapChanger(self): + """A TapSchedule is associated with a TapChanger. + """ + return self._TapChanger + + def setTapChanger(self, value): + if self._TapChanger is not None: + filtered = [x for x in self.TapChanger.TapSchedules if x != self] + self._TapChanger._TapSchedules = filtered + + self._TapChanger = value + if self._TapChanger is not None: + if self not in self._TapChanger._TapSchedules: + self._TapChanger._TapSchedules.append(self) + + TapChanger = property(getTapChanger, setTapChanger) + diff --git a/CIM16/IEC61970/Wires/TransformerCoreAdmittance.py b/CIM16/IEC61970/Wires/TransformerCoreAdmittance.py new file mode 100755 index 00000000..498207ed --- /dev/null +++ b/CIM16/IEC61970/Wires/TransformerCoreAdmittance.py @@ -0,0 +1,99 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerCoreAdmittance(IdentifiedObject): + + def __init__(self, g0=0.0, b0=0.0, g=0.0, b=0.0, TransformerEndInfo=None, TransformerEnd=None, *args, **kw_args): + """Initialises a new 'TransformerCoreAdmittance' instance. + + @param g0: Zero sequence magnetizing branch conductance. + @param b0: Zero sequence magnetizing branch susceptance. + @param g: Magnetizing branch conductance (G mag). + @param b: Magnetizing branch susceptance (B mag). The value can be positive or negative. + @param TransformerEndInfo: Transformer end info having this core admittance. + @param TransformerEnd: All transformer ends having this core admittance. + """ + #: Zero sequence magnetizing branch conductance. + self.g0 = g0 + + #: Zero sequence magnetizing branch susceptance. + self.b0 = b0 + + #: Magnetizing branch conductance (G mag). + self.g = g + + #: Magnetizing branch susceptance (B mag). The value can be positive or negative. + self.b = b + + self._TransformerEndInfo = None + self.TransformerEndInfo = TransformerEndInfo + + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + super(TransformerCoreAdmittance, self).__init__(*args, **kw_args) + + _attrs = ["g0", "b0", "g", "b"] + _attr_types = {"g0": float, "b0": float, "g": float, "b": float} + _defaults = {"g0": 0.0, "b0": 0.0, "g": 0.0, "b": 0.0} + _enums = {} + _refs = ["TransformerEndInfo", "TransformerEnd"] + _many_refs = ["TransformerEnd"] + + def getTransformerEndInfo(self): + """Transformer end info having this core admittance. + """ + return self._TransformerEndInfo + + def setTransformerEndInfo(self, value): + if self._TransformerEndInfo is not None: + self._TransformerEndInfo._CoreAdmittance = None + + self._TransformerEndInfo = value + if self._TransformerEndInfo is not None: + self._TransformerEndInfo.CoreAdmittance = None + self._TransformerEndInfo._CoreAdmittance = self + + TransformerEndInfo = property(getTransformerEndInfo, setTransformerEndInfo) + + def getTransformerEnd(self): + """All transformer ends having this core admittance. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.CoreAdmittance = None + for y in value: + y._CoreAdmittance = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.CoreAdmittance = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.CoreAdmittance = None + diff --git a/CIM16/IEC61970/Wires/TransformerEnd.py b/CIM16/IEC61970/Wires/TransformerEnd.py new file mode 100755 index 00000000..8cdd06d0 --- /dev/null +++ b/CIM16/IEC61970/Wires/TransformerEnd.py @@ -0,0 +1,317 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerEnd(IdentifiedObject): + """TransformerEnd is a conducting connection point of a power transformer. It corresponds to a physical transformer winding terminal. In earlier CIM versions, the TransformerWinding class served a similar purpose. This successor TransformerEnd class is more flexible and has important differences with TransformerWinding.TransformerEnd is a conducting connection point of a power transformer. It corresponds to a physical transformer winding terminal. In earlier CIM versions, the TransformerWinding class served a similar purpose. This successor TransformerEnd class is more flexible and has important differences with TransformerWinding. + """ + + def __init__(self, endNumber=0, rground=0.0, grounded=False, magBaseU=0.0, magSatFlux=0.0, bmagSat=0.0, xground=0.0, Terminal=None, FromWindingInsulations=None, CoreAdmittance=None, TransformerEndInfo=None, PhaseTapChanger=None, RatioTapChanger=None, FromMeshImpedance=None, ToWindingInsulations=None, ToMeshImpedance=None, StarImpedance=None, BaseVoltage=None, *args, **kw_args): + """Initialises a new 'TransformerEnd' instance. + + @param endNumber: Number for this transformer end, corresponding to the end's order in the PowerTransformer.vectorGroup attribute. Highest voltage winding should be 1. + @param rground: (for Yn and Zn connections) Resistance part of neutral impedance where 'grounded' is true. + @param grounded: (for Yn and Zn connections) True if the neutral is solidly grounded. + @param magBaseU: The reference voltage at which the magnetizing saturation measurements were made + @param magSatFlux: Core magnetizing saturation curve knee flux level. + @param bmagSat: Core shunt magnetizing susceptance in the saturation region. + @param xground: (for Yn and Zn connections) Reactive part of neutral impedance where 'grounded' is true. + @param Terminal: External terminal of the power transformer to which this end belongs. + @param FromWindingInsulations: + @param CoreAdmittance: Core admittance of this transformer end, representing magnetising current and core losses. The full values of the transformer should be supplied for one transformer end only. + @param TransformerEndInfo: Data for this transformer end. + @param PhaseTapChanger: Phase tap changer associated with this transformer end. + @param RatioTapChanger: Ratio tap changer associated with this transformer end. + @param FromMeshImpedance: All mesh impedances between this 'to' and other 'from' transformer ends. + @param ToWindingInsulations: + @param ToMeshImpedance: All mesh impedances between this 'from' and other 'to' transformer ends. + @param StarImpedance: (accurate for 2- or 3-winding transformers only) Pi-model impedances of this transformer end. By convention, for a two winding transformer, the full values of the transformer should be entered on the high voltage end (endNumber=1). + """ + #: Number for this transformer end, corresponding to the end's order in the PowerTransformer.vectorGroup attribute. Highest voltage winding should be 1. + self.endNumber = endNumber + + #: (for Yn and Zn connections) Resistance part of neutral impedance where 'grounded' is true. + self.rground = rground + + #: (for Yn and Zn connections) True if the neutral is solidly grounded. + self.grounded = grounded + + #: The reference voltage at which the magnetizing saturation measurements were made + self.magBaseU = magBaseU + + #: Core magnetizing saturation curve knee flux level. + self.magSatFlux = magSatFlux + + #: Core shunt magnetizing susceptance in the saturation region. + self.bmagSat = bmagSat + + #: (for Yn and Zn connections) Reactive part of neutral impedance where 'grounded' is true. + self.xground = xground + + self._Terminal = None + self.Terminal = Terminal + + self._FromWindingInsulations = [] + self.FromWindingInsulations = [] if FromWindingInsulations is None else FromWindingInsulations + + self._CoreAdmittance = None + self.CoreAdmittance = CoreAdmittance + + self._TransformerEndInfo = None + self.TransformerEndInfo = TransformerEndInfo + + self._PhaseTapChanger = None + self.PhaseTapChanger = PhaseTapChanger + + self._RatioTapChanger = None + self.RatioTapChanger = RatioTapChanger + + self._FromMeshImpedance = [] + self.FromMeshImpedance = [] if FromMeshImpedance is None else FromMeshImpedance + + self._ToWindingInsulations = [] + self.ToWindingInsulations = [] if ToWindingInsulations is None else ToWindingInsulations + + self._ToMeshImpedance = [] + self.ToMeshImpedance = [] if ToMeshImpedance is None else ToMeshImpedance + + self._StarImpedance = None + self.StarImpedance = StarImpedance + + self._BaseVoltage = None + self.BaseVoltage = BaseVoltage + + super(TransformerEnd, self).__init__(*args, **kw_args) + + _attrs = ["endNumber", "rground", "grounded", "magBaseU", "magSatFlux", "bmagSat", "xground"] + _attr_types = {"endNumber": int, "rground": float, "grounded": bool, "magBaseU": float, "magSatFlux": float, "bmagSat": float, "xground": float} + _defaults = {"endNumber": 0, "rground": 0.0, "grounded": False, "magBaseU": 0.0, "magSatFlux": 0.0, "bmagSat": 0.0, "xground": 0.0} + _enums = {} + _refs = ["Terminal", "FromWindingInsulations", "CoreAdmittance", "TransformerEndInfo", "PhaseTapChanger", "RatioTapChanger", "FromMeshImpedance", "ToWindingInsulations", "ToMeshImpedance", "StarImpedance", "BaseVoltage"] + _many_refs = ["FromWindingInsulations", "FromMeshImpedance", "ToWindingInsulations", "ToMeshImpedance"] + + def getBaseVoltage(self): + return self._BaseVoltage + + def setBaseVoltage(self, value): + if self._BaseVoltage is not None: + filtered = [x for x in self.BaseVoltage.TransformerEnd if x != self] + self._BaseVoltage._TransformerEnd = filtered + + self._BaseVoltage = value + if self._BaseVoltage is not None: + if self not in self._BaseVoltage._TransformerEnd: + self._BaseVoltage._TransformerEnd.append(self) + + BaseVoltage = property(getBaseVoltage, setBaseVoltage) + + def getTerminal(self): + """External terminal of the power transformer to which this end belongs. + """ + return self._Terminal + + def setTerminal(self, value): + if self._Terminal is not None: + filtered = [x for x in self.Terminal.TransformerEnd if x != self] + self._Terminal._TransformerEnd = filtered + + self._Terminal = value + if self._Terminal is not None: + if self not in self._Terminal._TransformerEnd: + self._Terminal._TransformerEnd.append(self) + + Terminal = property(getTerminal, setTerminal) + + def getFromWindingInsulations(self): + + return self._FromWindingInsulations + + def setFromWindingInsulations(self, value): + for x in self._FromWindingInsulations: + x.FromWinding = None + for y in value: + y._FromWinding = self + self._FromWindingInsulations = value + + FromWindingInsulations = property(getFromWindingInsulations, setFromWindingInsulations) + + def addFromWindingInsulations(self, *FromWindingInsulations): + for obj in FromWindingInsulations: + obj.FromWinding = self + + def removeFromWindingInsulations(self, *FromWindingInsulations): + for obj in FromWindingInsulations: + obj.FromWinding = None + + def getCoreAdmittance(self): + """Core admittance of this transformer end, representing magnetising current and core losses. The full values of the transformer should be supplied for one transformer end only. + """ + return self._CoreAdmittance + + def setCoreAdmittance(self, value): + if self._CoreAdmittance is not None: + filtered = [x for x in self.CoreAdmittance.TransformerEnd if x != self] + self._CoreAdmittance._TransformerEnd = filtered + + self._CoreAdmittance = value + if self._CoreAdmittance is not None: + if self not in self._CoreAdmittance._TransformerEnd: + self._CoreAdmittance._TransformerEnd.append(self) + + CoreAdmittance = property(getCoreAdmittance, setCoreAdmittance) + + def getTransformerEndInfo(self): + """Data for this transformer end. + """ + return self._TransformerEndInfo + + def setTransformerEndInfo(self, value): + if self._TransformerEndInfo is not None: + filtered = [x for x in self.TransformerEndInfo.TransformerEnd if x != self] + self._TransformerEndInfo._TransformerEnd = filtered + + self._TransformerEndInfo = value + if self._TransformerEndInfo is not None: + if self not in self._TransformerEndInfo._TransformerEnd: + self._TransformerEndInfo._TransformerEnd.append(self) + + TransformerEndInfo = property(getTransformerEndInfo, setTransformerEndInfo) + + def getPhaseTapChanger(self): + """Phase tap changer associated with this transformer end. + """ + return self._PhaseTapChanger + + def setPhaseTapChanger(self, value): + if self._PhaseTapChanger is not None: + self._PhaseTapChanger._TransformerEnd = None + + self._PhaseTapChanger = value + if self._PhaseTapChanger is not None: + self._PhaseTapChanger.TransformerEnd = None + self._PhaseTapChanger._TransformerEnd = self + + PhaseTapChanger = property(getPhaseTapChanger, setPhaseTapChanger) + + def getRatioTapChanger(self): + """Ratio tap changer associated with this transformer end. + """ + return self._RatioTapChanger + + def setRatioTapChanger(self, value): + if self._RatioTapChanger is not None: + self._RatioTapChanger._TransformerEnd = None + + self._RatioTapChanger = value + if self._RatioTapChanger is not None: + self._RatioTapChanger.TransformerEnd = None + self._RatioTapChanger._TransformerEnd = self + + RatioTapChanger = property(getRatioTapChanger, setRatioTapChanger) + + def getFromMeshImpedance(self): + """All mesh impedances between this 'to' and other 'from' transformer ends. + """ + return self._FromMeshImpedance + + def setFromMeshImpedance(self, value): + for x in self._FromMeshImpedance: + x.FromTransformerEnd = None + for y in value: + y._FromTransformerEnd = self + self._FromMeshImpedance = value + + FromMeshImpedance = property(getFromMeshImpedance, setFromMeshImpedance) + + def addFromMeshImpedance(self, *FromMeshImpedance): + for obj in FromMeshImpedance: + obj.FromTransformerEnd = self + + def removeFromMeshImpedance(self, *FromMeshImpedance): + for obj in FromMeshImpedance: + obj.FromTransformerEnd = None + + def getToWindingInsulations(self): + + return self._ToWindingInsulations + + def setToWindingInsulations(self, value): + for x in self._ToWindingInsulations: + x.ToWinding = None + for y in value: + y._ToWinding = self + self._ToWindingInsulations = value + + ToWindingInsulations = property(getToWindingInsulations, setToWindingInsulations) + + def addToWindingInsulations(self, *ToWindingInsulations): + for obj in ToWindingInsulations: + obj.ToWinding = self + + def removeToWindingInsulations(self, *ToWindingInsulations): + for obj in ToWindingInsulations: + obj.ToWinding = None + + def getToMeshImpedance(self): + """All mesh impedances between this 'from' and other 'to' transformer ends. + """ + return self._ToMeshImpedance + + def setToMeshImpedance(self, value): + for p in self._ToMeshImpedance: + filtered = [q for q in p.ToTransformerEnd if q != self] + self._ToMeshImpedance._ToTransformerEnd = filtered + for r in value: + if self not in r._ToTransformerEnd: + r._ToTransformerEnd.append(self) + self._ToMeshImpedance = value + + ToMeshImpedance = property(getToMeshImpedance, setToMeshImpedance) + + def addToMeshImpedance(self, *ToMeshImpedance): + for obj in ToMeshImpedance: + if self not in obj._ToTransformerEnd: + obj._ToTransformerEnd.append(self) + self._ToMeshImpedance.append(obj) + + def removeToMeshImpedance(self, *ToMeshImpedance): + for obj in ToMeshImpedance: + if self in obj._ToTransformerEnd: + obj._ToTransformerEnd.remove(self) + self._ToMeshImpedance.remove(obj) + + def getStarImpedance(self): + """(accurate for 2- or 3-winding transformers only) Pi-model impedances of this transformer end. By convention, for a two winding transformer, the full values of the transformer should be entered on the high voltage end (endNumber=1). + """ + return self._StarImpedance + + def setStarImpedance(self, value): + if self._StarImpedance is not None: + filtered = [x for x in self.StarImpedance.TransformerEnd if x != self] + self._StarImpedance._TransformerEnd = filtered + + self._StarImpedance = value + if self._StarImpedance is not None: + if self not in self._StarImpedance._TransformerEnd: + self._StarImpedance._TransformerEnd.append(self) + + StarImpedance = property(getStarImpedance, setStarImpedance) + diff --git a/CIM16/IEC61970/Wires/TransformerMeshImpedance.py b/CIM16/IEC61970/Wires/TransformerMeshImpedance.py new file mode 100755 index 00000000..c35f8948 --- /dev/null +++ b/CIM16/IEC61970/Wires/TransformerMeshImpedance.py @@ -0,0 +1,161 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerMeshImpedance(IdentifiedObject): + """Transformer mesh impedance (Delta-model) between transformer ends. The typical case is that TransformerMeshImpedance describe the impedance between two TransformerEnds pare wise, i.e. the cardinalities at both TranformerEnd associations are 1. But in cases where two or more TransformerEnds are operated connected together the cardinality at the ToTransfomerEnd role is larger than 1.Transformer mesh impedance (Delta-model) between transformer ends. The typical case is that TransformerMeshImpedance describe the impedance between two TransformerEnds pare wise, i.e. the cardinalities at both TranformerEnd associations are 1. But in cases where two or more TransformerEnds are operated connected together the cardinality at the ToTransfomerEnd role is larger than 1. + """ + + def __init__(self, r=0.0, x=0.0, x0=0.0, r0=0.0, FromTransformerEndInfo=None, ToTransformerEnd=None, ToTransformerEndInfo=None, FromTransformerEnd=None, *args, **kw_args): + """Initialises a new 'TransformerMeshImpedance' instance. + + @param r: Resistance between the 'from' and the 'to' end, seen from the 'from' end. + @param x: Reactance between the 'from' and the 'to' end, seen from the 'from' end. + @param x0: Zero-sequence reactance between the 'from' and the 'to' end, seen from the 'from' end. + @param r0: Zero-sequence resistance between the 'from' and the 'to' end, seen from the 'from' end. + @param FromTransformerEndInfo: From end info this mesh impedance is connected to. It determines the voltage reference. + @param ToTransformerEnd: All transformer ends this mesh impedance is connected to. + @param ToTransformerEndInfo: All transformer end infos this mesh impedance is connected to. + @param FromTransformerEnd: From end this mesh impedance is connected to. It determines the voltage reference. + """ + #: Resistance between the 'from' and the 'to' end, seen from the 'from' end. + self.r = r + + #: Reactance between the 'from' and the 'to' end, seen from the 'from' end. + self.x = x + + #: Zero-sequence reactance between the 'from' and the 'to' end, seen from the 'from' end. + self.x0 = x0 + + #: Zero-sequence resistance between the 'from' and the 'to' end, seen from the 'from' end. + self.r0 = r0 + + self._FromTransformerEndInfo = None + self.FromTransformerEndInfo = FromTransformerEndInfo + + self._ToTransformerEnd = [] + self.ToTransformerEnd = [] if ToTransformerEnd is None else ToTransformerEnd + + self._ToTransformerEndInfo = [] + self.ToTransformerEndInfo = [] if ToTransformerEndInfo is None else ToTransformerEndInfo + + self._FromTransformerEnd = None + self.FromTransformerEnd = FromTransformerEnd + + super(TransformerMeshImpedance, self).__init__(*args, **kw_args) + + _attrs = ["r", "x", "x0", "r0"] + _attr_types = {"r": float, "x": float, "x0": float, "r0": float} + _defaults = {"r": 0.0, "x": 0.0, "x0": 0.0, "r0": 0.0} + _enums = {} + _refs = ["FromTransformerEndInfo", "ToTransformerEnd", "ToTransformerEndInfo", "FromTransformerEnd"] + _many_refs = ["ToTransformerEnd", "ToTransformerEndInfo"] + + def getFromTransformerEndInfo(self): + """From end info this mesh impedance is connected to. It determines the voltage reference. + """ + return self._FromTransformerEndInfo + + def setFromTransformerEndInfo(self, value): + if self._FromTransformerEndInfo is not None: + filtered = [x for x in self.FromTransformerEndInfo.FromMeshImpedance if x != self] + self._FromTransformerEndInfo._FromMeshImpedance = filtered + + self._FromTransformerEndInfo = value + if self._FromTransformerEndInfo is not None: + if self not in self._FromTransformerEndInfo._FromMeshImpedance: + self._FromTransformerEndInfo._FromMeshImpedance.append(self) + + FromTransformerEndInfo = property(getFromTransformerEndInfo, setFromTransformerEndInfo) + + def getToTransformerEnd(self): + """All transformer ends this mesh impedance is connected to. + """ + return self._ToTransformerEnd + + def setToTransformerEnd(self, value): + for p in self._ToTransformerEnd: + filtered = [q for q in p.ToMeshImpedance if q != self] + self._ToTransformerEnd._ToMeshImpedance = filtered + for r in value: + if self not in r._ToMeshImpedance: + r._ToMeshImpedance.append(self) + self._ToTransformerEnd = value + + ToTransformerEnd = property(getToTransformerEnd, setToTransformerEnd) + + def addToTransformerEnd(self, *ToTransformerEnd): + for obj in ToTransformerEnd: + if self not in obj._ToMeshImpedance: + obj._ToMeshImpedance.append(self) + self._ToTransformerEnd.append(obj) + + def removeToTransformerEnd(self, *ToTransformerEnd): + for obj in ToTransformerEnd: + if self in obj._ToMeshImpedance: + obj._ToMeshImpedance.remove(self) + self._ToTransformerEnd.remove(obj) + + def getToTransformerEndInfo(self): + """All transformer end infos this mesh impedance is connected to. + """ + return self._ToTransformerEndInfo + + def setToTransformerEndInfo(self, value): + for p in self._ToTransformerEndInfo: + filtered = [q for q in p.ToMeshImpedance if q != self] + self._ToTransformerEndInfo._ToMeshImpedance = filtered + for r in value: + if self not in r._ToMeshImpedance: + r._ToMeshImpedance.append(self) + self._ToTransformerEndInfo = value + + ToTransformerEndInfo = property(getToTransformerEndInfo, setToTransformerEndInfo) + + def addToTransformerEndInfo(self, *ToTransformerEndInfo): + for obj in ToTransformerEndInfo: + if self not in obj._ToMeshImpedance: + obj._ToMeshImpedance.append(self) + self._ToTransformerEndInfo.append(obj) + + def removeToTransformerEndInfo(self, *ToTransformerEndInfo): + for obj in ToTransformerEndInfo: + if self in obj._ToMeshImpedance: + obj._ToMeshImpedance.remove(self) + self._ToTransformerEndInfo.remove(obj) + + def getFromTransformerEnd(self): + """From end this mesh impedance is connected to. It determines the voltage reference. + """ + return self._FromTransformerEnd + + def setFromTransformerEnd(self, value): + if self._FromTransformerEnd is not None: + filtered = [x for x in self.FromTransformerEnd.FromMeshImpedance if x != self] + self._FromTransformerEnd._FromMeshImpedance = filtered + + self._FromTransformerEnd = value + if self._FromTransformerEnd is not None: + if self not in self._FromTransformerEnd._FromMeshImpedance: + self._FromTransformerEnd._FromMeshImpedance.append(self) + + FromTransformerEnd = property(getFromTransformerEnd, setFromTransformerEnd) + diff --git a/CIM16/IEC61970/Wires/TransformerStarImpedance.py b/CIM16/IEC61970/Wires/TransformerStarImpedance.py new file mode 100755 index 00000000..b4503461 --- /dev/null +++ b/CIM16/IEC61970/Wires/TransformerStarImpedance.py @@ -0,0 +1,81 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerStarImpedance(IdentifiedObject): + """Transformer star impedance (Pi-model) that accurately reflects impedance for transformers with 2 or 3 windings. For transformers with 4 or more windings, you must use TransformerTank model and related classes. For transmission networks use PowerTransformerEnd impedances (r, r0, x, x0, b, b0, g and g0).Transformer star impedance (Pi-model) that accurately reflects impedance for transformers with 2 or 3 windings. For transformers with 4 or more windings, you must use TransformerTank model and related classes. For transmission networks use PowerTransformerEnd impedances (r, r0, x, x0, b, b0, g and g0). + """ + + def __init__(self, x0=0.0, x=0.0, r=0.0, r0=0.0, TransformerEnd=None, *args, **kw_args): + """Initialises a new 'TransformerStarImpedance' instance. + + @param x0: Zero sequence series reactance of the transformer end. + @param x: Positive sequence series reactance of the transformer end. + @param r: Resistance of the transformer end. + @param r0: Zero sequence series resistance of the transformer end. + @param TransformerEnd: All transformer ends having this star impedance. + """ + #: Zero sequence series reactance of the transformer end. + self.x0 = x0 + + #: Positive sequence series reactance of the transformer end. + self.x = x + + #: Resistance of the transformer end. + self.r = r + + #: Zero sequence series resistance of the transformer end. + self.r0 = r0 + + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + super(TransformerStarImpedance, self).__init__(*args, **kw_args) + + _attrs = ["x0", "x", "r", "r0"] + _attr_types = {"x0": float, "x": float, "r": float, "r0": float} + _defaults = {"x0": 0.0, "x": 0.0, "r": 0.0, "r0": 0.0} + _enums = {} + _refs = ["TransformerEnd"] + _many_refs = ["TransformerEnd"] + + def getTransformerEnd(self): + """All transformer ends having this star impedance. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.StarImpedance = None + for y in value: + y._StarImpedance = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.StarImpedance = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.StarImpedance = None + diff --git a/CIM16/IEC61970/Wires/TransformerTank.py b/CIM16/IEC61970/Wires/TransformerTank.py new file mode 100755 index 00000000..43937565 --- /dev/null +++ b/CIM16/IEC61970/Wires/TransformerTank.py @@ -0,0 +1,158 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Equipment import Equipment + +class TransformerTank(Equipment): + """An assembly of two or more coupled windings that transform electrical power between voltage levels. These windings are bound on a common core and place in the same tank. Transformer tank can be used to model both single-phase and 3-phase transformers.An assembly of two or more coupled windings that transform electrical power between voltage levels. These windings are bound on a common core and place in the same tank. Transformer tank can be used to model both single-phase and 3-phase transformers. + """ + + def __init__(self, ServiceDeliveryPoints=None, TransformerTankEnds=None, PowerTransformer=None, TransformerTankInfo=None, TransformerObservations=None, *args, **kw_args): + """Initialises a new 'TransformerTank' instance. + + @param ServiceDeliveryPoints: All service delivery points supplied by this transformer. + @param TransformerTankEnds: All windings of this transformer. + @param PowerTransformer: Bank this transformer belongs to. + @param TransformerTankInfo: Transformer tank data. + @param TransformerObservations: + """ + self._ServiceDeliveryPoints = [] + self.ServiceDeliveryPoints = [] if ServiceDeliveryPoints is None else ServiceDeliveryPoints + + self._TransformerTankEnds = [] + self.TransformerTankEnds = [] if TransformerTankEnds is None else TransformerTankEnds + + self._PowerTransformer = None + self.PowerTransformer = PowerTransformer + + self._TransformerTankInfo = None + self.TransformerTankInfo = TransformerTankInfo + + self._TransformerObservations = [] + self.TransformerObservations = [] if TransformerObservations is None else TransformerObservations + + super(TransformerTank, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ServiceDeliveryPoints", "TransformerTankEnds", "PowerTransformer", "TransformerTankInfo", "TransformerObservations"] + _many_refs = ["ServiceDeliveryPoints", "TransformerTankEnds", "TransformerObservations"] + + def getServiceDeliveryPoints(self): + """All service delivery points supplied by this transformer. + """ + return self._ServiceDeliveryPoints + + def setServiceDeliveryPoints(self, value): + for x in self._ServiceDeliveryPoints: + x.TransformerTanks = None + for y in value: + y._TransformerTanks = self + self._ServiceDeliveryPoints = value + + ServiceDeliveryPoints = property(getServiceDeliveryPoints, setServiceDeliveryPoints) + + def addServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + obj.TransformerTanks = self + + def removeServiceDeliveryPoints(self, *ServiceDeliveryPoints): + for obj in ServiceDeliveryPoints: + obj.TransformerTanks = None + + def getTransformerTankEnds(self): + """All windings of this transformer. + """ + return self._TransformerTankEnds + + def setTransformerTankEnds(self, value): + for x in self._TransformerTankEnds: + x.TransformerTank = None + for y in value: + y._TransformerTank = self + self._TransformerTankEnds = value + + TransformerTankEnds = property(getTransformerTankEnds, setTransformerTankEnds) + + def addTransformerTankEnds(self, *TransformerTankEnds): + for obj in TransformerTankEnds: + obj.TransformerTank = self + + def removeTransformerTankEnds(self, *TransformerTankEnds): + for obj in TransformerTankEnds: + obj.TransformerTank = None + + def getPowerTransformer(self): + """Bank this transformer belongs to. + """ + return self._PowerTransformer + + def setPowerTransformer(self, value): + if self._PowerTransformer is not None: + filtered = [x for x in self.PowerTransformer.TransformerTanks if x != self] + self._PowerTransformer._TransformerTanks = filtered + + self._PowerTransformer = value + if self._PowerTransformer is not None: + if self not in self._PowerTransformer._TransformerTanks: + self._PowerTransformer._TransformerTanks.append(self) + + PowerTransformer = property(getPowerTransformer, setPowerTransformer) + + def getTransformerTankInfo(self): + """Transformer tank data. + """ + return self._TransformerTankInfo + + def setTransformerTankInfo(self, value): + if self._TransformerTankInfo is not None: + filtered = [x for x in self.TransformerTankInfo.TransformerTanks if x != self] + self._TransformerTankInfo._TransformerTanks = filtered + + self._TransformerTankInfo = value + if self._TransformerTankInfo is not None: + if self not in self._TransformerTankInfo._TransformerTanks: + self._TransformerTankInfo._TransformerTanks.append(self) + + TransformerTankInfo = property(getTransformerTankInfo, setTransformerTankInfo) + + def getTransformerObservations(self): + + return self._TransformerObservations + + def setTransformerObservations(self, value): + for x in self._TransformerObservations: + x.Transformer = None + for y in value: + y._Transformer = self + self._TransformerObservations = value + + TransformerObservations = property(getTransformerObservations, setTransformerObservations) + + def addTransformerObservations(self, *TransformerObservations): + for obj in TransformerObservations: + obj.Transformer = self + + def removeTransformerObservations(self, *TransformerObservations): + for obj in TransformerObservations: + obj.Transformer = None + diff --git a/CIM16/IEC61970/Wires/TransformerTankEnd.py b/CIM16/IEC61970/Wires/TransformerTankEnd.py new file mode 100755 index 00000000..12fbc753 --- /dev/null +++ b/CIM16/IEC61970/Wires/TransformerTankEnd.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Wires.TransformerEnd import TransformerEnd + +class TransformerTankEnd(TransformerEnd): + """Transformer tank end represents an individual winding for unbalanced models or for transformer tanks connected into a bank (and bank is modelled with the PowerTransformer).Transformer tank end represents an individual winding for unbalanced models or for transformer tanks connected into a bank (and bank is modelled with the PowerTransformer). + """ + + def __init__(self, phases="s12N", TransformerTank=None, *args, **kw_args): + """Initialises a new 'TransformerTankEnd' instance. + + @param phases: Describes the phases carried by a conducting equipment. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param TransformerTank: Transformer this winding belongs to. + """ + #: Describes the phases carried by a conducting equipment. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.phases = phases + + self._TransformerTank = None + self.TransformerTank = TransformerTank + + super(TransformerTankEnd, self).__init__(*args, **kw_args) + + _attrs = ["phases"] + _attr_types = {"phases": str} + _defaults = {"phases": "s12N"} + _enums = {"phases": "PhaseCode"} + _refs = ["TransformerTank"] + _many_refs = [] + + def getTransformerTank(self): + """Transformer this winding belongs to. + """ + return self._TransformerTank + + def setTransformerTank(self, value): + if self._TransformerTank is not None: + filtered = [x for x in self.TransformerTank.TransformerTankEnds if x != self] + self._TransformerTank._TransformerTankEnds = filtered + + self._TransformerTank = value + if self._TransformerTank is not None: + if self not in self._TransformerTank._TransformerTankEnds: + self._TransformerTank._TransformerTankEnds.append(self) + + TransformerTank = property(getTransformerTank, setTransformerTank) + diff --git a/CIM16/IEC61970/Wires/VoltageControlZone.py b/CIM16/IEC61970/Wires/VoltageControlZone.py new file mode 100755 index 00000000..c271d245 --- /dev/null +++ b/CIM16/IEC61970/Wires/VoltageControlZone.py @@ -0,0 +1,80 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class VoltageControlZone(PowerSystemResource): + """An area of the power system network which is defined for secondary voltage control purposes. A voltage control zone consists of a collection of substations with a designated bus bar section whose voltage will be controlled.An area of the power system network which is defined for secondary voltage control purposes. A voltage control zone consists of a collection of substations with a designated bus bar section whose voltage will be controlled. + """ + + def __init__(self, RegulationSchedule=None, BusbarSection=None, *args, **kw_args): + """Initialises a new 'VoltageControlZone' instance. + + @param RegulationSchedule: A VoltageControlZone may have a voltage regulation schedule. + @param BusbarSection: A VoltageControlZone is controlled by a designated BusbarSection. + """ + self._RegulationSchedule = None + self.RegulationSchedule = RegulationSchedule + + self._BusbarSection = None + self.BusbarSection = BusbarSection + + super(VoltageControlZone, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["RegulationSchedule", "BusbarSection"] + _many_refs = [] + + def getRegulationSchedule(self): + """A VoltageControlZone may have a voltage regulation schedule. + """ + return self._RegulationSchedule + + def setRegulationSchedule(self, value): + if self._RegulationSchedule is not None: + filtered = [x for x in self.RegulationSchedule.VoltageControlZones if x != self] + self._RegulationSchedule._VoltageControlZones = filtered + + self._RegulationSchedule = value + if self._RegulationSchedule is not None: + if self not in self._RegulationSchedule._VoltageControlZones: + self._RegulationSchedule._VoltageControlZones.append(self) + + RegulationSchedule = property(getRegulationSchedule, setRegulationSchedule) + + def getBusbarSection(self): + """A VoltageControlZone is controlled by a designated BusbarSection. + """ + return self._BusbarSection + + def setBusbarSection(self, value): + if self._BusbarSection is not None: + self._BusbarSection._VoltageControlZone = None + + self._BusbarSection = value + if self._BusbarSection is not None: + self._BusbarSection.VoltageControlZone = None + self._BusbarSection._VoltageControlZone = self + + BusbarSection = property(getBusbarSection, setBusbarSection) + diff --git a/CIM16/IEC61970/Wires/__init__.py b/CIM16/IEC61970/Wires/__init__.py new file mode 100755 index 00000000..8080a1fe --- /dev/null +++ b/CIM16/IEC61970/Wires/__init__.py @@ -0,0 +1,147 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""An extension to the Core and Topology package that models information on the electrical characteristics of Transmission and Distribution networks. This package is used by network applications such as State Estimation, Load Flow and Optimal Power Flow. +""" + +from CIM16.IEC61970.Wires.PhaseImpedanceData import PhaseImpedanceData +from CIM16.IEC61970.Wires.TapSchedule import TapSchedule +from CIM16.IEC61970.Wires.TransformerStarImpedance import TransformerStarImpedance +from CIM16.IEC61970.Wires.Recloser import Recloser +from CIM16.IEC61970.Wires.RatioTapChangerTabularPoint import RatioTapChangerTabularPoint +from CIM16.IEC61970.Wires.PhaseTapChangerTabular import PhaseTapChangerTabular +from CIM16.IEC61970.Wires.RatioTapChanger import RatioTapChanger +from CIM16.IEC61970.Wires.PhaseTapChangerLinear import PhaseTapChangerLinear +from CIM16.IEC61970.Wires.ACLineSegment import ACLineSegment +from CIM16.IEC61970.Wires.PowerTransformerEnd import PowerTransformerEnd +from CIM16.IEC61970.Wires.Junction import Junction +from CIM16.IEC61970.Wires.RegulatingCondEq import RegulatingCondEq +from CIM16.IEC61970.Wires.Sectionaliser import Sectionaliser +from CIM16.IEC61970.Wires.RatioTapChangerTabular import RatioTapChangerTabular +from CIM16.IEC61970.Wires.PowerTransformer import PowerTransformer +from CIM16.IEC61970.Wires.Fuse import Fuse +from CIM16.IEC61970.Wires.EnergyConsumer import EnergyConsumer +from CIM16.IEC61970.Wires.Disconnector import Disconnector +from CIM16.IEC61970.Wires.Connector import Connector +from CIM16.IEC61970.Wires.ReactiveCapabilityCurve import ReactiveCapabilityCurve +from CIM16.IEC61970.Wires.Plant import Plant +from CIM16.IEC61970.Wires.GroundDisconnector import GroundDisconnector +from CIM16.IEC61970.Wires.Resistor import Resistor +from CIM16.IEC61970.Wires.SynchronousMachine import SynchronousMachine +from CIM16.IEC61970.Wires.PhaseTapChangerAsymetrical import PhaseTapChangerAsymetrical +from CIM16.IEC61970.Wires.RectifierInverter import RectifierInverter +from CIM16.IEC61970.Wires.SeriesCompensator import SeriesCompensator +from CIM16.IEC61970.Wires.TapChangerControl import TapChangerControl +from CIM16.IEC61970.Wires.RegulatingControl import RegulatingControl +from CIM16.IEC61970.Wires.ProtectedSwitch import ProtectedSwitch +from CIM16.IEC61970.Wires.PhaseTapChanger import PhaseTapChanger +from CIM16.IEC61970.Wires.Ground import Ground +from CIM16.IEC61970.Wires.CompositeSwitch import CompositeSwitch +from CIM16.IEC61970.Wires.RegulationSchedule import RegulationSchedule +from CIM16.IEC61970.Wires.TransformerTankEnd import TransformerTankEnd +from CIM16.IEC61970.Wires.Breaker import Breaker +from CIM16.IEC61970.Wires.MutualCoupling import MutualCoupling +from CIM16.IEC61970.Wires.Line import Line +from CIM16.IEC61970.Wires.PerLengthPhaseImpedance import PerLengthPhaseImpedance +from CIM16.IEC61970.Wires.FrequencyConverter import FrequencyConverter +from CIM16.IEC61970.Wires.ShuntCompensator import ShuntCompensator +from CIM16.IEC61970.Wires.VoltageControlZone import VoltageControlZone +from CIM16.IEC61970.Wires.LoadBreakSwitch import LoadBreakSwitch +from CIM16.IEC61970.Wires.BusbarSection import BusbarSection +from CIM16.IEC61970.Wires.TransformerEnd import TransformerEnd +from CIM16.IEC61970.Wires.TransformerCoreAdmittance import TransformerCoreAdmittance +from CIM16.IEC61970.Wires.StaticVarCompensator import StaticVarCompensator +from CIM16.IEC61970.Wires.Switch import Switch +from CIM16.IEC61970.Wires.PerLengthSequenceImpedance import PerLengthSequenceImpedance +from CIM16.IEC61970.Wires.TransformerMeshImpedance import TransformerMeshImpedance +from CIM16.IEC61970.Wires.SwitchSchedule import SwitchSchedule +from CIM16.IEC61970.Wires.EnergySource import EnergySource +from CIM16.IEC61970.Wires.TransformerTank import TransformerTank +from CIM16.IEC61970.Wires.PhaseTapChangerTabularPoint import PhaseTapChangerTabularPoint +from CIM16.IEC61970.Wires.DCLineSegment import DCLineSegment +from CIM16.IEC61970.Wires.TapChanger import TapChanger +from CIM16.IEC61970.Wires.Conductor import Conductor +from CIM16.IEC61970.Wires.PhaseTapChangerNonLinear import PhaseTapChangerNonLinear +from CIM16.IEC61970.Wires.PhaseTapChangerSymetrical import PhaseTapChangerSymetrical +from CIM16.IEC61970.Wires.Jumper import Jumper + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Wires" +nsPrefix = "cimWires" + + +class TapChangerKind(str): + """Values are: voltageAndPhaseControl, phaseControl, fixed, voltageControl + """ + pass + +class WindingType(str): + """Values are: tertiary, primary, secondary, quaternary + """ + pass + +class SynchronousMachineOperatingMode(str): + """Values are: condenser, generator + """ + pass + +class TransformerControlMode(str): + """Values are: reactive, volt + """ + pass + +class CoolantType(str): + """Values are: air, hydrogenGas, water + """ + pass + +class SynchronousMachineType(str): + """Values are: condenser, generator_or_condenser, generator + """ + pass + +class PhaseTapChangerKind(str): + """Values are: unknown, asymmetrical, symmetrical + """ + pass + +class SVCControlMode(str): + """Values are: off, voltage, reactivePower + """ + pass + +class RegulatingControlModeKind(str): + """Values are: fixed, timeScheduled, voltage, admittance, reactivePower, powerFactor, currentFlow, activePower, temperature + """ + pass + +class WindingConnection(str): + """Values are: Z, A, Yn, Y, Zn, D, I + """ + pass + +class CompositeSwitchType(str): + """An alphanumeric code that can be used as a reference to extar information such as the description of the interlocking scheme if any + """ + pass + +class OperatingMode(str): + """Textual name for an operating mode + """ + pass diff --git a/CIM16/IEC61970/WiresPhaseModel/ACLineSegmentPhase.py b/CIM16/IEC61970/WiresPhaseModel/ACLineSegmentPhase.py new file mode 100755 index 00000000..691f662c --- /dev/null +++ b/CIM16/IEC61970/WiresPhaseModel/ACLineSegmentPhase.py @@ -0,0 +1,59 @@ +# Copyright (C) 2017 Emily Ma +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + + +class ACLineSegmentPhase(PowerSystemResource): + + def __init__(self, phase=None, ACLineSegment=None, *args, **kw_args): + """Initialises a new 'ACLineSegmentPhase' instance. + + @param phase: 'A', 'B', 'C', 'N' + @param ACLineSegment: + """ + + self.phase = phase + self._ACLineSegment = None + self.ACLineSegment = ACLineSegment + + super(ACLineSegmentPhase, self).__init__(*args, **kw_args) + + _attrs = ["phase"] + _attr_types = {"phase": str} + _defaults = {"phase": "C"} + _enums = {"phase": "SinglePhaseKind"} + _refs = ["ACLineSegment"] + _many_refs = [] + + def getACLineSegment(self): + return self._ACLineSegment + + def setACLineSegment(self, value): + if self._ACLineSegment is not None: + filtered = [x for x in self.ACLineSegment.ACLineSegmentPhases if x != self] + self._ACLineSegment._ACLineSegmentPhases = filtered + + self._ACLineSegment = value + if self._ACLineSegment is not None: + if self not in self._ACLineSegment._ACLineSegmentPhases: + self._ACLineSegment._ACLineSegmentPhases.append(self) + + ACLineSegment = property(getACLineSegment, setACLineSegment) diff --git a/CIM16/IEC61970/WiresPhaseModel/EnergyConsumerPhase.py b/CIM16/IEC61970/WiresPhaseModel/EnergyConsumerPhase.py new file mode 100755 index 00000000..fdd00647 --- /dev/null +++ b/CIM16/IEC61970/WiresPhaseModel/EnergyConsumerPhase.py @@ -0,0 +1,61 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class EnergyConsumerPhase(PowerSystemResource): + + def __init__(self, phase=None, EnergyConsumer=None, pfixed=0.0, qfixed=0.0, *args, **kw_args): + """Initialises a new 'EnergyConsumerPhase' instance. + + @param phase: + @param EnergyConsumer: + """ + self.phase = phase + self._EnergyConsumer = None + self.EnergyConsumer = EnergyConsumer + + self.pfixed = pfixed + self.qfixed = qfixed + + super(EnergyConsumerPhase, self).__init__(*args, **kw_args) + + _attrs = ["pfixed", "qfixed"] + _attr_types = {"pfixed": float, "qfixed": float} + _defaults = {"pfixed": 0.0, "qfixed": 0.0} + _enums = {} + _refs = ["EnergyConsumer"] + _many_refs = [] + + def getEnergyConsumer(self): + + return self._EnergyConsumer + + def setEnergyConsumer(self, value): + if self._EnergyConsumer is not None: + filtered = [x for x in self.EnergyConsumer.EnergyConsumerPhases if x != self] + self._EnergyConsumer._EnergyConsumerPhases = filtered + + self._EnergyConsumer = value + if self._EnergyConsumer is not None: + if self not in self._EnergyConsumer._EnergyConsumerPhases: + self._EnergyConsumer._EnergyConsumerPhases.append(self) + + EnergyConsumer = property(getEnergyConsumer, setEnergyConsumer) diff --git a/CIM16/IEC61970/WiresPhaseModel/ShuntCompensatorPhase.py b/CIM16/IEC61970/WiresPhaseModel/ShuntCompensatorPhase.py new file mode 100755 index 00000000..d1211090 --- /dev/null +++ b/CIM16/IEC61970/WiresPhaseModel/ShuntCompensatorPhase.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class ShuntCompensatorPhase(PowerSystemResource): + """Single phase of a multi-phase shunt compensator when its attributes might be different per phase.Single phase of a multi-phase shunt compensator when its attributes might be different per phase. + """ + + def __init__(self, ShuntCompensator=None, *args, **kw_args): + """Initialises a new 'ShuntCompensatorPhase' instance. + + @param ShuntCompensator: + """ + self._ShuntCompensator = None + self.ShuntCompensator = ShuntCompensator + + super(ShuntCompensatorPhase, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ShuntCompensator"] + _many_refs = [] + + def getShuntCompensator(self): + + return self._ShuntCompensator + + def setShuntCompensator(self, value): + if self._ShuntCompensator is not None: + filtered = [x for x in self.ShuntCompensator.ShuntCompensatorPhases if x != self] + self._ShuntCompensator._ShuntCompensatorPhases = filtered + + self._ShuntCompensator = value + if self._ShuntCompensator is not None: + if self not in self._ShuntCompensator._ShuntCompensatorPhases: + self._ShuntCompensator._ShuntCompensatorPhases.append(self) + + ShuntCompensator = property(getShuntCompensator, setShuntCompensator) + diff --git a/CIM16/IEC61970/WiresPhaseModel/SwitchPhase.py b/CIM16/IEC61970/WiresPhaseModel/SwitchPhase.py new file mode 100755 index 00000000..240980de --- /dev/null +++ b/CIM16/IEC61970/WiresPhaseModel/SwitchPhase.py @@ -0,0 +1,71 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class SwitchPhase(PowerSystemResource): + """Single phase of a multi-phase switch when its attributes might be different per phase.Single phase of a multi-phase switch when its attributes might be different per phase. + """ + + def __init__(self, phaseSide1="C", phaseSide2="C", normalOpen=False, Switch=None, *args, **kw_args): + """Initialises a new 'SwitchPhase' instance. + + @param phaseSide1: Phase of this SwitchPhase on the “from” (Switch.Terminal.sequenceNumber=1) side. Should be a phase contained in that terminal’s Terminal.phases attribute. Values are: "C", "N", "s1", "B", "s2", "A" + @param phaseSide2: Phase of this SwitchPhase on the “to” (Switch.Terminal.sequenceNumber=2) side. Should be a phase contained in that terminal’s Terminal.phases attribute. Values are: "C", "N", "s1", "B", "s2", "A" + @param normalOpen: Used in cases when no Measurement for the status value is present. If the SwitchPhase has a status measurement the Discrete.normalValue is expected to match with this value. + @param Switch: + """ + #: Phase of this SwitchPhase on the “from” (Switch.Terminal.sequenceNumber=1) side. Should be a phase contained in that terminal’s Terminal.phases attribute. Values are: "C", "N", "s1", "B", "s2", "A" + self.phaseSide1 = phaseSide1 + + #: Phase of this SwitchPhase on the “to” (Switch.Terminal.sequenceNumber=2) side. Should be a phase contained in that terminal’s Terminal.phases attribute. Values are: "C", "N", "s1", "B", "s2", "A" + self.phaseSide2 = phaseSide2 + + #: Used in cases when no Measurement for the status value is present. If the SwitchPhase has a status measurement the Discrete.normalValue is expected to match with this value. + self.normalOpen = normalOpen + + self._Switch = None + self.Switch = Switch + + super(SwitchPhase, self).__init__(*args, **kw_args) + + _attrs = ["phaseSide1", "phaseSide2", "normalOpen"] + _attr_types = {"phaseSide1": str, "phaseSide2": str, "normalOpen": bool} + _defaults = {"phaseSide1": "C", "phaseSide2": "C", "normalOpen": False} + _enums = {"phaseSide1": "SinglePhaseKind", "phaseSide2": "SinglePhaseKind"} + _refs = ["Switch"] + _many_refs = [] + + def getSwitch(self): + + return self._Switch + + def setSwitch(self, value): + if self._Switch is not None: + filtered = [x for x in self.Switch.SwitchPhases if x != self] + self._Switch._SwitchPhases = filtered + + self._Switch = value + if self._Switch is not None: + if self not in self._Switch._SwitchPhases: + self._Switch._SwitchPhases.append(self) + + Switch = property(getSwitch, setSwitch) + diff --git a/CIM16/IEC61970/WiresPhaseModel/__init__.py b/CIM16/IEC61970/WiresPhaseModel/__init__.py new file mode 100755 index 00000000..779a72c7 --- /dev/null +++ b/CIM16/IEC61970/WiresPhaseModel/__init__.py @@ -0,0 +1,34 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +from CIM16.IEC61970.WiresPhaseModel.SwitchPhase import SwitchPhase +from CIM16.IEC61970.WiresPhaseModel.ShuntCompensatorPhase import ShuntCompensatorPhase +from CIM16.IEC61970.WiresPhaseModel.EnergyConsumerPhase import EnergyConsumerPhase +from CIM16.IEC61970.WiresPhaseModel.ACLineSegmentPhase import ACLineSegmentPhase + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#WiresPhaseModel" +nsPrefix = "cimWiresPhaseModel" + + +class SinglePhaseKind(str): + """Values are: C, N, s1, B, s2, A + """ + pass diff --git a/CIM16/IEC61970/__init__.py b/CIM16/IEC61970/__init__.py new file mode 100755 index 00000000..2080a8b9 --- /dev/null +++ b/CIM16/IEC61970/__init__.py @@ -0,0 +1,28 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified date: 05/06/2017 + +from CIM16.IEC61970.IEC61970CIMVersion import IEC61970CIMVersion + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#IEC61970" +nsPrefix = "cimIEC61970" + diff --git a/CIM16/IEC62325/IEC62325CIMVersion.py b/CIM16/IEC62325/IEC62325CIMVersion.py new file mode 100755 index 00000000..99bb3127 --- /dev/null +++ b/CIM16/IEC62325/IEC62325CIMVersion.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class IEC62325CIMVersion(Element): + """IEC 62325 version number assigned to this UML model.IEC 62325 version number assigned to this UML model. + """ + + def __init__(self, date='', version='', *args, **kw_args): + """Initialises a new 'IEC62325CIMVersion' instance. + + @param date: Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. + @param version: Form is IEC62325CIMXXvYY where XX is the major CIM package version and the YY is the minor version. For example IEC62325CIM10v03. + """ + #: Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. + self.date = date + + #: Form is IEC62325CIMXXvYY where XX is the major CIM package version and the YY is the minor version. For example IEC62325CIM10v03. + self.version = version + + super(IEC62325CIMVersion, self).__init__(*args, **kw_args) + + _attrs = ["date", "version"] + _attr_types = {"date": str, "version": str} + _defaults = {"date": '', "version": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC62325/MarketParticipant.py b/CIM16/IEC62325/MarketParticipant.py new file mode 100755 index 00000000..67f8a3ae --- /dev/null +++ b/CIM16/IEC62325/MarketParticipant.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61968.Common.Organisation import Organisation + +class MarketParticipant(Organisation): + + def __init__(self, MarketRoles=None, *args, **kw_args): + """Initialises a new 'MarketParticipant' instance. + + @param MarketRoles: All roles of this market participant. + """ + self._MarketRoles = [] + self.MarketRoles = [] if MarketRoles is None else MarketRoles + + super(MarketParticipant, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["MarketRoles"] + _many_refs = ["MarketRoles"] + + def getMarketRoles(self): + """All roles of this market participant. + """ + return self._MarketRoles + + def setMarketRoles(self, value): + for p in self._MarketRoles: + filtered = [q for q in p.MarketParticipants if q != self] + self._MarketRoles._MarketParticipants = filtered + for r in value: + if self not in r._MarketParticipants: + r._MarketParticipants.append(self) + self._MarketRoles = value + + MarketRoles = property(getMarketRoles, setMarketRoles) + + def addMarketRoles(self, *MarketRoles): + for obj in MarketRoles: + if self not in obj._MarketParticipants: + obj._MarketParticipants.append(self) + self._MarketRoles.append(obj) + + def removeMarketRoles(self, *MarketRoles): + for obj in MarketRoles: + if self in obj._MarketParticipants: + obj._MarketParticipants.remove(self) + self._MarketRoles.remove(obj) + diff --git a/CIM16/IEC62325/MarketRole.py b/CIM16/IEC62325/MarketRole.py new file mode 100755 index 00000000..20791730 --- /dev/null +++ b/CIM16/IEC62325/MarketRole.py @@ -0,0 +1,80 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class MarketRole(IdentifiedObject): + """Role of a market player.Role of a market player. + """ + + def __init__(self, kind="transmissionOperator", status=None, MarketParticipants=None, *args, **kw_args): + """Initialises a new 'MarketRole' instance. + + @param kind: Kind of role an organisation plays in a market. Values are: "transmissionOperator", "complianceMonitor", "standardsDeveloper", "interchangeAuthority", "energyServiceConsumer", "planningAuthority", "other", "purchasingSellingEntity", "competitiveRetailer", "transmissionOwner", "transmissionServiceProvider", "generatorOperator", "balancingAuthority", "loadServingEntity", "transmissionPlanner", "distributionProvider", "reliabilityAuthority", "resourcePlanner", "generatorOwner" + @param status: + @param MarketParticipants: All market participants with this role. + """ + #: Kind of role an organisation plays in a market. Values are: "transmissionOperator", "complianceMonitor", "standardsDeveloper", "interchangeAuthority", "energyServiceConsumer", "planningAuthority", "other", "purchasingSellingEntity", "competitiveRetailer", "transmissionOwner", "transmissionServiceProvider", "generatorOperator", "balancingAuthority", "loadServingEntity", "transmissionPlanner", "distributionProvider", "reliabilityAuthority", "resourcePlanner", "generatorOwner" + self.kind = kind + + self.status = status + + self._MarketParticipants = [] + self.MarketParticipants = [] if MarketParticipants is None else MarketParticipants + + super(MarketRole, self).__init__(*args, **kw_args) + + _attrs = ["kind"] + _attr_types = {"kind": str} + _defaults = {"kind": "transmissionOperator"} + _enums = {"kind": "MarketRoleKind"} + _refs = ["status", "MarketParticipants"] + _many_refs = ["MarketParticipants"] + + status = None + + def getMarketParticipants(self): + """All market participants with this role. + """ + return self._MarketParticipants + + def setMarketParticipants(self, value): + for p in self._MarketParticipants: + filtered = [q for q in p.MarketRoles if q != self] + self._MarketParticipants._MarketRoles = filtered + for r in value: + if self not in r._MarketRoles: + r._MarketRoles.append(self) + self._MarketParticipants = value + + MarketParticipants = property(getMarketParticipants, setMarketParticipants) + + def addMarketParticipants(self, *MarketParticipants): + for obj in MarketParticipants: + if self not in obj._MarketRoles: + obj._MarketRoles.append(self) + self._MarketParticipants.append(obj) + + def removeMarketParticipants(self, *MarketParticipants): + for obj in MarketParticipants: + if self in obj._MarketRoles: + obj._MarketRoles.remove(self) + self._MarketParticipants.remove(obj) + diff --git a/CIM16/IEC62325/__init__.py b/CIM16/IEC62325/__init__.py new file mode 100755 index 00000000..3455c54d --- /dev/null +++ b/CIM16/IEC62325/__init__.py @@ -0,0 +1,33 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +from CIM16.IEC62325.MarketParticipant import MarketParticipant +from CIM16.IEC62325.IEC62325CIMVersion import IEC62325CIMVersion +from CIM16.IEC62325.MarketRole import MarketRole + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#IEC62325" +nsPrefix = "cimIEC62325" + + +class MarketRoleKind(str): + """Values are: transmissionOperator, complianceMonitor, standardsDeveloper, interchangeAuthority, energyServiceConsumer, planningAuthority, other, purchasingSellingEntity, competitiveRetailer, transmissionOwner, transmissionServiceProvider, generatorOperator, balancingAuthority, loadServingEntity, transmissionPlanner, distributionProvider, reliabilityAuthority, resourcePlanner, generatorOwner + """ + pass diff --git a/CIM16/Package.py b/CIM16/Package.py new file mode 100755 index 00000000..3de4e822 --- /dev/null +++ b/CIM16/Package.py @@ -0,0 +1,37 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class Package(Element): + + def __init__(self, *args, **kw_args): + """Initialises a new 'Package' instance. + + """ + super(Package, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/PackageDependencies/PackageDependenciesCIMVeresion.py b/CIM16/PackageDependencies/PackageDependenciesCIMVeresion.py new file mode 100755 index 00000000..35945b95 --- /dev/null +++ b/CIM16/PackageDependencies/PackageDependenciesCIMVeresion.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class PackageDependenciesCIMVeresion(Element): + """The version of dependencies description among top level subpackages of the combined CIM model. This is not the same as the combined packages version.The version of dependencies description among top level subpackages of the combined CIM model. This is not the same as the combined packages version. + """ + + def __init__(self, vesion='', date='', *args, **kw_args): + """Initialises a new 'PackageDependenciesCIMVeresion' instance. + + @param vesion: The version of the main subpackages of the combined CIM model. The format is simply an integer. The version (and date) initial values should be updated any time the dependencies in the model change and require an actual change to the diagrams within this package. + @param date: Date of last change to the main package dependencies in format YYYY-MM-DD. This is updated when the version attribute is updated. + """ + #: The version of the main subpackages of the combined CIM model. The format is simply an integer. The version (and date) initial values should be updated any time the dependencies in the model change and require an actual change to the diagrams within this package. + self.vesion = vesion + + #: Date of last change to the main package dependencies in format YYYY-MM-DD. This is updated when the version attribute is updated. + self.date = date + + super(PackageDependenciesCIMVeresion, self).__init__(*args, **kw_args) + + _attrs = ["vesion", "date"] + _attr_types = {"vesion": str, "date": str} + _defaults = {"vesion": '', "date": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/PackageDependencies/__init__.py b/CIM16/PackageDependencies/__init__.py new file mode 100755 index 00000000..8745f8ab --- /dev/null +++ b/CIM16/PackageDependencies/__init__.py @@ -0,0 +1,28 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package shows all the root level subpackage dependencies of the combined CIM model. +""" + +from CIM16.PackageDependencies.PackageDependenciesCIMVeresion import PackageDependenciesCIMVeresion + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#PackageDependencies" +nsPrefix = "cimPackageDependencies" + diff --git a/CIM16/Stereotype.py b/CIM16/Stereotype.py new file mode 100755 index 00000000..7050dbf4 --- /dev/null +++ b/CIM16/Stereotype.py @@ -0,0 +1,37 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class Stereotype(Element): + + def __init__(self, *args, **kw_args): + """Initialises a new 'Stereotype' instance. + + """ + super(Stereotype, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/__init__.py b/CIM16/__init__.py new file mode 100755 index 00000000..3223265e --- /dev/null +++ b/CIM16/__init__.py @@ -0,0 +1,673 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package shows all the root level subpackage dependencies of the combined CIM model. +""" +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified date: 05/06/2017 + +from CIM16.CombinedVersion import CombinedVersion +from CIM16.Element import Element +from CIM16.Stereotype import Stereotype +from CIM16.Package import Package + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16" +nsPrefix = "cim" + +packageMap = { + "CombinedVersion": "CIM16", + "Element": "CIM16", + "Stereotype": "CIM16", + "Package": "CIM16", + "IEC61970CIMVersion": "CIM16.IEC61970", + "RemoteSource": "CIM16.IEC61970.SCADA", + "RemotePoint": "CIM16.IEC61970.SCADA", + "RemoteUnit": "CIM16.IEC61970.SCADA", + "RemoteControl": "CIM16.IEC61970.SCADA", + "CommunicationLink": "CIM16.IEC61970.SCADA", + "Reservoir": "CIM16.IEC61970.Generation.Production", + "CogenerationPlant": "CIM16.IEC61970.Generation.Production", + "GenUnitOpSchedule": "CIM16.IEC61970.Generation.Production", + "FuelAllocationSchedule": "CIM16.IEC61970.Generation.Production", + "GrossToNetActivePowerCurve": "CIM16.IEC61970.Generation.Production", + "LevelVsVolumeCurve": "CIM16.IEC61970.Generation.Production", + "StartRampCurve": "CIM16.IEC61970.Generation.Production", + "NuclearGeneratingUnit": "CIM16.IEC61970.Generation.Production", + "EmissionCurve": "CIM16.IEC61970.Generation.Production", + "HydroPumpOpSchedule": "CIM16.IEC61970.Generation.Production", + "SteamSendoutSchedule": "CIM16.IEC61970.Generation.Production", + "TargetLevelSchedule": "CIM16.IEC61970.Generation.Production", + "CombinedCyclePlant": "CIM16.IEC61970.Generation.Production", + "HeatRateCurve": "CIM16.IEC61970.Generation.Production", + "ThermalGeneratingUnit": "CIM16.IEC61970.Generation.Production", + "EmissionAccount": "CIM16.IEC61970.Generation.Production", + "PenstockLossCurve": "CIM16.IEC61970.Generation.Production", + "StartupModel": "CIM16.IEC61970.Generation.Production", + "HydroGeneratingUnit": "CIM16.IEC61970.Generation.Production", + "GenUnitOpCostCurve": "CIM16.IEC61970.Generation.Production", + "IncrementalHeatRateCurve": "CIM16.IEC61970.Generation.Production", + "FossilFuel": "CIM16.IEC61970.Generation.Production", + "GeneratingUnit": "CIM16.IEC61970.Generation.Production", + "StartIgnFuelCurve": "CIM16.IEC61970.Generation.Production", + "StartMainFuelCurve": "CIM16.IEC61970.Generation.Production", + "TailbayLossCurve": "CIM16.IEC61970.Generation.Production", + "HydroPump": "CIM16.IEC61970.Generation.Production", + "InflowForecast": "CIM16.IEC61970.Generation.Production", + "HydroGeneratingEfficiencyCurve": "CIM16.IEC61970.Generation.Production", + "ShutdownCurve": "CIM16.IEC61970.Generation.Production", + "HydroPowerPlant": "CIM16.IEC61970.Generation.Production", + "CAESPlant": "CIM16.IEC61970.Generation.Production", + "AirCompressor": "CIM16.IEC61970.Generation.Production", + "HeatInputCurve": "CIM16.IEC61970.Generation.Production", + "WindGeneratingUnit": "CIM16.IEC61970.Generation.Production", + "BWRSteamSupply": "CIM16.IEC61970.Generation.GenerationDynamics", + "HydroTurbine": "CIM16.IEC61970.Generation.GenerationDynamics", + "SteamTurbine": "CIM16.IEC61970.Generation.GenerationDynamics", + "SteamSupply": "CIM16.IEC61970.Generation.GenerationDynamics", + "FossilSteamSupply": "CIM16.IEC61970.Generation.GenerationDynamics", + "Subcritical": "CIM16.IEC61970.Generation.GenerationDynamics", + "PWRSteamSupply": "CIM16.IEC61970.Generation.GenerationDynamics", + "PrimeMover": "CIM16.IEC61970.Generation.GenerationDynamics", + "CombustionTurbine": "CIM16.IEC61970.Generation.GenerationDynamics", + "HeatRecoveryBoiler": "CIM16.IEC61970.Generation.GenerationDynamics", + "Supercritical": "CIM16.IEC61970.Generation.GenerationDynamics", + "DrumBoiler": "CIM16.IEC61970.Generation.GenerationDynamics", + "CTTempActivePowerCurve": "CIM16.IEC61970.Generation.GenerationDynamics", + "EquipmentItem": "CIM16.IEC61970.Informative.InfWork", + "Appointment": "CIM16.IEC61970.Informative.InfWork", + "WorkStatusEntry": "CIM16.IEC61970.Informative.InfWork", + "BusinessCase": "CIM16.IEC61970.Informative.InfWork", + "TypeMaterial": "CIM16.IEC61970.Informative.InfWork", + "DesignLocation": "CIM16.IEC61970.Informative.InfWork", + "OverheadCost": "CIM16.IEC61970.Informative.InfWork", + "Crew": "CIM16.IEC61970.Informative.InfWork", + "DiagnosisDataSet": "CIM16.IEC61970.Informative.InfWork", + "CUAsset": "CIM16.IEC61970.Informative.InfWork", + "Request": "CIM16.IEC61970.Informative.InfWork", + "Design": "CIM16.IEC61970.Informative.InfWork", + "WorkTask": "CIM16.IEC61970.Informative.InfWork", + "ConditionFactor": "CIM16.IEC61970.Informative.InfWork", + "QualificationRequirement": "CIM16.IEC61970.Informative.InfWork", + "WorkLocation": "CIM16.IEC61970.Informative.InfWork", + "CostType": "CIM16.IEC61970.Informative.InfWork", + "CUMaterialItem": "CIM16.IEC61970.Informative.InfWork", + "PropertyUnit": "CIM16.IEC61970.Informative.InfWork", + "Project": "CIM16.IEC61970.Informative.InfWork", + "CULaborItem": "CIM16.IEC61970.Informative.InfWork", + "LaborItem": "CIM16.IEC61970.Informative.InfWork", + "WorkFlowStep": "CIM16.IEC61970.Informative.InfWork", + "InspectionDataSet": "CIM16.IEC61970.Informative.InfWork", + "WorkCostDetail": "CIM16.IEC61970.Informative.InfWork", + "CompatibleUnit": "CIM16.IEC61970.Informative.InfWork", + "WorkCostSummary": "CIM16.IEC61970.Informative.InfWork", + "NonStandardItem": "CIM16.IEC61970.Informative.InfWork", + "InfoQuestion": "CIM16.IEC61970.Informative.InfWork", + "Regulation": "CIM16.IEC61970.Informative.InfWork", + "ContractorItem": "CIM16.IEC61970.Informative.InfWork", + "CUAllowableAction": "CIM16.IEC61970.Informative.InfWork", + "CULaborCode": "CIM16.IEC61970.Informative.InfWork", + "AccessPermit": "CIM16.IEC61970.Informative.InfWork", + "CUWorkEquipmentItem": "CIM16.IEC61970.Informative.InfWork", + "DesignLocationCU": "CIM16.IEC61970.Informative.InfWork", + "MaintenanceDataSet": "CIM16.IEC61970.Informative.InfWork", + "MiscCostItem": "CIM16.IEC61970.Informative.InfWork", + "MaterialItem": "CIM16.IEC61970.Informative.InfWork", + "ShiftPattern": "CIM16.IEC61970.Informative.InfWork", + "Capability": "CIM16.IEC61970.Informative.InfWork", + "Usage": "CIM16.IEC61970.Informative.InfWork", + "OneCallRequest": "CIM16.IEC61970.Informative.InfWork", + "Assignment": "CIM16.IEC61970.Informative.InfWork", + "CUContractorItem": "CIM16.IEC61970.Informative.InfWork", + "CUGroup": "CIM16.IEC61970.Informative.InfWork", + "ErpRecDelvLineItem": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpLedgerBudget": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpTimeEntry": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpCompetency": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpPurchaseOrder": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpEngChangeOrder": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpProjectAccounting": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpRecLineItem": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpPayableLineItem": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpLedBudLineItem": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpRequisition": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpOrganisation": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpInvoice": "CIM16.IEC61970.Informative.InfERPSupport", + "DocErpPersonRole": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpBankAccount": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpQuote": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpPerson": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpItemMaster": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpBOM": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpInventoryCount": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpIssueInventory": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpPayable": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpLedger": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpPOLineItem": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpLedgerEntry": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpPayment": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpReceivable": "CIM16.IEC61970.Informative.InfERPSupport", + "DocOrgRole": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpReqLineItem": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpTimeSheet": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpInventory": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpChartOfAccounts": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpSiteLevelData": "CIM16.IEC61970.Informative.InfERPSupport", + "OrgErpPersonRole": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpReceiveDelivery": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpSalesOrder": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpJournalEntry": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpInvoiceLineItem": "CIM16.IEC61970.Informative.InfERPSupport", + "OrgOrgRole": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpJournal": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpPersonnel": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpQuoteLineItem": "CIM16.IEC61970.Informative.InfERPSupport", + "ErpBomItemData": "CIM16.IEC61970.Informative.InfERPSupport", + "Role": "CIM16.IEC61970.Informative.InfCommon", + "Bank": "CIM16.IEC61970.Informative.InfCommon", + "Skill": "CIM16.IEC61970.Informative.InfCommon", + "BusinessRole": "CIM16.IEC61970.Informative.InfCommon", + "ScheduledEvent": "CIM16.IEC61970.Informative.InfCommon", + "ScheduleParameterInfo": "CIM16.IEC61970.Informative.InfCommon", + "DocPsrRole": "CIM16.IEC61970.Informative.InfCommon", + "Ratio": "CIM16.IEC61970.Informative.InfCommon", + "BankAccount": "CIM16.IEC61970.Informative.InfCommon", + "Craft": "CIM16.IEC61970.Informative.InfCommon", + "DocDocRole": "CIM16.IEC61970.Informative.InfCommon", + "BusinessPlan": "CIM16.IEC61970.Informative.InfCommon", + "FACTSDevice": "CIM16.IEC61970.Informative.InfAssets", + "DocAssetRole": "CIM16.IEC61970.Informative.InfAssets", + "DuctBank": "CIM16.IEC61970.Informative.InfAssets", + "ConductorAsset": "CIM16.IEC61970.Informative.InfAssets", + "FinancialInfo": "CIM16.IEC61970.Informative.InfAssets", + "ProtectionEquipmentInfo": "CIM16.IEC61970.Informative.InfAssets", + "ProcedureDataSet": "CIM16.IEC61970.Informative.InfAssets", + "WindingInsulation": "CIM16.IEC61970.Informative.InfAssets", + "Specification": "CIM16.IEC61970.Informative.InfAssets", + "UndergroundStructure": "CIM16.IEC61970.Informative.InfAssets", + "PotentialTransformerInfo": "CIM16.IEC61970.Informative.InfAssets", + "Structure": "CIM16.IEC61970.Informative.InfAssets", + "CurrentTransformerInfo": "CIM16.IEC61970.Informative.InfAssets", + "BushingInsulationPF": "CIM16.IEC61970.Informative.InfAssets", + "Joint": "CIM16.IEC61970.Informative.InfAssets", + "ElectricalInfo": "CIM16.IEC61970.Informative.InfAssets", + "WorkEquipment": "CIM16.IEC61970.Informative.InfAssets", + "FaultIndicatorInfo": "CIM16.IEC61970.Informative.InfAssets", + "Duct": "CIM16.IEC61970.Informative.InfAssets", + "PowerRating": "CIM16.IEC61970.Informative.InfAssets", + "AssetAssetRole": "CIM16.IEC61970.Informative.InfAssets", + "TransformerAsset": "CIM16.IEC61970.Informative.InfAssets", + "Procedure": "CIM16.IEC61970.Informative.InfAssets", + "BreakerInfo": "CIM16.IEC61970.Informative.InfAssets", + "CompositeSwitchInfo": "CIM16.IEC61970.Informative.InfAssets", + "Cabinet": "CIM16.IEC61970.Informative.InfAssets", + "Bushing": "CIM16.IEC61970.Informative.InfAssets", + "Vehicle": "CIM16.IEC61970.Informative.InfAssets", + "SurgeProtectorInfo": "CIM16.IEC61970.Informative.InfAssets", + "StructureSupport": "CIM16.IEC61970.Informative.InfAssets", + "ComEquipment": "CIM16.IEC61970.Informative.InfAssets", + "AssetPropertyCurve": "CIM16.IEC61970.Informative.InfAssets", + "FailureEvent": "CIM16.IEC61970.Informative.InfAssets", + "DimensionsInfo": "CIM16.IEC61970.Informative.InfAssets", + "Tower": "CIM16.IEC61970.Informative.InfAssets", + "MountingConnection": "CIM16.IEC61970.Informative.InfAssets", + "Medium": "CIM16.IEC61970.Informative.InfAssets", + "RecloserInfo": "CIM16.IEC61970.Informative.InfAssets", + "Facility": "CIM16.IEC61970.Informative.InfAssets", + "ShuntImpedanceInfo": "CIM16.IEC61970.Informative.InfAssets", + "ShuntCompensatorInfo": "CIM16.IEC61970.Informative.InfAssets", + "MountingPoint": "CIM16.IEC61970.Informative.InfAssets", + "SubstationAsset": "CIM16.IEC61970.Informative.InfAssets", + "Streetlight": "CIM16.IEC61970.Informative.InfAssets", + "Tool": "CIM16.IEC61970.Informative.InfAssets", + "SVC": "CIM16.IEC61970.Informative.InfAssets", + "OrgAssetRole": "CIM16.IEC61970.Informative.InfAssets", + "TestDataSet": "CIM16.IEC61970.Informative.InfAssets", + "GenericAssetModelOrMaterial": "CIM16.IEC61970.Informative.InfAssets", + "ReliabilityInfo": "CIM16.IEC61970.Informative.InfAssets", + "TransformerObservation": "CIM16.IEC61970.Informative.InfAssets", + "Pole": "CIM16.IEC61970.Informative.InfAssets", + "SwitchInfo": "CIM16.IEC61970.Informative.InfAssets", + "StandardIndustryCode": "CIM16.IEC61970.Informative.InfCustomers", + "OutageHistory": "CIM16.IEC61970.Informative.InfCustomers", + "ComplianceEvent": "CIM16.IEC61970.Informative.InfCustomers", + "CustomerBillingInfo": "CIM16.IEC61970.Informative.InfCustomers", + "ServiceGuarantee": "CIM16.IEC61970.Informative.InfCustomers", + "SubscribePowerCurve": "CIM16.IEC61970.Informative.InfCustomers", + "ExternalCustomerAgreement": "CIM16.IEC61970.Informative.InfCustomers", + "PowerQualityPricing": "CIM16.IEC61970.Informative.InfCustomers", + "WorkBillingInfo": "CIM16.IEC61970.Informative.InfCustomers", + "OutageRecord": "CIM16.IEC61970.Informative.InfOperations", + "OutageReport": "CIM16.IEC61970.Informative.InfOperations", + "ChangeItem": "CIM16.IEC61970.Informative.InfOperations", + "PSREvent": "CIM16.IEC61970.Informative.InfOperations", + "PlannedOutage": "CIM16.IEC61970.Informative.InfOperations", + "CircuitSection": "CIM16.IEC61970.Informative.InfOperations", + "SafetyDocument": "CIM16.IEC61970.Informative.InfOperations", + "OperationalRestriction": "CIM16.IEC61970.Informative.InfOperations", + "ChangeSet": "CIM16.IEC61970.Informative.InfOperations", + "SwitchingSchedule": "CIM16.IEC61970.Informative.InfOperations", + "Circuit": "CIM16.IEC61970.Informative.InfOperations", + "NetworkDataSet": "CIM16.IEC61970.Informative.InfOperations", + "OutageStep": "CIM16.IEC61970.Informative.InfOperations", + "OrgPsrRole": "CIM16.IEC61970.Informative.InfOperations", + "OutageCode": "CIM16.IEC61970.Informative.InfOperations", + "IncidentCode": "CIM16.IEC61970.Informative.InfOperations", + "LandBase": "CIM16.IEC61970.Informative.InfOperations", + "ErpPersonScheduleStepRole": "CIM16.IEC61970.Informative.InfOperations", + "SwitchingStep": "CIM16.IEC61970.Informative.InfOperations", + "CallBack": "CIM16.IEC61970.Informative.InfOperations", + "TroubleTicket": "CIM16.IEC61970.Informative.InfOperations", + "IncidentRecord": "CIM16.IEC61970.Informative.InfOperations", + "OutageNotification": "CIM16.IEC61970.Informative.InfOperations", + "OutageStepPsrRole": "CIM16.IEC61970.Informative.InfOperations", + "LocationGrant": "CIM16.IEC61970.Informative.InfLocations", + "RightOfWay": "CIM16.IEC61970.Informative.InfLocations", + "PersonPropertyRole": "CIM16.IEC61970.Informative.InfLocations", + "Zone": "CIM16.IEC61970.Informative.InfLocations", + "RedLine": "CIM16.IEC61970.Informative.InfLocations", + "Route": "CIM16.IEC61970.Informative.InfLocations", + "OrgPropertyRole": "CIM16.IEC61970.Informative.InfLocations", + "Direction": "CIM16.IEC61970.Informative.InfLocations", + "LandProperty": "CIM16.IEC61970.Informative.InfLocations", + "Hazard": "CIM16.IEC61970.Informative.InfLocations", + "GmlFeatureType": "CIM16.IEC61970.Informative.InfGMLSupport", + "Map": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlPointGeometry": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlHalo": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlColour": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlFont": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlPolygonSymbol": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlStroke": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlBaseSymbol": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlPosition": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlTextSymbol": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlPolygonGeometry": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlObservation": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlMark": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlGraphic": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlLabelPlacement": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlGeometryStyle": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlLineGeometry": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlValue": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlLineSymbol": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlDiagramObject": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlPointSymbol": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlTopologyStyle": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlSelector": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlSvgParameter": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlLabelStyle": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlFill": "CIM16.IEC61970.Informative.InfGMLSupport", + "Diagram": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlSymbol": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlFeatureStyle": "CIM16.IEC61970.Informative.InfGMLSupport", + "GmlRasterSymbol": "CIM16.IEC61970.Informative.InfGMLSupport", + "ModelingAuthority": "CIM16.IEC61970.Informative.InfCore", + "ModelingAuthoritySet": "CIM16.IEC61970.Informative.InfCore", + "LoadMgmtRecord": "CIM16.IEC61970.Informative.InfLoadControl", + "LoadShedFunction": "CIM16.IEC61970.Informative.InfLoadControl", + "LoadMgmtFunction": "CIM16.IEC61970.Informative.InfLoadControl", + "LoadLimitFunction": "CIM16.IEC61970.Informative.InfLoadControl", + "GasMeteringFunction": "CIM16.IEC61970.Informative.InfMetering", + "WaterMeteringFunction": "CIM16.IEC61970.Informative.InfMetering", + "AssetModelCatalogue": "CIM16.IEC61970.Informative.InfAssetModels", + "TransformerAssetModel": "CIM16.IEC61970.Informative.InfAssetModels", + "AssetModelCatalogueItem": "CIM16.IEC61970.Informative.InfAssetModels", + "TypeAssetCatalogue": "CIM16.IEC61970.Informative.InfTypeAsset", + "GeneratorTypeAsset": "CIM16.IEC61970.Informative.InfTypeAsset", + "SvVoltage": "CIM16.IEC61970.StateVariables", + "SvShortCircuit": "CIM16.IEC61970.StateVariables", + "SvShuntCompensatorSections": "CIM16.IEC61970.StateVariables", + "StateVariable": "CIM16.IEC61970.StateVariables", + "SvTapStep": "CIM16.IEC61970.StateVariables", + "SvStatus": "CIM16.IEC61970.StateVariables", + "SvInjection": "CIM16.IEC61970.StateVariables", + "SvPowerFlow": "CIM16.IEC61970.StateVariables", + "TopologicalIsland": "CIM16.IEC61970.StateVariables", + "PhaseImpedanceData": "CIM16.IEC61970.Wires", + "TapSchedule": "CIM16.IEC61970.Wires", + "TransformerStarImpedance": "CIM16.IEC61970.Wires", + "Recloser": "CIM16.IEC61970.Wires", + "RatioTapChangerTabularPoint": "CIM16.IEC61970.Wires", + "PhaseTapChangerTabular": "CIM16.IEC61970.Wires", + "RatioTapChanger": "CIM16.IEC61970.Wires", + "PhaseTapChangerLinear": "CIM16.IEC61970.Wires", + "ACLineSegment": "CIM16.IEC61970.Wires", + "ACLineSegmentPhase": "CIM16.IEC61970.WiresPhaseModel", + "PowerTransformerEnd": "CIM16.IEC61970.Wires", + "Junction": "CIM16.IEC61970.Wires", + "RegulatingCondEq": "CIM16.IEC61970.Wires", + "Sectionaliser": "CIM16.IEC61970.Wires", + "RatioTapChangerTabular": "CIM16.IEC61970.Wires", + "PowerTransformer": "CIM16.IEC61970.Wires", + "Fuse": "CIM16.IEC61970.Wires", + "EnergyConsumer": "CIM16.IEC61970.Wires", + "Disconnector": "CIM16.IEC61970.Wires", + "Connector": "CIM16.IEC61970.Wires", + "ReactiveCapabilityCurve": "CIM16.IEC61970.Wires", + "Plant": "CIM16.IEC61970.Wires", + "GroundDisconnector": "CIM16.IEC61970.Wires", + "Resistor": "CIM16.IEC61970.Wires", + "SynchronousMachine": "CIM16.IEC61970.Wires", + "PhaseTapChangerAsymetrical": "CIM16.IEC61970.Wires", + "RectifierInverter": "CIM16.IEC61970.Wires", + "SeriesCompensator": "CIM16.IEC61970.Wires", + "TapChangerControl": "CIM16.IEC61970.Wires", + "RegulatingControl": "CIM16.IEC61970.Wires", + "ProtectedSwitch": "CIM16.IEC61970.Wires", + "PhaseTapChanger": "CIM16.IEC61970.Wires", + "Ground": "CIM16.IEC61970.Wires", + "CompositeSwitch": "CIM16.IEC61970.Wires", + "RegulationSchedule": "CIM16.IEC61970.Wires", + "TransformerTankEnd": "CIM16.IEC61970.Wires", + "Breaker": "CIM16.IEC61970.Wires", + "MutualCoupling": "CIM16.IEC61970.Wires", + "Line": "CIM16.IEC61970.Wires", + "PerLengthPhaseImpedance": "CIM16.IEC61970.Wires", + "FrequencyConverter": "CIM16.IEC61970.Wires", + "ShuntCompensator": "CIM16.IEC61970.Wires", + "VoltageControlZone": "CIM16.IEC61970.Wires", + "LoadBreakSwitch": "CIM16.IEC61970.Wires", + "BusbarSection": "CIM16.IEC61970.Wires", + "TransformerEnd": "CIM16.IEC61970.Wires", + "TransformerCoreAdmittance": "CIM16.IEC61970.Wires", + "StaticVarCompensator": "CIM16.IEC61970.Wires", + "Switch": "CIM16.IEC61970.Wires", + "PerLengthSequenceImpedance": "CIM16.IEC61970.Wires", + "TransformerMeshImpedance": "CIM16.IEC61970.Wires", + "SwitchSchedule": "CIM16.IEC61970.Wires", + "EnergySource": "CIM16.IEC61970.Wires", + "TransformerTank": "CIM16.IEC61970.Wires", + "PhaseTapChangerTabularPoint": "CIM16.IEC61970.Wires", + "DCLineSegment": "CIM16.IEC61970.Wires", + "TapChanger": "CIM16.IEC61970.Wires", + "Conductor": "CIM16.IEC61970.Wires", + "PhaseTapChangerNonLinear": "CIM16.IEC61970.Wires", + "PhaseTapChangerSymetrical": "CIM16.IEC61970.Wires", + "Jumper": "CIM16.IEC61970.Wires", + "AccumulatorLimit": "CIM16.IEC61970.Meas", + "ValueToAlias": "CIM16.IEC61970.Meas", + "MeasurementValueSource": "CIM16.IEC61970.Meas", + "Analog": "CIM16.IEC61970.Meas", + "AnalogValue": "CIM16.IEC61970.Meas", + "Measurement": "CIM16.IEC61970.Meas", + "ControlType": "CIM16.IEC61970.Meas", + "StringMeasurementValue": "CIM16.IEC61970.Meas", + "StringMeasurement": "CIM16.IEC61970.Meas", + "AnalogLimit": "CIM16.IEC61970.Meas", + "SetPoint": "CIM16.IEC61970.Meas", + "Limit": "CIM16.IEC61970.Meas", + "Discrete": "CIM16.IEC61970.Meas", + "ValueAliasSet": "CIM16.IEC61970.Meas", + "Quality61850": "CIM16.IEC61970.Meas", + "AccumulatorValue": "CIM16.IEC61970.Meas", + "Command": "CIM16.IEC61970.Meas", + "Accumulator": "CIM16.IEC61970.Meas", + "MeasurementValueQuality": "CIM16.IEC61970.Meas", + "MeasurementValue": "CIM16.IEC61970.Meas", + "DiscreteValue": "CIM16.IEC61970.Meas", + "AnalogLimitSet": "CIM16.IEC61970.Meas", + "LimitSet": "CIM16.IEC61970.Meas", + "AccumulatorLimitSet": "CIM16.IEC61970.Meas", + "Control": "CIM16.IEC61970.Meas", + "ConformLoad": "CIM16.IEC61970.LoadModel", + "ConformLoadGroup": "CIM16.IEC61970.LoadModel", + "SeasonDayTypeSchedule": "CIM16.IEC61970.LoadModel", + "LoadGroup": "CIM16.IEC61970.LoadModel", + "ConformLoadSchedule": "CIM16.IEC61970.LoadModel", + "LoadArea": "CIM16.IEC61970.LoadModel", + "PowerCutZone": "CIM16.IEC61970.LoadModel", + "LoadResponseCharacteristic": "CIM16.IEC61970.LoadModel", + "NonConformLoad": "CIM16.IEC61970.LoadModel", + "StationSupply": "CIM16.IEC61970.LoadModel", + "EnergyArea": "CIM16.IEC61970.LoadModel", + "NonConformLoadSchedule": "CIM16.IEC61970.LoadModel", + "NonConformLoadGroup": "CIM16.IEC61970.LoadModel", + "DayType": "CIM16.IEC61970.LoadModel", + "SubLoadArea": "CIM16.IEC61970.LoadModel", + "Season": "CIM16.IEC61970.LoadModel", + "SwitchPhase": "CIM16.IEC61970.WiresPhaseModel", + "ShuntCompensatorPhase": "CIM16.IEC61970.WiresPhaseModel", + "EnergyConsumerPhase": "CIM16.IEC61970.WiresPhaseModel", + "AltTieMeas": "CIM16.IEC61970.ControlArea", + "AltGeneratingUnitMeas": "CIM16.IEC61970.ControlArea", + "TieFlow": "CIM16.IEC61970.ControlArea", + "ControlArea": "CIM16.IEC61970.ControlArea", + "ControlAreaGeneratingUnit": "CIM16.IEC61970.ControlArea", + "PotentialTransformer": "CIM16.IEC61970.AuxiliaryEquipment", + "Sensor": "CIM16.IEC61970.AuxiliaryEquipment", + "AuxiliaryEquipment": "CIM16.IEC61970.AuxiliaryEquipment", + "CurrentTransformer": "CIM16.IEC61970.AuxiliaryEquipment", + "SurgeProtector": "CIM16.IEC61970.AuxiliaryEquipment", + "FaultIndicator": "CIM16.IEC61970.AuxiliaryEquipment", + "DateTimeInterval": "CIM16.IEC61970.Domain", + "PowerSystemResource": "CIM16.IEC61970.Core", + "NameTypeAuthority": "CIM16.IEC61970.Core", + "Equipment": "CIM16.IEC61970.Core", + "ConductingEquipment": "CIM16.IEC61970.Core", + "RegularTimePoint": "CIM16.IEC61970.Core", + "ConnectivityNode": "CIM16.IEC61970.Core", + "PSRType": "CIM16.IEC61970.Core", + "ConnectivityNodeContainer": "CIM16.IEC61970.Core", + "Bay": "CIM16.IEC61970.Core", + "EquipmentContainer": "CIM16.IEC61970.Core", + "ReportingGroup": "CIM16.IEC61970.Core", + "BasePower": "CIM16.IEC61970.Core", + "PsrList": "CIM16.IEC61970.Core", + "IdentifiedObject": "CIM16.IEC61970.Core", + "BasicIntervalSchedule": "CIM16.IEC61970.Core", + "Curve": "CIM16.IEC61970.Core", + "GeographicalRegion": "CIM16.IEC61970.Core", + "CurveData": "CIM16.IEC61970.Core", + "SubGeographicalRegion": "CIM16.IEC61970.Core", + "NameType": "CIM16.IEC61970.Core", + "Substation": "CIM16.IEC61970.Core", + "Name": "CIM16.IEC61970.Core", + "BaseVoltage": "CIM16.IEC61970.Core", + "Terminal": "CIM16.IEC61970.Core", + "IrregularIntervalSchedule": "CIM16.IEC61970.Core", + "RegularIntervalSchedule": "CIM16.IEC61970.Core", + "OperatingParticipant": "CIM16.IEC61970.Core", + "OperatingShare": "CIM16.IEC61970.Core", + "VoltageLevel": "CIM16.IEC61970.Core", + "ReportingSuperGroup": "CIM16.IEC61970.Core", + "IrregularTimePoint": "CIM16.IEC61970.Core", + "TextDiagramObject": "CIM16.IEC61970.Graphics", + "DiagramObjectGluePoint": "CIM16.IEC61970.Graphics", + "DiagramObject": "CIM16.IEC61970.Graphics", + "DiagramObjectStyle": "CIM16.IEC61970.Graphics", + "DiagramObjectPoint": "CIM16.IEC61970.Graphics", + "VisibilityLayer": "CIM16.IEC61970.Graphics", + "ApparentPowerLimit": "CIM16.IEC61970.OperationalLimits", + "ActivePowerLimit": "CIM16.IEC61970.OperationalLimits", + "OperationalLimitType": "CIM16.IEC61970.OperationalLimits", + "BranchGroup": "CIM16.IEC61970.OperationalLimits", + "OperationalLimitSet": "CIM16.IEC61970.OperationalLimits", + "ActivePowerLimitSet": "CIM16.IEC61970.OperationalLimits", + "CurrentLimit": "CIM16.IEC61970.OperationalLimits", + "CurrentLimitSet": "CIM16.IEC61970.OperationalLimits", + "ApparentPowerLimitSet": "CIM16.IEC61970.OperationalLimits", + "BranchGroupTerminal": "CIM16.IEC61970.OperationalLimits", + "VoltageLimitSet": "CIM16.IEC61970.OperationalLimits", + "VoltageLimit": "CIM16.IEC61970.OperationalLimits", + "OperationalLimit": "CIM16.IEC61970.OperationalLimits", + "SwitchingOperation": "CIM16.IEC61970.Outage", + "OutageSchedule": "CIM16.IEC61970.Outage", + "ClearanceTagType": "CIM16.IEC61970.Outage", + "ClearanceTag": "CIM16.IEC61970.Outage", + "Cut": "CIM16.IEC61970.CutsJumpers", + "Clamp": "CIM16.IEC61970.CutsJumpers", + "RecloseSequence": "CIM16.IEC61970.Protection", + "SynchrocheckRelay": "CIM16.IEC61970.Protection", + "CurrentRelay": "CIM16.IEC61970.Protection", + "ProtectionEquipment": "CIM16.IEC61970.Protection", + "EquivalentShunt": "CIM16.IEC61970.Equivalents", + "EquivalentEquipment": "CIM16.IEC61970.Equivalents", + "EquivalentNetwork": "CIM16.IEC61970.Equivalents", + "EquivalentInjection": "CIM16.IEC61970.Equivalents", + "EquivalentBranch": "CIM16.IEC61970.Equivalents", + "ContingencyEquipment": "CIM16.IEC61970.Contingency", + "Contingency": "CIM16.IEC61970.Contingency", + "ContingencyElement": "CIM16.IEC61970.Contingency", + "BusNameMarker": "CIM16.IEC61970.Topology", + "TopologicalNode": "CIM16.IEC61970.Topology", + "IEC61968CIMVersion": "CIM16.IEC61968", + "PostalAddress": "CIM16.IEC61968.Common", + "Status": "CIM16.IEC61968.Common", + "ElectronicAddress": "CIM16.IEC61968.Common", + "Location": "CIM16.IEC61968.Common", + "TownDetail": "CIM16.IEC61968.Common", + "CoordinateSystem": "CIM16.IEC61968.Common", + "Document": "CIM16.IEC61968.Common", + "PositionPoint": "CIM16.IEC61968.Common", + "UserAttribute": "CIM16.IEC61968.Common", + "StreetAddress": "CIM16.IEC61968.Common", + "StreetDetail": "CIM16.IEC61968.Common", + "TimeSchedule": "CIM16.IEC61968.Common", + "ActivityRecord": "CIM16.IEC61968.Common", + "TimePoint": "CIM16.IEC61968.Common", + "Organisation": "CIM16.IEC61968.Common", + "TelephoneNumber": "CIM16.IEC61968.Common", + "Agreement": "CIM16.IEC61968.Common", + "ShortCircuitTest": "CIM16.IEC61968.AssetModels", + "EndDeviceInfo": "CIM16.IEC61968.AssetModels", + "WireType": "CIM16.IEC61968.AssetModels", + "TapeShieldCableInfo": "CIM16.IEC61968.AssetModels", + "ConductorInfo": "CIM16.IEC61968.AssetModels", + "TapChangerInfo": "CIM16.IEC61968.AssetModels", + "TransformerTankInfo": "CIM16.IEC61968.AssetModels", + "PowerTransformerInfo": "CIM16.IEC61968.AssetModels", + "OpenCircuitTest": "CIM16.IEC61968.AssetModels", + "CableInfo": "CIM16.IEC61968.AssetModels", + "TransformerEndInfo": "CIM16.IEC61968.AssetModels", + "NoLoadTest": "CIM16.IEC61968.AssetModels", + "OverheadConductorInfo": "CIM16.IEC61968.AssetModels", + "ConcentricNeutralCableInfo": "CIM16.IEC61968.AssetModels", + "WireArrangement": "CIM16.IEC61968.AssetModels", + "TransformerTest": "CIM16.IEC61968.AssetModels", + "SDPLocation": "CIM16.IEC61968.Metering", + "Reading": "CIM16.IEC61968.Metering", + "ServiceDeliveryPoint": "CIM16.IEC61968.Metering", + "ElectricMeteringFunction": "CIM16.IEC61968.Metering", + "DemandResponseProgram": "CIM16.IEC61968.Metering", + "ReadingMultiplier": "CIM16.IEC61968.Metering", + "MeterReading": "CIM16.IEC61968.Metering", + "ReadingQuality": "CIM16.IEC61968.Metering", + "EndDeviceEvent": "CIM16.IEC61968.Metering", + "IntervalReading": "CIM16.IEC61968.Metering", + "Meter": "CIM16.IEC61968.Metering", + "MeterServiceWork": "CIM16.IEC61968.Metering", + "PendingCalculation": "CIM16.IEC61968.Metering", + "IntervalBlock": "CIM16.IEC61968.Metering", + "EndDeviceFunction": "CIM16.IEC61968.Metering", + "ComFunction": "CIM16.IEC61968.Metering", + "EndDevice": "CIM16.IEC61968.Metering", + "SimpleEndDeviceFunction": "CIM16.IEC61968.Metering", + "EndDeviceGroup": "CIM16.IEC61968.Metering", + "Register": "CIM16.IEC61968.Metering", + "EndDeviceControl": "CIM16.IEC61968.Metering", + "DynamicDemand": "CIM16.IEC61968.Metering", + "ReadingType": "CIM16.IEC61968.Metering", + "VendorShift": "CIM16.IEC61968.PaymentMetering", + "Transactor": "CIM16.IEC61968.PaymentMetering", + "CashierShift": "CIM16.IEC61968.PaymentMetering", + "TariffProfile": "CIM16.IEC61968.PaymentMetering", + "AccountingUnit": "CIM16.IEC61968.PaymentMetering", + "Transaction": "CIM16.IEC61968.PaymentMetering", + "TimeTariffInterval": "CIM16.IEC61968.PaymentMetering", + "Charge": "CIM16.IEC61968.PaymentMetering", + "AuxiliaryAgreement": "CIM16.IEC61968.PaymentMetering", + "Tender": "CIM16.IEC61968.PaymentMetering", + "ServiceSupplier": "CIM16.IEC61968.PaymentMetering", + "MerchantAgreement": "CIM16.IEC61968.PaymentMetering", + "LineDetail": "CIM16.IEC61968.PaymentMetering", + "ConsumptionTariffInterval": "CIM16.IEC61968.PaymentMetering", + "Vendor": "CIM16.IEC61968.PaymentMetering", + "Cheque": "CIM16.IEC61968.PaymentMetering", + "AccountMovement": "CIM16.IEC61968.PaymentMetering", + "Shift": "CIM16.IEC61968.PaymentMetering", + "Receipt": "CIM16.IEC61968.PaymentMetering", + "Due": "CIM16.IEC61968.PaymentMetering", + "BankAccountDetail": "CIM16.IEC61968.PaymentMetering", + "AuxiliaryAccount": "CIM16.IEC61968.PaymentMetering", + "Cashier": "CIM16.IEC61968.PaymentMetering", + "Card": "CIM16.IEC61968.PaymentMetering", + "MerchantAccount": "CIM16.IEC61968.PaymentMetering", + "PointOfSale": "CIM16.IEC61968.PaymentMetering", + "ProductAssetModel": "CIM16.IEC61968.Assets", + "AssetModel": "CIM16.IEC61968.Assets", + "Asset": "CIM16.IEC61968.Assets", + "ComMedia": "CIM16.IEC61968.Assets", + "AssetContainer": "CIM16.IEC61968.Assets", + "AssetFunction": "CIM16.IEC61968.Assets", + "Seal": "CIM16.IEC61968.Assets", + "AssetInfo": "CIM16.IEC61968.Assets", + "AcceptanceTest": "CIM16.IEC61968.Assets", + "Work": "CIM16.IEC61968.Work", + "Tariff": "CIM16.IEC61968.Customers", + "CustomerAccount": "CIM16.IEC61968.Customers", + "ServiceLocation": "CIM16.IEC61968.Customers", + "CustomerAgreement": "CIM16.IEC61968.Customers", + "ServiceCategory": "CIM16.IEC61968.Customers", + "PricingStructure": "CIM16.IEC61968.Customers", + "Customer": "CIM16.IEC61968.Customers", + "ConnectDisconnectFunction": "CIM16.IEC61968.LoadControl", + "RemoteConnectDisconnectInfo": "CIM16.IEC61968.LoadControl", + "MarketParticipant": "CIM16.IEC62325", + "IEC62325CIMVersion": "CIM16.IEC62325", + "MarketRole": "CIM16.IEC62325", + "PackageDependenciesCIMVeresion": "CIM16.PackageDependencies", + "RotatingMachineDynamics": "CIM16.IEC61970.Dynamics", + "SynchronousMachineTimeConstantReactance": "CIM16.IEC61970.Dynamics", + "SynchronousMachineDynamics": "CIM16.IEC61970.Dynamics", + "DynamicsFunctionBlock": "CIM16.IEC61970.Dynamics", + "SynchronousMachineUserDefined": "CIM16.IEC61970.Dynamics", + "SynchronousMachineDetailed": "CIM16.IEC61970.Dynamics", + "SynchronousMachineSimplified": "CIM16.IEC61970.Dynamics", + "SynchronousMachineEquivalentCircuit": "CIM16.IEC61970.Dynamics", + +} + + +class CIMTime(str): + pass + +class CIMDateTime(str): + pass + +class CIMDuration(str): + pass + +class CIMGYear(str): + pass + +class CIMDate(str): + pass + +class CIMGMonthDay(str): + pass + +class CIMGMonth(str): + pass + +class CIMGDay(str): + pass + +class CIMGYearMonth(str): + pass diff --git a/PyCIM/RDFXMLReader.py b/PyCIM/RDFXMLReader.py index 872ac18e..02da384d 100644 --- a/PyCIM/RDFXMLReader.py +++ b/PyCIM/RDFXMLReader.py @@ -21,6 +21,9 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified date: 05/06/2017 + from xml.etree.cElementTree import iterparse from time import time @@ -29,6 +32,7 @@ def cimread(source, packageMap=None, nsURI=None, start_dict=None): + # type: (object, object, object, object) -> object """ CIM RDF/XML parser. @type source: File-like object or a path to a file. @@ -272,15 +276,15 @@ def get_cim_ns(namespaces): nsuri = ns - import CIM14, CIM15 + import CIM14, CIM15, CIM16 if ns == CIM14.nsURI: ns = 'CIM14' elif ns == CIM15.nsURI: ns = 'CIM15' elif ns == CIM16nsURI: - ns = 'CIM15' + ns = 'CIM16' else: - ns = 'CIM15' + ns = 'CIM16' logger.warn('Could not detect CIM version. Using %s.' % ns) cim = __import__(ns, globals(), locals(), ['nsURI', 'packageMap']) @@ -290,4 +294,5 @@ def get_cim_ns(namespaces): if __name__ == "__main__": logging.basicConfig(level=logging.INFO) - cimread("Test/Data/EDF_AIGUE_v9_COMBINED.xml") + cimread("/Users/fran_jo/Desktop/PhD_CODE/edu.smartslab.cim2model/res/network/ieee_9bus_cim16_basic.xml") + diff --git a/PyCIM/__init__.py b/PyCIM/__init__.py index f6009f61..9c6170a1 100644 --- a/PyCIM/__init__.py +++ b/PyCIM/__init__.py @@ -21,4 +21,5 @@ from PyCIM.RDFXMLReader import cimread from PyCIM.RDFXMLWriter import cimwrite -__version__ = "15.15.0" +#__version__ = "15.15.0" +__version__ = "16.01.0" From 8f817fe563fa8eb56834d6f08f57f3d324544474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francis=20Go=CC=81mez?= Date: Tue, 19 Sep 2017 16:02:36 +0200 Subject: [PATCH 2/3] Setup modified to support new package CIM16 Rearrenging of packages for new organization within CIM16 Rearrenging of packages to test new namespaces within CIM14 --- .gitignore | 2 + CIM14/CDPSM/Asset/Element.py | 39 ++ .../Asset/IEC61968/AssetModels/CableInfo.py | 79 ++++ .../AssetModels/ConcentricNeutralCableInfo.py | 47 ++ .../IEC61968/AssetModels/ConductorInfo.py | 111 +++++ .../IEC61968/AssetModels/EndDeviceInfo.py | 51 ++ .../AssetModels/OverheadConductorInfo.py | 51 ++ .../AssetModels/PowerTransformerInfo.py | 65 +++ .../IEC61968/AssetModels/TapChangerInfo.py | 95 ++++ .../AssetModels/TapeShieldCableInfo.py | 47 ++ .../AssetModels/TransformerEndInfo.py | 122 +++++ .../AssetModels/TransformerTankInfo.py | 112 +++++ .../IEC61968/AssetModels/WireArrangement.py | 93 ++++ .../Asset/IEC61968/AssetModels/WireType.py | 113 +++++ .../Asset/IEC61968/AssetModels/__init__.py | 69 +++ .../CDPSM/Asset/IEC61968/Assets/AssetInfo.py | 39 ++ CIM14/CDPSM/Asset/IEC61968/Assets/__init__.py | 28 ++ CIM14/CDPSM/Asset/IEC61968/__init__.py | 27 ++ .../Asset/IEC61970/Core/IdentifiedObject.py | 73 +++ CIM14/CDPSM/Asset/IEC61970/Core/Name.py | 85 ++++ CIM14/CDPSM/Asset/IEC61970/Core/NameType.py | 65 +++ CIM14/CDPSM/Asset/IEC61970/Core/__init__.py | 30 ++ .../Asset/IEC61970/Wires/ACLineSegment.py | 102 ++++ .../IEC61970/Wires/PerLengthPhaseImpedance.py | 65 +++ .../Wires/PerLengthSequenceImpedance.py | 65 +++ .../Wires/TransformerCoreAdmittance.py | 63 +++ .../Asset/IEC61970/Wires/TransformerEnd.py | 102 ++++ .../Wires/TransformerStarImpedance.py | 65 +++ .../Asset/IEC61970/Wires/TransformerTank.py | 60 +++ .../IEC61970/Wires/TransformerTankEnd.py | 39 ++ CIM14/CDPSM/Asset/IEC61970/Wires/__init__.py | 40 ++ CIM14/CDPSM/Asset/IEC61970/__init__.py | 27 ++ CIM14/CDPSM/Asset/__init__.py | 138 ++++++ CIM14/CDPSM/Connectivity/Element.py | 39 ++ .../Connectivity/IEC61970/Core/BaseVoltage.py | 95 ++++ CIM14/CDPSM/Connectivity/IEC61970/Core/Bay.py | 81 ++++ .../IEC61970/Core/ConductingEquipment.py | 65 +++ .../IEC61970/Core/ConnectivityNode.py | 86 ++++ .../Core/ConnectivityNodeContainer.py | 65 +++ .../Connectivity/IEC61970/Core/Equipment.py | 60 +++ .../IEC61970/Core/EquipmentContainer.py | 65 +++ .../IEC61970/Core/GeographicalRegion.py | 65 +++ .../IEC61970/Core/IdentifiedObject.py | 73 +++ .../CDPSM/Connectivity/IEC61970/Core/Name.py | 85 ++++ .../Connectivity/IEC61970/Core/NameType.py | 94 ++++ .../IEC61970/Core/NameTypeAuthority.py | 73 +++ .../Connectivity/IEC61970/Core/PSRType.py | 39 ++ .../IEC61970/Core/PowerSystemResource.py | 39 ++ .../IEC61970/Core/SubGeographicalRegion.py | 112 +++++ .../Connectivity/IEC61970/Core/Substation.py | 112 +++++ .../Connectivity/IEC61970/Core/Terminal.py | 111 +++++ .../IEC61970/Core/VoltageLevel.py | 115 +++++ .../Connectivity/IEC61970/Core/__init__.py | 50 ++ .../IEC61970/Wires/ACLineSegment.py | 60 +++ .../Connectivity/IEC61970/Wires/Breaker.py | 39 ++ .../IEC61970/Wires/BusbarSection.py | 39 ++ .../Connectivity/IEC61970/Wires/Conductor.py | 43 ++ .../IEC61970/Wires/DCLineSegment.py | 39 ++ .../IEC61970/Wires/Disconnector.py | 39 ++ .../IEC61970/Wires/EnergyConsumer.py | 39 ++ .../IEC61970/Wires/EnergySource.py | 39 ++ .../CDPSM/Connectivity/IEC61970/Wires/Fuse.py | 39 ++ .../Connectivity/IEC61970/Wires/Ground.py | 39 ++ .../IEC61970/Wires/GroundDisconnector.py | 39 ++ .../Connectivity/IEC61970/Wires/Jumper.py | 39 ++ .../Connectivity/IEC61970/Wires/Junction.py | 39 ++ .../CDPSM/Connectivity/IEC61970/Wires/Line.py | 60 +++ .../IEC61970/Wires/LoadBreakSwitch.py | 39 ++ .../IEC61970/Wires/PowerTransformer.py | 91 ++++ .../IEC61970/Wires/PowerTransformerEnd.py | 59 +++ .../IEC61970/Wires/Sectionaliser.py | 39 ++ .../IEC61970/Wires/SeriesCompensator.py | 39 ++ .../IEC61970/Wires/ShuntCompensator.py | 39 ++ .../Connectivity/IEC61970/Wires/Switch.py | 43 ++ .../IEC61970/Wires/SynchronousMachine.py | 39 ++ .../IEC61970/Wires/TransformerEnd.py | 60 +++ .../IEC61970/Wires/TransformerTank.py | 86 ++++ .../IEC61970/Wires/TransformerTankEnd.py | 64 +++ .../Connectivity/IEC61970/Wires/__init__.py | 52 +++ .../WiresPhaseModel/ShuntCompensatorPhase.py | 39 ++ .../IEC61970/WiresPhaseModel/SwitchPhase.py | 39 ++ .../IEC61970/WiresPhaseModel/__init__.py | 32 ++ CIM14/CDPSM/Connectivity/IEC61970/__init__.py | 27 ++ CIM14/CDPSM/Connectivity/__init__.py | 114 +++++ CIM16/IEC61970/Base/Core/BasePower.py | 43 ++ CIM16/IEC61970/Base/Core/BaseVoltage.py | 147 ++++++ .../Base/Core/BasicIntervalSchedule.py | 59 +++ CIM16/IEC61970/Base/Core/Bay.py | 97 ++++ .../IEC61970/Base/Core/ConductingEquipment.py | 189 ++++++++ CIM16/IEC61970/Base/Core/ConnectivityNode.py | 107 +++++ .../Base/Core/ConnectivityNodeContainer.py | 91 ++++ CIM16/IEC61970/Base/Core/Curve.py | 101 ++++ CIM16/IEC61970/Base/Core/CurveData.py | 76 +++ CIM16/IEC61970/Base/Core/Equipment.py | 125 +++++ .../IEC61970/Base/Core/EquipmentContainer.py | 65 +++ .../IEC61970/Base/Core/GeographicalRegion.py | 65 +++ CIM16/IEC61970/Base/Core/IdentifiedObject.py | 124 +++++ .../Base/Core/IrregularIntervalSchedule.py | 65 +++ .../IEC61970/Base/Core/IrregularTimePoint.py | 72 +++ CIM16/IEC61970/Base/Core/Name.py | 85 ++++ CIM16/IEC61970/Base/Core/NameType.py | 94 ++++ CIM16/IEC61970/Base/Core/NameTypeAuthority.py | 73 +++ .../Base/Core/OperatingParticipant.py | 65 +++ CIM16/IEC61970/Base/Core/OperatingShare.py | 85 ++++ CIM16/IEC61970/Base/Core/PSRType.py | 65 +++ .../IEC61970/Base/Core/PowerSystemResource.py | 436 ++++++++++++++++++ CIM16/IEC61970/Base/Core/PsrList.py | 74 +++ .../Base/Core/RegularIntervalSchedule.py | 73 +++ CIM16/IEC61970/Base/Core/RegularTimePoint.py | 72 +++ CIM16/IEC61970/Base/Core/ReportingGroup.py | 144 ++++++ .../IEC61970/Base/Core/ReportingSuperGroup.py | 65 +++ .../Base/Core/SubGeographicalRegion.py | 112 +++++ CIM16/IEC61970/Base/Core/Substation.py | 112 +++++ CIM16/IEC61970/Base/Core/Terminal.py | 407 ++++++++++++++++ CIM16/IEC61970/Base/Core/VoltageLevel.py | 115 +++++ CIM16/IEC61970/Base/Core/__init__.py | 85 ++++ CIM16/IEC61970/Base/Meas/Analog.py | 133 ++++++ CIM16/IEC61970/Base/Meas/AnalogLimit.py | 64 +++ CIM16/IEC61970/Base/Meas/AnalogLimitSet.py | 97 ++++ CIM16/IEC61970/Base/Meas/AnalogValue.py | 116 +++++ CIM16/IEC61970/Base/Meas/Measurement.py | 180 ++++++++ CIM16/IEC61970/Base/Meas/MeasurementValue.py | 184 ++++++++ CIM16/IEC61970/Base/Meas/__init__.py | 33 ++ CIM16/IEC61970/Base/__init__.py | 28 ++ .../Dynamics/DynamicsFunctionBlock.py | 2 +- .../Dynamics/RotatingMachineDynamics.py | 2 +- .../Dynamics/SynchronousMachineDetailed.py | 2 +- .../Dynamics/SynchronousMachineDynamics.py | 2 +- .../SynchronousMachineEquivalentCircuit.py | 2 +- .../Dynamics/SynchronousMachineSimplified.py | 2 +- ...SynchronousMachineTimeConstantReactance.py | 2 +- .../Dynamics/SynchronousMachineUserDefined.py | 2 +- CIM16/IEC61970/Dynamics/__init__.py | 2 +- CIM16/IEC61970/IEC61970CIMVersion.py | 2 +- CIM16/IEC61970/__init__.py | 2 +- CIM16/__init__.py | 74 +-- PyCIM/RDFXMLReader.py | 14 +- PyCIM/RDFXMLWriter.py | 14 +- PyCIM/SimpleXMLWriter.py | 2 + PyCIM/Test/CIM16Test.py | 290 ++++++++++++ PyCIM/Test/RedREE_RDFXMLReader_TestCIM14.py | 96 ++++ PyCIM/Test/RedREE_RDFXMLReader_TestCIM16.py | 90 ++++ setup.py | 2 +- setup15.py | 64 +++ 144 files changed, 10263 insertions(+), 54 deletions(-) create mode 100644 CIM14/CDPSM/Asset/Element.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/AssetModels/CableInfo.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/AssetModels/ConcentricNeutralCableInfo.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/AssetModels/ConductorInfo.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/AssetModels/EndDeviceInfo.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/AssetModels/OverheadConductorInfo.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/AssetModels/PowerTransformerInfo.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/AssetModels/TapChangerInfo.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/AssetModels/TapeShieldCableInfo.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/AssetModels/TransformerEndInfo.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/AssetModels/TransformerTankInfo.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/AssetModels/WireArrangement.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/AssetModels/WireType.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/AssetModels/__init__.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/Assets/AssetInfo.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/Assets/__init__.py create mode 100644 CIM14/CDPSM/Asset/IEC61968/__init__.py create mode 100644 CIM14/CDPSM/Asset/IEC61970/Core/IdentifiedObject.py create mode 100644 CIM14/CDPSM/Asset/IEC61970/Core/Name.py create mode 100644 CIM14/CDPSM/Asset/IEC61970/Core/NameType.py create mode 100644 CIM14/CDPSM/Asset/IEC61970/Core/__init__.py create mode 100644 CIM14/CDPSM/Asset/IEC61970/Wires/ACLineSegment.py create mode 100644 CIM14/CDPSM/Asset/IEC61970/Wires/PerLengthPhaseImpedance.py create mode 100644 CIM14/CDPSM/Asset/IEC61970/Wires/PerLengthSequenceImpedance.py create mode 100644 CIM14/CDPSM/Asset/IEC61970/Wires/TransformerCoreAdmittance.py create mode 100644 CIM14/CDPSM/Asset/IEC61970/Wires/TransformerEnd.py create mode 100644 CIM14/CDPSM/Asset/IEC61970/Wires/TransformerStarImpedance.py create mode 100644 CIM14/CDPSM/Asset/IEC61970/Wires/TransformerTank.py create mode 100644 CIM14/CDPSM/Asset/IEC61970/Wires/TransformerTankEnd.py create mode 100644 CIM14/CDPSM/Asset/IEC61970/Wires/__init__.py create mode 100644 CIM14/CDPSM/Asset/IEC61970/__init__.py create mode 100644 CIM14/CDPSM/Asset/__init__.py create mode 100644 CIM14/CDPSM/Connectivity/Element.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/BaseVoltage.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/Bay.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/ConductingEquipment.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/ConnectivityNode.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/ConnectivityNodeContainer.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/Equipment.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/EquipmentContainer.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/GeographicalRegion.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/IdentifiedObject.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/Name.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/NameType.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/NameTypeAuthority.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/PSRType.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/PowerSystemResource.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/SubGeographicalRegion.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/Substation.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/Terminal.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/VoltageLevel.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Core/__init__.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/ACLineSegment.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/Breaker.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/BusbarSection.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/Conductor.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/DCLineSegment.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/Disconnector.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/EnergyConsumer.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/EnergySource.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/Fuse.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/Ground.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/GroundDisconnector.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/Jumper.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/Junction.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/Line.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/LoadBreakSwitch.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/PowerTransformer.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/PowerTransformerEnd.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/Sectionaliser.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/SeriesCompensator.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/ShuntCompensator.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/Switch.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/SynchronousMachine.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/TransformerEnd.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/TransformerTank.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/TransformerTankEnd.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/Wires/__init__.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/WiresPhaseModel/ShuntCompensatorPhase.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/WiresPhaseModel/SwitchPhase.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/WiresPhaseModel/__init__.py create mode 100644 CIM14/CDPSM/Connectivity/IEC61970/__init__.py create mode 100644 CIM14/CDPSM/Connectivity/__init__.py create mode 100755 CIM16/IEC61970/Base/Core/BasePower.py create mode 100755 CIM16/IEC61970/Base/Core/BaseVoltage.py create mode 100755 CIM16/IEC61970/Base/Core/BasicIntervalSchedule.py create mode 100755 CIM16/IEC61970/Base/Core/Bay.py create mode 100755 CIM16/IEC61970/Base/Core/ConductingEquipment.py create mode 100755 CIM16/IEC61970/Base/Core/ConnectivityNode.py create mode 100755 CIM16/IEC61970/Base/Core/ConnectivityNodeContainer.py create mode 100755 CIM16/IEC61970/Base/Core/Curve.py create mode 100755 CIM16/IEC61970/Base/Core/CurveData.py create mode 100755 CIM16/IEC61970/Base/Core/Equipment.py create mode 100755 CIM16/IEC61970/Base/Core/EquipmentContainer.py create mode 100755 CIM16/IEC61970/Base/Core/GeographicalRegion.py create mode 100755 CIM16/IEC61970/Base/Core/IdentifiedObject.py create mode 100755 CIM16/IEC61970/Base/Core/IrregularIntervalSchedule.py create mode 100755 CIM16/IEC61970/Base/Core/IrregularTimePoint.py create mode 100755 CIM16/IEC61970/Base/Core/Name.py create mode 100755 CIM16/IEC61970/Base/Core/NameType.py create mode 100755 CIM16/IEC61970/Base/Core/NameTypeAuthority.py create mode 100755 CIM16/IEC61970/Base/Core/OperatingParticipant.py create mode 100755 CIM16/IEC61970/Base/Core/OperatingShare.py create mode 100755 CIM16/IEC61970/Base/Core/PSRType.py create mode 100755 CIM16/IEC61970/Base/Core/PowerSystemResource.py create mode 100755 CIM16/IEC61970/Base/Core/PsrList.py create mode 100755 CIM16/IEC61970/Base/Core/RegularIntervalSchedule.py create mode 100755 CIM16/IEC61970/Base/Core/RegularTimePoint.py create mode 100755 CIM16/IEC61970/Base/Core/ReportingGroup.py create mode 100755 CIM16/IEC61970/Base/Core/ReportingSuperGroup.py create mode 100755 CIM16/IEC61970/Base/Core/SubGeographicalRegion.py create mode 100755 CIM16/IEC61970/Base/Core/Substation.py create mode 100755 CIM16/IEC61970/Base/Core/Terminal.py create mode 100755 CIM16/IEC61970/Base/Core/VoltageLevel.py create mode 100755 CIM16/IEC61970/Base/Core/__init__.py create mode 100755 CIM16/IEC61970/Base/Meas/Analog.py create mode 100755 CIM16/IEC61970/Base/Meas/AnalogLimit.py create mode 100755 CIM16/IEC61970/Base/Meas/AnalogLimitSet.py create mode 100755 CIM16/IEC61970/Base/Meas/AnalogValue.py create mode 100755 CIM16/IEC61970/Base/Meas/Measurement.py create mode 100755 CIM16/IEC61970/Base/Meas/MeasurementValue.py create mode 100644 CIM16/IEC61970/Base/Meas/__init__.py create mode 100644 CIM16/IEC61970/Base/__init__.py create mode 100644 PyCIM/Test/CIM16Test.py create mode 100644 PyCIM/Test/RedREE_RDFXMLReader_TestCIM14.py create mode 100644 PyCIM/Test/RedREE_RDFXMLReader_TestCIM16.py create mode 100644 setup15.py diff --git a/.gitignore b/.gitignore index 7bdc41f6..1c527021 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ PyCIM.egg-info/ doc/api/ doc/_build/* PyCIM/Test/Data/Confidential/ + +\.idea/ diff --git a/CIM14/CDPSM/Asset/Element.py b/CIM14/CDPSM/Asset/Element.py new file mode 100644 index 00000000..fddaa815 --- /dev/null +++ b/CIM14/CDPSM/Asset/Element.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class Element(object): + + def __init__(self, UUID=''): + """Initialises a new 'Element' instance. + + @param UUID: + """ + + self.UUID = UUID + + + _attrs = ["UUID"] + _attr_types = {"UUID": str} + _defaults = {"UUID": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Asset/IEC61968/AssetModels/CableInfo.py b/CIM14/CDPSM/Asset/IEC61968/AssetModels/CableInfo.py new file mode 100644 index 00000000..7726b17f --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/AssetModels/CableInfo.py @@ -0,0 +1,79 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61968.AssetModels.ConductorInfo import ConductorInfo + +class CableInfo(ConductorInfo): + """Cable data. + """ + + def __init__(self, diameterOverJacket=0.0, constructionKind="sector", shieldMaterial="lead", outerJacketKind="pvc", isStrandFill=False, diameterOverInsulation=0.0, diameterOverScreen=0.0, sheathAsNeutral=False, nominalTemperature=0.0, diameterOverCore=0.0, *args, **kw_args): + """Initialises a new 'CableInfo' instance. + + @param diameterOverJacket: Diameter over the outermost jacketing layer. + @param constructionKind: Kind of construction of this cable. Values are: "sector", "other", "solid", "compacted", "stranded", "segmental", "compressed" + @param shieldMaterial: Material of the shield. Values are: "lead", "aluminum", "other", "copper", "steel" + @param outerJacketKind: Kind of outer jacket of this cable. Values are: "pvc", "linearLowDensityPolyethylene", "none", "insulating", "other", "polyethylene", "semiconducting" + @param isStrandFill: True if wire strands are extruded in a way to fill the voids in the cable. + @param diameterOverInsulation: Diameter over the insulating layer, excluding outer screen. + @param diameterOverScreen: Diameter over the outer screen; should be the shield's inside diameter.. + @param sheathAsNeutral: True if sheath / shield is used as a neutral (i.e., bonded). + @param nominalTemperature: Maximum nominal design operating temperature. + @param diameterOverCore: Diameter over the core, including any semi-con screen; should be the insulating layer's inside diameter. + """ + #: Diameter over the outermost jacketing layer. + self.diameterOverJacket = diameterOverJacket + + #: Kind of construction of this cable. Values are: "sector", "other", "solid", "compacted", "stranded", "segmental", "compressed" + self.constructionKind = constructionKind + + #: Material of the shield. Values are: "lead", "aluminum", "other", "copper", "steel" + self.shieldMaterial = shieldMaterial + + #: Kind of outer jacket of this cable. Values are: "pvc", "linearLowDensityPolyethylene", "none", "insulating", "other", "polyethylene", "semiconducting" + self.outerJacketKind = outerJacketKind + + #: True if wire strands are extruded in a way to fill the voids in the cable. + self.isStrandFill = isStrandFill + + #: Diameter over the insulating layer, excluding outer screen. + self.diameterOverInsulation = diameterOverInsulation + + #: Diameter over the outer screen; should be the shield's inside diameter.. + self.diameterOverScreen = diameterOverScreen + + #: True if sheath / shield is used as a neutral (i.e., bonded). + self.sheathAsNeutral = sheathAsNeutral + + #: Maximum nominal design operating temperature. + self.nominalTemperature = nominalTemperature + + #: Diameter over the core, including any semi-con screen; should be the insulating layer's inside diameter. + self.diameterOverCore = diameterOverCore + + super(CableInfo, self).__init__(*args, **kw_args) + + _attrs = ["diameterOverJacket", "constructionKind", "shieldMaterial", "outerJacketKind", "isStrandFill", "diameterOverInsulation", "diameterOverScreen", "sheathAsNeutral", "nominalTemperature", "diameterOverCore"] + _attr_types = {"diameterOverJacket": float, "constructionKind": str, "shieldMaterial": str, "outerJacketKind": str, "isStrandFill": bool, "diameterOverInsulation": float, "diameterOverScreen": float, "sheathAsNeutral": bool, "nominalTemperature": float, "diameterOverCore": float} + _defaults = {"diameterOverJacket": 0.0, "constructionKind": "sector", "shieldMaterial": "lead", "outerJacketKind": "pvc", "isStrandFill": False, "diameterOverInsulation": 0.0, "diameterOverScreen": 0.0, "sheathAsNeutral": False, "nominalTemperature": 0.0, "diameterOverCore": 0.0} + _enums = {"constructionKind": "CableConstructionKind", "shieldMaterial": "CableShieldMaterialKind", "outerJacketKind": "CableOuterJacketKind"} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Asset/IEC61968/AssetModels/ConcentricNeutralCableInfo.py b/CIM14/CDPSM/Asset/IEC61968/AssetModels/ConcentricNeutralCableInfo.py new file mode 100644 index 00000000..c85b56e1 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/AssetModels/ConcentricNeutralCableInfo.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61968.AssetModels.CableInfo import CableInfo + +class ConcentricNeutralCableInfo(CableInfo): + """Concentric neutral cable data. + """ + + def __init__(self, diameterOverNeutral=0.0, neutralStrandCount=0, *args, **kw_args): + """Initialises a new 'ConcentricNeutralCableInfo' instance. + + @param diameterOverNeutral: Diameter over the concentric neutral strands. + @param neutralStrandCount: Number of concentric neutral strands. + """ + #: Diameter over the concentric neutral strands. + self.diameterOverNeutral = diameterOverNeutral + + #: Number of concentric neutral strands. + self.neutralStrandCount = neutralStrandCount + + super(ConcentricNeutralCableInfo, self).__init__(*args, **kw_args) + + _attrs = ["diameterOverNeutral", "neutralStrandCount"] + _attr_types = {"diameterOverNeutral": float, "neutralStrandCount": int} + _defaults = {"diameterOverNeutral": 0.0, "neutralStrandCount": 0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Asset/IEC61968/AssetModels/ConductorInfo.py b/CIM14/CDPSM/Asset/IEC61968/AssetModels/ConductorInfo.py new file mode 100644 index 00000000..56f8957e --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/AssetModels/ConductorInfo.py @@ -0,0 +1,111 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo + +class ConductorInfo(AssetInfo): + """Conductor data. + """ + + def __init__(self, usage="secondary", insulationThickness=0.0, insulated=False, insulationMaterial="treeRetardantCrosslinkedPolyethylene", phaseCount=0, WireArrangements=None, LineSegments=None, *args, **kw_args): + """Initialises a new 'ConductorInfo' instance. + + @param usage: Usage of this conductor. Values are: "secondary", "other", "distribution", "transmission" + @param insulationThickness: (if insulated conductor) Thickness of the insulation. + @param insulated: True if conductor is insulated. + @param insulationMaterial: (if insulated conductor) Material used for insulation. Values are: "treeRetardantCrosslinkedPolyethylene", "butyl", "highPressureFluidFilled", "other", "varnishedCambricCloth", "siliconRubber", "beltedPilc", "crosslinkedPolyethylene", "oilPaper", "lowCapacitanceRubber", "asbestosAndVarnishedCambric", "treeResistantHighMolecularWeightPolyethylene", "unbeltedPilc", "ozoneResistantRubber", "ethylenePropyleneRubber", "highMolecularWeightPolyethylene", "varnishedDacronGlass", "rubber" + @param phaseCount: Number of phases (including neutral) to be retained. Any wires beyond this number should be reduced into the earth return. + @param WireArrangements: All wire arrangements (single wires) that make this conductor. + @param LineSegments: All line segments described by this conductor data. + """ + #: Usage of this conductor. Values are: "secondary", "other", "distribution", "transmission" + self.usage = usage + + #: (if insulated conductor) Thickness of the insulation. + self.insulationThickness = insulationThickness + + #: True if conductor is insulated. + self.insulated = insulated + + #: (if insulated conductor) Material used for insulation. Values are: "treeRetardantCrosslinkedPolyethylene", "butyl", "highPressureFluidFilled", "other", "varnishedCambricCloth", "siliconRubber", "beltedPilc", "crosslinkedPolyethylene", "oilPaper", "lowCapacitanceRubber", "asbestosAndVarnishedCambric", "treeResistantHighMolecularWeightPolyethylene", "unbeltedPilc", "ozoneResistantRubber", "ethylenePropyleneRubber", "highMolecularWeightPolyethylene", "varnishedDacronGlass", "rubber" + self.insulationMaterial = insulationMaterial + + #: Number of phases (including neutral) to be retained. Any wires beyond this number should be reduced into the earth return. + self.phaseCount = phaseCount + + self._WireArrangements = [] + self.WireArrangements = [] if WireArrangements is None else WireArrangements + + self._LineSegments = [] + self.LineSegments = [] if LineSegments is None else LineSegments + + super(ConductorInfo, self).__init__(*args, **kw_args) + + _attrs = ["usage", "insulationThickness", "insulated", "insulationMaterial", "phaseCount"] + _attr_types = {"usage": str, "insulationThickness": float, "insulated": bool, "insulationMaterial": str, "phaseCount": int} + _defaults = {"usage": "secondary", "insulationThickness": 0.0, "insulated": False, "insulationMaterial": "treeRetardantCrosslinkedPolyethylene", "phaseCount": 0} + _enums = {"usage": "ConductorUsageKind", "insulationMaterial": "ConductorInsulationKind"} + _refs = ["WireArrangements", "LineSegments"] + _many_refs = ["WireArrangements", "LineSegments"] + + def getWireArrangements(self): + """All wire arrangements (single wires) that make this conductor. + """ + return self._WireArrangements + + def setWireArrangements(self, value): + for x in self._WireArrangements: + x.ConductorInfo = None + for y in value: + y._ConductorInfo = self + self._WireArrangements = value + + WireArrangements = property(getWireArrangements, setWireArrangements) + + def addWireArrangements(self, *WireArrangements): + for obj in WireArrangements: + obj.ConductorInfo = self + + def removeWireArrangements(self, *WireArrangements): + for obj in WireArrangements: + obj.ConductorInfo = None + + def getLineSegments(self): + """All line segments described by this conductor data. + """ + return self._LineSegments + + def setLineSegments(self, value): + for x in self._LineSegments: + x.ConductorInfo = None + for y in value: + y._ConductorInfo = self + self._LineSegments = value + + LineSegments = property(getLineSegments, setLineSegments) + + def addLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.ConductorInfo = self + + def removeLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.ConductorInfo = None + diff --git a/CIM14/CDPSM/Asset/IEC61968/AssetModels/EndDeviceInfo.py b/CIM14/CDPSM/Asset/IEC61968/AssetModels/EndDeviceInfo.py new file mode 100644 index 00000000..c6cb1dd2 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/AssetModels/EndDeviceInfo.py @@ -0,0 +1,51 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo + +class EndDeviceInfo(AssetInfo): + """End device data. + """ + + def __init__(self, ratedCurrent=0.0, ratedVoltage=0.0, phaseCount=0, *args, **kw_args): + """Initialises a new 'EndDeviceInfo' instance. + + @param ratedCurrent: Rated current. + @param ratedVoltage: Rated voltage. + @param phaseCount: Number of potential phases the end device supports, typically 0, 1 or 3. + """ + #: Rated current. + self.ratedCurrent = ratedCurrent + + #: Rated voltage. + self.ratedVoltage = ratedVoltage + + #: Number of potential phases the end device supports, typically 0, 1 or 3. + self.phaseCount = phaseCount + + super(EndDeviceInfo, self).__init__(*args, **kw_args) + + _attrs = ["ratedCurrent", "ratedVoltage", "phaseCount"] + _attr_types = {"ratedCurrent": float, "ratedVoltage": float, "phaseCount": int} + _defaults = {"ratedCurrent": 0.0, "ratedVoltage": 0.0, "phaseCount": 0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Asset/IEC61968/AssetModels/OverheadConductorInfo.py b/CIM14/CDPSM/Asset/IEC61968/AssetModels/OverheadConductorInfo.py new file mode 100644 index 00000000..acfe45af --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/AssetModels/OverheadConductorInfo.py @@ -0,0 +1,51 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61968.AssetModels.ConductorInfo import ConductorInfo + +class OverheadConductorInfo(ConductorInfo): + """Overhead conductor data. + """ + + def __init__(self, neutralInsulationThickness=0.0, phaseConductorSpacing=0.0, phaseConductorCount=0, *args, **kw_args): + """Initialises a new 'OverheadConductorInfo' instance. + + @param neutralInsulationThickness: (if applicable) Insulation thickness of the neutral conductor. + @param phaseConductorSpacing: Distance between conductor strands in a symmetrical bundle. + @param phaseConductorCount: Number of conductor strands in the symmetrical bundle (1-12). + """ + #: (if applicable) Insulation thickness of the neutral conductor. + self.neutralInsulationThickness = neutralInsulationThickness + + #: Distance between conductor strands in a symmetrical bundle. + self.phaseConductorSpacing = phaseConductorSpacing + + #: Number of conductor strands in the symmetrical bundle (1-12). + self.phaseConductorCount = phaseConductorCount + + super(OverheadConductorInfo, self).__init__(*args, **kw_args) + + _attrs = ["neutralInsulationThickness", "phaseConductorSpacing", "phaseConductorCount"] + _attr_types = {"neutralInsulationThickness": float, "phaseConductorSpacing": float, "phaseConductorCount": int} + _defaults = {"neutralInsulationThickness": 0.0, "phaseConductorSpacing": 0.0, "phaseConductorCount": 0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Asset/IEC61968/AssetModels/PowerTransformerInfo.py b/CIM14/CDPSM/Asset/IEC61968/AssetModels/PowerTransformerInfo.py new file mode 100644 index 00000000..e7e8cf4d --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/AssetModels/PowerTransformerInfo.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo + +class PowerTransformerInfo(AssetInfo): + """Set of power transformer data, from an equipment library. + """ + + def __init__(self, TransformerTankInfo=None, *args, **kw_args): + """Initialises a new 'PowerTransformerInfo' instance. + + @param TransformerTankInfo: Data for all the tanks described by this power transformer data. + """ + self._TransformerTankInfo = [] + self.TransformerTankInfo = [] if TransformerTankInfo is None else TransformerTankInfo + + super(PowerTransformerInfo, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TransformerTankInfo"] + _many_refs = ["TransformerTankInfo"] + + def getTransformerTankInfo(self): + """Data for all the tanks described by this power transformer data. + """ + return self._TransformerTankInfo + + def setTransformerTankInfo(self, value): + for x in self._TransformerTankInfo: + x.PowerTransformerInfo = None + for y in value: + y._PowerTransformerInfo = self + self._TransformerTankInfo = value + + TransformerTankInfo = property(getTransformerTankInfo, setTransformerTankInfo) + + def addTransformerTankInfo(self, *TransformerTankInfo): + for obj in TransformerTankInfo: + obj.PowerTransformerInfo = self + + def removeTransformerTankInfo(self, *TransformerTankInfo): + for obj in TransformerTankInfo: + obj.PowerTransformerInfo = None + diff --git a/CIM14/CDPSM/Asset/IEC61968/AssetModels/TapChangerInfo.py b/CIM14/CDPSM/Asset/IEC61968/AssetModels/TapChangerInfo.py new file mode 100644 index 00000000..d9151447 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/AssetModels/TapChangerInfo.py @@ -0,0 +1,95 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo + +class TapChangerInfo(AssetInfo): + """Tap changer data. + """ + + def __init__(self, lowStep=0, frequency=0.0, ptRatio=0.0, ratedApparentPower=0.0, stepVoltageIncrement=0.0, ctRatio=0.0, ratedVoltage=0.0, neutralStep=0, ratedCurrent=0.0, ctRating=0.0, highStep=0, stepPhaseIncrement=0.0, neutralU=0.0, isTcul=False, *args, **kw_args): + """Initialises a new 'TapChangerInfo' instance. + + @param lowStep: Lowest possible tap step position, retard from neutral. + @param frequency: Frequency at which the ratings apply. + @param ptRatio: Built-in voltage transducer ratio. + @param ratedApparentPower: Rated apparent power. + @param stepVoltageIncrement: Tap step increment, in per cent of rated voltage, per step position. + @param ctRatio: Built-in current transducer ratio. + @param ratedVoltage: Rated voltage. + @param neutralStep: The neutral tap step position for the winding. + @param ratedCurrent: Rated current. + @param ctRating: Built-in current transformer primary rating. + @param highStep: Highest possible tap step position, advance from neutral. + @param stepPhaseIncrement: Phase shift per step position. + @param neutralU: Voltage at which the winding operates at the neutral tap setting. + @param isTcul: Whether this tap changer has under load tap changing capabilities. + """ + #: Lowest possible tap step position, retard from neutral. + self.lowStep = lowStep + + #: Frequency at which the ratings apply. + self.frequency = frequency + + #: Built-in voltage transducer ratio. + self.ptRatio = ptRatio + + #: Rated apparent power. + self.ratedApparentPower = ratedApparentPower + + #: Tap step increment, in per cent of rated voltage, per step position. + self.stepVoltageIncrement = stepVoltageIncrement + + #: Built-in current transducer ratio. + self.ctRatio = ctRatio + + #: Rated voltage. + self.ratedVoltage = ratedVoltage + + #: The neutral tap step position for the winding. + self.neutralStep = neutralStep + + #: Rated current. + self.ratedCurrent = ratedCurrent + + #: Built-in current transformer primary rating. + self.ctRating = ctRating + + #: Highest possible tap step position, advance from neutral. + self.highStep = highStep + + #: Phase shift per step position. + self.stepPhaseIncrement = stepPhaseIncrement + + #: Voltage at which the winding operates at the neutral tap setting. + self.neutralU = neutralU + + #: Whether this tap changer has under load tap changing capabilities. + self.isTcul = isTcul + + super(TapChangerInfo, self).__init__(*args, **kw_args) + + _attrs = ["lowStep", "frequency", "ptRatio", "ratedApparentPower", "stepVoltageIncrement", "ctRatio", "ratedVoltage", "neutralStep", "ratedCurrent", "ctRating", "highStep", "stepPhaseIncrement", "neutralU", "isTcul"] + _attr_types = {"lowStep": int, "frequency": float, "ptRatio": float, "ratedApparentPower": float, "stepVoltageIncrement": float, "ctRatio": float, "ratedVoltage": float, "neutralStep": int, "ratedCurrent": float, "ctRating": float, "highStep": int, "stepPhaseIncrement": float, "neutralU": float, "isTcul": bool} + _defaults = {"lowStep": 0, "frequency": 0.0, "ptRatio": 0.0, "ratedApparentPower": 0.0, "stepVoltageIncrement": 0.0, "ctRatio": 0.0, "ratedVoltage": 0.0, "neutralStep": 0, "ratedCurrent": 0.0, "ctRating": 0.0, "highStep": 0, "stepPhaseIncrement": 0.0, "neutralU": 0.0, "isTcul": False} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Asset/IEC61968/AssetModels/TapeShieldCableInfo.py b/CIM14/CDPSM/Asset/IEC61968/AssetModels/TapeShieldCableInfo.py new file mode 100644 index 00000000..1fc6662b --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/AssetModels/TapeShieldCableInfo.py @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61968.AssetModels.CableInfo import CableInfo + +class TapeShieldCableInfo(CableInfo): + """Tape shield cable data. + """ + + def __init__(self, tapeLap=0.0, tapeThickness=0.0, *args, **kw_args): + """Initialises a new 'TapeShieldCableInfo' instance. + + @param tapeLap: Percentage of the tape shield width that overlaps in each wrap, typically 10% to 25%. + @param tapeThickness: Thickness of the tape shield, before wrapping. + """ + #: Percentage of the tape shield width that overlaps in each wrap, typically 10% to 25%. + self.tapeLap = tapeLap + + #: Thickness of the tape shield, before wrapping. + self.tapeThickness = tapeThickness + + super(TapeShieldCableInfo, self).__init__(*args, **kw_args) + + _attrs = ["tapeLap", "tapeThickness"] + _attr_types = {"tapeLap": float, "tapeThickness": float} + _defaults = {"tapeLap": 0.0, "tapeThickness": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Asset/IEC61968/AssetModels/TransformerEndInfo.py b/CIM14/CDPSM/Asset/IEC61968/AssetModels/TransformerEndInfo.py new file mode 100644 index 00000000..2e827512 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/AssetModels/TransformerEndInfo.py @@ -0,0 +1,122 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo + +class TransformerEndInfo(AssetInfo): + """Transformer end data. + """ + + def __init__(self, ratedU=0.0, endNumber=0, phaseAngleClock=0, emergencyS=0.0, ratedS=0.0, shortTermS=0.0, r=0.0, insulationU=0.0, connectionKind="Z", TransformerTankInfo=None, TransformerEnd=None, *args, **kw_args): + """Initialises a new 'TransformerEndInfo' instance. + + @param ratedU: Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings. + @param endNumber: Number for this transformer end, corresponding to the end's order in the PowerTransformer.vectorGroup attribute. Highest voltage winding should be 1. + @param phaseAngleClock: Winding phase angle where 360 degrees are represented with clock hours, so the valid values are {0, ..., 11}. For example, to express winding code 'Dyn11', set attributes as follows: 'connectionKind' = Yn and 'phaseAngleClock' = 11. + @param emergencyS: Apparent power that the winding can carry under emergency conditions (also called long-term emergency power). + @param ratedS: Normal apparent power rating. + @param shortTermS: Apparent power that this winding can carry for a short period of time (in emergency). + @param r: DC resistance. + @param insulationU: Basic insulation level voltage rating. + @param connectionKind: Kind of connection. Values are: "Z", "A", "Yn", "Y", "Zn", "D", "I" + @param TransformerTankInfo: Transformer tank data that this end description is part of. + @param TransformerEnd: All transformer ends described by this end data. + """ + #: Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings. + self.ratedU = ratedU + + #: Number for this transformer end, corresponding to the end's order in the PowerTransformer.vectorGroup attribute. Highest voltage winding should be 1. + self.endNumber = endNumber + + #: Winding phase angle where 360 degrees are represented with clock hours, so the valid values are {0, ..., 11}. For example, to express winding code 'Dyn11', set attributes as follows: 'connectionKind' = Yn and 'phaseAngleClock' = 11. + self.phaseAngleClock = phaseAngleClock + + #: Apparent power that the winding can carry under emergency conditions (also called long-term emergency power). + self.emergencyS = emergencyS + + #: Normal apparent power rating. + self.ratedS = ratedS + + #: Apparent power that this winding can carry for a short period of time (in emergency). + self.shortTermS = shortTermS + + #: DC resistance. + self.r = r + + #: Basic insulation level voltage rating. + self.insulationU = insulationU + + #: Kind of connection. Values are: "Z", "A", "Yn", "Y", "Zn", "D", "I" + self.connectionKind = connectionKind + + self._TransformerTankInfo = None + self.TransformerTankInfo = TransformerTankInfo + + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + super(TransformerEndInfo, self).__init__(*args, **kw_args) + + _attrs = ["ratedU", "endNumber", "phaseAngleClock", "emergencyS", "ratedS", "shortTermS", "r", "insulationU", "connectionKind"] + _attr_types = {"ratedU": float, "endNumber": int, "phaseAngleClock": int, "emergencyS": float, "ratedS": float, "shortTermS": float, "r": float, "insulationU": float, "connectionKind": str} + _defaults = {"ratedU": 0.0, "endNumber": 0, "phaseAngleClock": 0, "emergencyS": 0.0, "ratedS": 0.0, "shortTermS": 0.0, "r": 0.0, "insulationU": 0.0, "connectionKind": "Z"} + _enums = {"connectionKind": "WindingConnection"} + _refs = ["TransformerTankInfo", "TransformerEnd"] + _many_refs = ["TransformerEnd"] + + def getTransformerTankInfo(self): + """Transformer tank data that this end description is part of. + """ + return self._TransformerTankInfo + + def setTransformerTankInfo(self, value): + if self._TransformerTankInfo is not None: + filtered = [x for x in self.TransformerTankInfo.TransformerEndInfos if x != self] + self._TransformerTankInfo._TransformerEndInfos = filtered + + self._TransformerTankInfo = value + if self._TransformerTankInfo is not None: + if self not in self._TransformerTankInfo._TransformerEndInfos: + self._TransformerTankInfo._TransformerEndInfos.append(self) + + TransformerTankInfo = property(getTransformerTankInfo, setTransformerTankInfo) + + def getTransformerEnd(self): + """All transformer ends described by this end data. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.TransformerEndInfo = None + for y in value: + y._TransformerEndInfo = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.TransformerEndInfo = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.TransformerEndInfo = None + diff --git a/CIM14/CDPSM/Asset/IEC61968/AssetModels/TransformerTankInfo.py b/CIM14/CDPSM/Asset/IEC61968/AssetModels/TransformerTankInfo.py new file mode 100644 index 00000000..ca3caae3 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/AssetModels/TransformerTankInfo.py @@ -0,0 +1,112 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo + +class TransformerTankInfo(AssetInfo): + """Set of transformer tank data, from an equipment library. + """ + + def __init__(self, PowerTransformerInfo=None, TransformerEndInfos=None, TransformerTanks=None, *args, **kw_args): + """Initialises a new 'TransformerTankInfo' instance. + + @param PowerTransformerInfo: Power transformer data that this tank description is part of. + @param TransformerEndInfos: Data for all the ends described by this transformer tank data. + @param TransformerTanks: All transformer tanks that can be described with this transformer tank data. + """ + self._PowerTransformerInfo = None + self.PowerTransformerInfo = PowerTransformerInfo + + self._TransformerEndInfos = [] + self.TransformerEndInfos = [] if TransformerEndInfos is None else TransformerEndInfos + + self._TransformerTanks = [] + self.TransformerTanks = [] if TransformerTanks is None else TransformerTanks + + super(TransformerTankInfo, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["PowerTransformerInfo", "TransformerEndInfos", "TransformerTanks"] + _many_refs = ["TransformerEndInfos", "TransformerTanks"] + + def getPowerTransformerInfo(self): + """Power transformer data that this tank description is part of. + """ + return self._PowerTransformerInfo + + def setPowerTransformerInfo(self, value): + if self._PowerTransformerInfo is not None: + filtered = [x for x in self.PowerTransformerInfo.TransformerTankInfo if x != self] + self._PowerTransformerInfo._TransformerTankInfo = filtered + + self._PowerTransformerInfo = value + if self._PowerTransformerInfo is not None: + if self not in self._PowerTransformerInfo._TransformerTankInfo: + self._PowerTransformerInfo._TransformerTankInfo.append(self) + + PowerTransformerInfo = property(getPowerTransformerInfo, setPowerTransformerInfo) + + def getTransformerEndInfos(self): + """Data for all the ends described by this transformer tank data. + """ + return self._TransformerEndInfos + + def setTransformerEndInfos(self, value): + for x in self._TransformerEndInfos: + x.TransformerTankInfo = None + for y in value: + y._TransformerTankInfo = self + self._TransformerEndInfos = value + + TransformerEndInfos = property(getTransformerEndInfos, setTransformerEndInfos) + + def addTransformerEndInfos(self, *TransformerEndInfos): + for obj in TransformerEndInfos: + obj.TransformerTankInfo = self + + def removeTransformerEndInfos(self, *TransformerEndInfos): + for obj in TransformerEndInfos: + obj.TransformerTankInfo = None + + def getTransformerTanks(self): + """All transformer tanks that can be described with this transformer tank data. + """ + return self._TransformerTanks + + def setTransformerTanks(self, value): + for x in self._TransformerTanks: + x.TransformerTankInfo = None + for y in value: + y._TransformerTankInfo = self + self._TransformerTanks = value + + TransformerTanks = property(getTransformerTanks, setTransformerTanks) + + def addTransformerTanks(self, *TransformerTanks): + for obj in TransformerTanks: + obj.TransformerTankInfo = self + + def removeTransformerTanks(self, *TransformerTanks): + for obj in TransformerTanks: + obj.TransformerTankInfo = None + diff --git a/CIM14/CDPSM/Asset/IEC61968/AssetModels/WireArrangement.py b/CIM14/CDPSM/Asset/IEC61968/AssetModels/WireArrangement.py new file mode 100644 index 00000000..caabaa5b --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/AssetModels/WireArrangement.py @@ -0,0 +1,93 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class WireArrangement(IdentifiedObject): + """Identification, spacing and configuration of the wires of a conductor, with reference to their type. + """ + + def __init__(self, mountingPointY=0.0, position=0, mountingPointX=0.0, WireType=None, ConductorInfo=None, *args, **kw_args): + """Initialises a new 'WireArrangement' instance. + + @param mountingPointY: Height above ground of the first wire. + @param position: Position number on the structure corresponding to this wire. For example, use 1..3 for phases and 4 for the neutral on a 3-phase structure. The individual phase assignments matter; for example, ABC will produce a different set of unbalanced line parameters, by phase, than BAC. + @param mountingPointX: Signed horizontal distance from the first wire to a common reference point. + @param WireType: Wire type used for this wire arrangement. + @param ConductorInfo: Conductor data this wire arrangement belongs to. + """ + #: Height above ground of the first wire. + self.mountingPointY = mountingPointY + + #: Position number on the structure corresponding to this wire. For example, use 1..3 for phases and 4 for the neutral on a 3-phase structure. The individual phase assignments matter; for example, ABC will produce a different set of unbalanced line parameters, by phase, than BAC. + self.position = position + + #: Signed horizontal distance from the first wire to a common reference point. + self.mountingPointX = mountingPointX + + self._WireType = None + self.WireType = WireType + + self._ConductorInfo = None + self.ConductorInfo = ConductorInfo + + super(WireArrangement, self).__init__(*args, **kw_args) + + _attrs = ["mountingPointY", "position", "mountingPointX"] + _attr_types = {"mountingPointY": float, "position": int, "mountingPointX": float} + _defaults = {"mountingPointY": 0.0, "position": 0, "mountingPointX": 0.0} + _enums = {} + _refs = ["WireType", "ConductorInfo"] + _many_refs = [] + + def getWireType(self): + """Wire type used for this wire arrangement. + """ + return self._WireType + + def setWireType(self, value): + if self._WireType is not None: + filtered = [x for x in self.WireType.WireArrangements if x != self] + self._WireType._WireArrangements = filtered + + self._WireType = value + if self._WireType is not None: + if self not in self._WireType._WireArrangements: + self._WireType._WireArrangements.append(self) + + WireType = property(getWireType, setWireType) + + def getConductorInfo(self): + """Conductor data this wire arrangement belongs to. + """ + return self._ConductorInfo + + def setConductorInfo(self, value): + if self._ConductorInfo is not None: + filtered = [x for x in self.ConductorInfo.WireArrangements if x != self] + self._ConductorInfo._WireArrangements = filtered + + self._ConductorInfo = value + if self._ConductorInfo is not None: + if self not in self._ConductorInfo._WireArrangements: + self._ConductorInfo._WireArrangements.append(self) + + ConductorInfo = property(getConductorInfo, setConductorInfo) + diff --git a/CIM14/CDPSM/Asset/IEC61968/AssetModels/WireType.py b/CIM14/CDPSM/Asset/IEC61968/AssetModels/WireType.py new file mode 100644 index 00000000..bcf59b5e --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/AssetModels/WireType.py @@ -0,0 +1,113 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class WireType(IdentifiedObject): + """Wire conductor (per IEEE specs). A specific type of wire or combination of wires, not insulated from each other, suitable for carrying electrical current. + """ + + def __init__(self, rDC20=0.0, coreRadius=0.0, rAC75=0.0, material="aluminum", ratedCurrent=0.0, strandCount=0, rAC25=0.0, rAC50=0.0, radius=0.0, gmr=0.0, coreStrandCount=0, sizeDescription='', WireArrangements=None, *args, **kw_args): + """Initialises a new 'WireType' instance. + + @param rDC20: DC resistance per unit length of the conductor at 20 oC. + @param coreRadius: (if there is a different core material) Radius of the central core. + @param rAC75: AC resistance per unit length of the conductor at 75 oC. + @param material: Wire material. Values are: "aluminum", "copper", "other", "steel", "acsr" + @param ratedCurrent: Current carrying capacity of the wire under stated thermal conditions. + @param strandCount: Number of strands in the wire. + @param rAC25: AC resistance per unit length of the conductor at 25 oC. + @param rAC50: AC resistance per unit length of the conductor at 50 oC. + @param radius: Outside radius of the wire. + @param gmr: Geometric mean radius. If we replace the conductor by a thin walled tube of radius GMR, then its reactance is identical to the reactance of the actual conductor. + @param coreStrandCount: (if used) Number of strands in the steel core. + @param sizeDescription: Describes the wire guage or cross section (e.g., 4/0, #2, 336.5). + @param WireArrangements: All wire arrangements using this wire type. + """ + #: DC resistance per unit length of the conductor at 20 oC. + self.rDC20 = rDC20 + + #: (if there is a different core material) Radius of the central core. + self.coreRadius = coreRadius + + #: AC resistance per unit length of the conductor at 75 oC. + self.rAC75 = rAC75 + + #: Wire material. Values are: "aluminum", "copper", "other", "steel", "acsr" + self.material = material + + #: Current carrying capacity of the wire under stated thermal conditions. + self.ratedCurrent = ratedCurrent + + #: Number of strands in the wire. + self.strandCount = strandCount + + #: AC resistance per unit length of the conductor at 25 oC. + self.rAC25 = rAC25 + + #: AC resistance per unit length of the conductor at 50 oC. + self.rAC50 = rAC50 + + #: Outside radius of the wire. + self.radius = radius + + #: Geometric mean radius. If we replace the conductor by a thin walled tube of radius GMR, then its reactance is identical to the reactance of the actual conductor. + self.gmr = gmr + + #: (if used) Number of strands in the steel core. + self.coreStrandCount = coreStrandCount + + #: Describes the wire guage or cross section (e.g., 4/0, #2, 336.5). + self.sizeDescription = sizeDescription + + self._WireArrangements = [] + self.WireArrangements = [] if WireArrangements is None else WireArrangements + + super(WireType, self).__init__(*args, **kw_args) + + _attrs = ["rDC20", "coreRadius", "rAC75", "material", "ratedCurrent", "strandCount", "rAC25", "rAC50", "radius", "gmr", "coreStrandCount", "sizeDescription"] + _attr_types = {"rDC20": float, "coreRadius": float, "rAC75": float, "material": str, "ratedCurrent": float, "strandCount": int, "rAC25": float, "rAC50": float, "radius": float, "gmr": float, "coreStrandCount": int, "sizeDescription": str} + _defaults = {"rDC20": 0.0, "coreRadius": 0.0, "rAC75": 0.0, "material": "aluminum", "ratedCurrent": 0.0, "strandCount": 0, "rAC25": 0.0, "rAC50": 0.0, "radius": 0.0, "gmr": 0.0, "coreStrandCount": 0, "sizeDescription": ''} + _enums = {"material": "ConductorMaterialKind"} + _refs = ["WireArrangements"] + _many_refs = ["WireArrangements"] + + def getWireArrangements(self): + """All wire arrangements using this wire type. + """ + return self._WireArrangements + + def setWireArrangements(self, value): + for x in self._WireArrangements: + x.WireType = None + for y in value: + y._WireType = self + self._WireArrangements = value + + WireArrangements = property(getWireArrangements, setWireArrangements) + + def addWireArrangements(self, *WireArrangements): + for obj in WireArrangements: + obj.WireType = self + + def removeWireArrangements(self, *WireArrangements): + for obj in WireArrangements: + obj.WireType = None + diff --git a/CIM14/CDPSM/Asset/IEC61968/AssetModels/__init__.py b/CIM14/CDPSM/Asset/IEC61968/AssetModels/__init__.py new file mode 100644 index 00000000..6cb34560 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/AssetModels/__init__.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package is an extension of Assets package and contains the core information classes that support asset management and different network and work planning applications with specialized AssetInfo subclasses. They hold attributes that can be referenced by not only Asset-s or AssetModel-s but also by ConductingEquipment-s. +""" + +from CIM15.CDPSM.Asset.IEC61968.AssetModels.ConductorInfo import ConductorInfo +from CIM15.CDPSM.Asset.IEC61968.AssetModels.WireArrangement import WireArrangement +from CIM15.CDPSM.Asset.IEC61968.AssetModels.WireType import WireType +from CIM15.CDPSM.Asset.IEC61968.AssetModels.EndDeviceInfo import EndDeviceInfo +from CIM15.CDPSM.Asset.IEC61968.AssetModels.OverheadConductorInfo import OverheadConductorInfo +from CIM15.CDPSM.Asset.IEC61968.AssetModels.TapChangerInfo import TapChangerInfo +from CIM15.CDPSM.Asset.IEC61968.AssetModels.TransformerTankInfo import TransformerTankInfo +from CIM15.CDPSM.Asset.IEC61968.AssetModels.CableInfo import CableInfo +from CIM15.CDPSM.Asset.IEC61968.AssetModels.ConcentricNeutralCableInfo import ConcentricNeutralCableInfo +from CIM15.CDPSM.Asset.IEC61968.AssetModels.TapeShieldCableInfo import TapeShieldCableInfo +from CIM15.CDPSM.Asset.IEC61968.AssetModels.TransformerEndInfo import TransformerEndInfo +from CIM15.CDPSM.Asset.IEC61968.AssetModels.PowerTransformerInfo import PowerTransformerInfo + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM/Asset#AssetModels" +nsPrefix = "cimAssetModels" + + +class ConductorMaterialKind(str): + """Values are: aluminum, copper, other, steel, acsr + """ + pass + +class CableOuterJacketKind(str): + """Values are: pvc, linearLowDensityPolyethylene, none, insulating, other, polyethylene, semiconducting + """ + pass + +class ConductorUsageKind(str): + """Values are: secondary, other, distribution, transmission + """ + pass + +class CableConstructionKind(str): + """Values are: sector, other, solid, compacted, stranded, segmental, compressed + """ + pass + +class ConductorInsulationKind(str): + """Values are: treeRetardantCrosslinkedPolyethylene, butyl, highPressureFluidFilled, other, varnishedCambricCloth, siliconRubber, beltedPilc, crosslinkedPolyethylene, oilPaper, lowCapacitanceRubber, asbestosAndVarnishedCambric, treeResistantHighMolecularWeightPolyethylene, unbeltedPilc, ozoneResistantRubber, ethylenePropyleneRubber, highMolecularWeightPolyethylene, varnishedDacronGlass, rubber + """ + pass + +class CableShieldMaterialKind(str): + """Values are: lead, aluminum, other, copper, steel + """ + pass diff --git a/CIM14/CDPSM/Asset/IEC61968/Assets/AssetInfo.py b/CIM14/CDPSM/Asset/IEC61968/Assets/AssetInfo.py new file mode 100644 index 00000000..5d301897 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/Assets/AssetInfo.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class AssetInfo(IdentifiedObject): + """Set of attributes of an asset, representing typical data-sheet information of a physical device, that can be instantiated and shared in different data exchange contexts: - as attributes of an asset instance (installed or in stock) - as attributes of an asset model (product by a manufacturer) - as attributes of a type asset (generic type of an asset as used in designs/extension planning). + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'AssetInfo' instance. + + """ + super(AssetInfo, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Asset/IEC61968/Assets/__init__.py b/CIM14/CDPSM/Asset/IEC61968/Assets/__init__.py new file mode 100644 index 00000000..d4601802 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/Assets/__init__.py @@ -0,0 +1,28 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package contains the core information classes that support asset management applications that deal with the physical and lifecycle aspects of various network resources (as opposed to power system resource models defined in IEC61970::Wires package, which support network applications). +""" + +from CIM15.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM/Asset#Assets" +nsPrefix = "cimAssets" + diff --git a/CIM14/CDPSM/Asset/IEC61968/__init__.py b/CIM14/CDPSM/Asset/IEC61968/__init__.py new file mode 100644 index 00000000..7acb8eae --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61968/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""This package is an extension of the Metering package and contains the information classes that support specialised applications such as prepayment metering. These classes are generally associated with the collection and control of revenue from the customer for a delivered service. +""" + + +nsURI = "http://iec.ch/TC57/2010/CIM-schema-cim15?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM/Asset#IEC61968" +nsPrefix = "cimIEC61968" + diff --git a/CIM14/CDPSM/Asset/IEC61970/Core/IdentifiedObject.py b/CIM14/CDPSM/Asset/IEC61970/Core/IdentifiedObject.py new file mode 100644 index 00000000..dfa2300f --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61970/Core/IdentifiedObject.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.Element import Element + +class IdentifiedObject(Element): + """This is a root class to provide common identification for all classes needing identification and naming attributes + """ + + def __init__(self, name='', aliasName='', Names=None, *args, **kw_args): + """Initialises a new 'IdentifiedObject' instance. + + @param name: The name is any free human readable and possibly non unique text naming the object. + @param aliasName: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + @param Names: All names of this identified object. + """ + #: The name is any free human readable and possibly non unique text naming the object. + self.name = name + + #: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + self.aliasName = aliasName + + self._Names = [] + self.Names = [] if Names is None else Names + + super(IdentifiedObject, self).__init__(*args, **kw_args) + + _attrs = ["name", "aliasName"] + _attr_types = {"name": str, "aliasName": str} + _defaults = {"name": '', "aliasName": ''} + _enums = {} + _refs = ["Names"] + _many_refs = ["Names"] + + def getNames(self): + """All names of this identified object. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.IdentifiedObject = None + for y in value: + y._IdentifiedObject = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = self + + def removeNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = None + diff --git a/CIM14/CDPSM/Asset/IEC61970/Core/Name.py b/CIM14/CDPSM/Asset/IEC61970/Core/Name.py new file mode 100644 index 00000000..b6d7cb8f --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61970/Core/Name.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.Element import Element + +class Name(Element): + """The Name class provides the means to define any number of human readable names for an object. A name is not to be used for defining inter-object relationships. For inter-object relationships instead use the object identification 'mRID'. + """ + + def __init__(self, name='', IdentifiedObject=None, NameType=None, *args, **kw_args): + """Initialises a new 'Name' instance. + + @param name: Any free text that name the object. + @param IdentifiedObject: Identified object that this name designates. + @param NameType: Type of this name. + """ + #: Any free text that name the object. + self.name = name + + self._IdentifiedObject = None + self.IdentifiedObject = IdentifiedObject + + self._NameType = None + self.NameType = NameType + + super(Name, self).__init__(*args, **kw_args) + + _attrs = ["name"] + _attr_types = {"name": str} + _defaults = {"name": ''} + _enums = {} + _refs = ["IdentifiedObject", "NameType"] + _many_refs = [] + + def getIdentifiedObject(self): + """Identified object that this name designates. + """ + return self._IdentifiedObject + + def setIdentifiedObject(self, value): + if self._IdentifiedObject is not None: + filtered = [x for x in self.IdentifiedObject.Names if x != self] + self._IdentifiedObject._Names = filtered + + self._IdentifiedObject = value + if self._IdentifiedObject is not None: + if self not in self._IdentifiedObject._Names: + self._IdentifiedObject._Names.append(self) + + IdentifiedObject = property(getIdentifiedObject, setIdentifiedObject) + + def getNameType(self): + """Type of this name. + """ + return self._NameType + + def setNameType(self, value): + if self._NameType is not None: + filtered = [x for x in self.NameType.Names if x != self] + self._NameType._Names = filtered + + self._NameType = value + if self._NameType is not None: + if self not in self._NameType._Names: + self._NameType._Names.append(self) + + NameType = property(getNameType, setNameType) + diff --git a/CIM14/CDPSM/Asset/IEC61970/Core/NameType.py b/CIM14/CDPSM/Asset/IEC61970/Core/NameType.py new file mode 100644 index 00000000..32c62ea7 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61970/Core/NameType.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.Element import Element + +class NameType(Element): + """Type of name. Possible values for attribute 'name' are implementation dependent but standard profiles may specify types. An enterprise may have multiple IT systems each having its own local name for the same object, e.g. a planning system may have different names from an EMS. An object may also have different names within the same IT system, e.g. localName and aliasName as defined in CIM version 14. Their definitions from CIM14 are The localName is a human readable name of the object. It is only used with objects organized in a naming hierarchy. localName: A free text name local to a node in a naming hierarchy similar to a file directory structure. A power system related naming hierarchy may be: Substation, VoltageLevel, Equipment etc. Children of the same parent in such a hierarchy have names that typically are unique among them. aliasName: A free text alternate name typically used in tabular reports where the column width is limited. + """ + + def __init__(self, Names=None, *args, **kw_args): + """Initialises a new 'NameType' instance. + + @param Names: All names of this type. + """ + self._Names = [] + self.Names = [] if Names is None else Names + + super(NameType, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Names"] + _many_refs = ["Names"] + + def getNames(self): + """All names of this type. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.NameType = None + for y in value: + y._NameType = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.NameType = self + + def removeNames(self, *Names): + for obj in Names: + obj.NameType = None + diff --git a/CIM14/CDPSM/Asset/IEC61970/Core/__init__.py b/CIM14/CDPSM/Asset/IEC61970/Core/__init__.py new file mode 100644 index 00000000..166c96d6 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61970/Core/__init__.py @@ -0,0 +1,30 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""Contains the core PowerSystemResource and ConductingEquipment entities shared by all applications plus common collections of those entities. Not all applications require all the Core entities. This package does not depend on any other package except the Domain package, but most of the other packages have associations and generalizations that depend on it. +""" + +from CIM14.CDPSM.Asset.IEC61970.Core.NameType import NameType +from CIM14.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject +from CIM14.CDPSM.Asset.IEC61970.Core.Name import Name + +nsURI = "http://iec.ch/TC57/2009/CIM-schema-cim14?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM/Asset#Core" +nsPrefix = "cimCore" + diff --git a/CIM14/CDPSM/Asset/IEC61970/Wires/ACLineSegment.py b/CIM14/CDPSM/Asset/IEC61970/Wires/ACLineSegment.py new file mode 100644 index 00000000..2b01d743 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61970/Wires/ACLineSegment.py @@ -0,0 +1,102 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ACLineSegment(IdentifiedObject): + """A wire or combination of wires, with consistent electrical characteristics, building a single electrical system, used to carry alternating current between points in the power system. For symmetrical, transposed 3ph lines, it is sufficient to use ACLineSegment attributes, which describe sequence impedances and admittances for the entire length of the segment. If per lenght impedance data is available from a library of standard types, impedances and admittances can be calculated in one of the following ways: - calculate electrical parameters from asset data, using associated ConductorInfo, with values then multiplied by Conductor.length to produce a matrix model. - calculate unbalanced electrical parameters from associated PerLengthPhaseImpedance, then multiplied by Conductor.length to produce a matrix model. - calculate transposed electrical parameters from associated PerLengthSequenceImpedance, then multiplied by Conductor.length to produce a sequence model. + """ + + def __init__(self, SequenceImpedance=None, ConductorInfo=None, PhaseImpedance=None, *args, **kw_args): + """Initialises a new 'ACLineSegment' instance. + + @param SequenceImpedance: Sequence impedance of this line segment; used for balanced model. + @param ConductorInfo: Conductor data for this line segment. + @param PhaseImpedance: Phase impedance of this line segment; used for unbalanced model. + """ + self._SequenceImpedance = None + self.SequenceImpedance = SequenceImpedance + + self._ConductorInfo = None + self.ConductorInfo = ConductorInfo + + self._PhaseImpedance = None + self.PhaseImpedance = PhaseImpedance + + super(ACLineSegment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["SequenceImpedance", "ConductorInfo", "PhaseImpedance"] + _many_refs = [] + + def getSequenceImpedance(self): + """Sequence impedance of this line segment; used for balanced model. + """ + return self._SequenceImpedance + + def setSequenceImpedance(self, value): + if self._SequenceImpedance is not None: + filtered = [x for x in self.SequenceImpedance.LineSegments if x != self] + self._SequenceImpedance._LineSegments = filtered + + self._SequenceImpedance = value + if self._SequenceImpedance is not None: + if self not in self._SequenceImpedance._LineSegments: + self._SequenceImpedance._LineSegments.append(self) + + SequenceImpedance = property(getSequenceImpedance, setSequenceImpedance) + + def getConductorInfo(self): + """Conductor data for this line segment. + """ + return self._ConductorInfo + + def setConductorInfo(self, value): + if self._ConductorInfo is not None: + filtered = [x for x in self.ConductorInfo.LineSegments if x != self] + self._ConductorInfo._LineSegments = filtered + + self._ConductorInfo = value + if self._ConductorInfo is not None: + if self not in self._ConductorInfo._LineSegments: + self._ConductorInfo._LineSegments.append(self) + + ConductorInfo = property(getConductorInfo, setConductorInfo) + + def getPhaseImpedance(self): + """Phase impedance of this line segment; used for unbalanced model. + """ + return self._PhaseImpedance + + def setPhaseImpedance(self, value): + if self._PhaseImpedance is not None: + filtered = [x for x in self.PhaseImpedance.LineSegments if x != self] + self._PhaseImpedance._LineSegments = filtered + + self._PhaseImpedance = value + if self._PhaseImpedance is not None: + if self not in self._PhaseImpedance._LineSegments: + self._PhaseImpedance._LineSegments.append(self) + + PhaseImpedance = property(getPhaseImpedance, setPhaseImpedance) + diff --git a/CIM14/CDPSM/Asset/IEC61970/Wires/PerLengthPhaseImpedance.py b/CIM14/CDPSM/Asset/IEC61970/Wires/PerLengthPhaseImpedance.py new file mode 100644 index 00000000..0d63d89a --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61970/Wires/PerLengthPhaseImpedance.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PerLengthPhaseImpedance(IdentifiedObject): + """Impedance and admittance parameters per unit length for n-wire unbalanced lines, in matrix form. + """ + + def __init__(self, LineSegments=None, *args, **kw_args): + """Initialises a new 'PerLengthPhaseImpedance' instance. + + @param LineSegments: All line segments described by this phase impedance. + """ + self._LineSegments = [] + self.LineSegments = [] if LineSegments is None else LineSegments + + super(PerLengthPhaseImpedance, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["LineSegments"] + _many_refs = ["LineSegments"] + + def getLineSegments(self): + """All line segments described by this phase impedance. + """ + return self._LineSegments + + def setLineSegments(self, value): + for x in self._LineSegments: + x.PhaseImpedance = None + for y in value: + y._PhaseImpedance = self + self._LineSegments = value + + LineSegments = property(getLineSegments, setLineSegments) + + def addLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.PhaseImpedance = self + + def removeLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.PhaseImpedance = None + diff --git a/CIM14/CDPSM/Asset/IEC61970/Wires/PerLengthSequenceImpedance.py b/CIM14/CDPSM/Asset/IEC61970/Wires/PerLengthSequenceImpedance.py new file mode 100644 index 00000000..f91eceda --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61970/Wires/PerLengthSequenceImpedance.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PerLengthSequenceImpedance(IdentifiedObject): + """Sequence impedance and admittance parameters per unit length, for transposed lines of 1, 2, or 3 phases. For 1-phase lines, define x=x0=xself. For 2-phase lines, define x=xs-xm and x0=xs+xm. + """ + + def __init__(self, LineSegments=None, *args, **kw_args): + """Initialises a new 'PerLengthSequenceImpedance' instance. + + @param LineSegments: All line segments described by this sequence impedance. + """ + self._LineSegments = [] + self.LineSegments = [] if LineSegments is None else LineSegments + + super(PerLengthSequenceImpedance, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["LineSegments"] + _many_refs = ["LineSegments"] + + def getLineSegments(self): + """All line segments described by this sequence impedance. + """ + return self._LineSegments + + def setLineSegments(self, value): + for x in self._LineSegments: + x.SequenceImpedance = None + for y in value: + y._SequenceImpedance = self + self._LineSegments = value + + LineSegments = property(getLineSegments, setLineSegments) + + def addLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.SequenceImpedance = self + + def removeLineSegments(self, *LineSegments): + for obj in LineSegments: + obj.SequenceImpedance = None + diff --git a/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerCoreAdmittance.py b/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerCoreAdmittance.py new file mode 100644 index 00000000..d571e424 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerCoreAdmittance.py @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerCoreAdmittance(IdentifiedObject): + + def __init__(self, TransformerEnd=None, *args, **kw_args): + """Initialises a new 'TransformerCoreAdmittance' instance. + + @param TransformerEnd: All transformer ends having this core admittance. + """ + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + super(TransformerCoreAdmittance, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TransformerEnd"] + _many_refs = ["TransformerEnd"] + + def getTransformerEnd(self): + """All transformer ends having this core admittance. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.CoreAdmittance = None + for y in value: + y._CoreAdmittance = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.CoreAdmittance = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.CoreAdmittance = None + diff --git a/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerEnd.py b/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerEnd.py new file mode 100644 index 00000000..37e55b34 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerEnd.py @@ -0,0 +1,102 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerEnd(IdentifiedObject): + """TransformerEnd is a conducting connection point of a power transformer. It corresponds to a physical transformer winding terminal. In earlier CIM versions, the TransformerWinding class served a similar purpose. This successor TransformerEnd class is more flexible and has important differences with TransformerWinding. + """ + + def __init__(self, CoreAdmittance=None, TransformerEndInfo=None, StarImpedance=None, *args, **kw_args): + """Initialises a new 'TransformerEnd' instance. + + @param CoreAdmittance: Core admittance of this transformer end, representing magnetising current and core losses. The full values of the transformer should be supplied for one transformer end only. + @param TransformerEndInfo: Data for this transformer end. + @param StarImpedance: (accurate for 2- or 3-winding transformers only) Pi-model impedances of this transformer end. By convention, for a two winding transformer, the full values of the transformer should be entered on the high voltage end (endNumber=1). + """ + self._CoreAdmittance = None + self.CoreAdmittance = CoreAdmittance + + self._TransformerEndInfo = None + self.TransformerEndInfo = TransformerEndInfo + + self._StarImpedance = None + self.StarImpedance = StarImpedance + + super(TransformerEnd, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["CoreAdmittance", "TransformerEndInfo", "StarImpedance"] + _many_refs = [] + + def getCoreAdmittance(self): + """Core admittance of this transformer end, representing magnetising current and core losses. The full values of the transformer should be supplied for one transformer end only. + """ + return self._CoreAdmittance + + def setCoreAdmittance(self, value): + if self._CoreAdmittance is not None: + filtered = [x for x in self.CoreAdmittance.TransformerEnd if x != self] + self._CoreAdmittance._TransformerEnd = filtered + + self._CoreAdmittance = value + if self._CoreAdmittance is not None: + if self not in self._CoreAdmittance._TransformerEnd: + self._CoreAdmittance._TransformerEnd.append(self) + + CoreAdmittance = property(getCoreAdmittance, setCoreAdmittance) + + def getTransformerEndInfo(self): + """Data for this transformer end. + """ + return self._TransformerEndInfo + + def setTransformerEndInfo(self, value): + if self._TransformerEndInfo is not None: + filtered = [x for x in self.TransformerEndInfo.TransformerEnd if x != self] + self._TransformerEndInfo._TransformerEnd = filtered + + self._TransformerEndInfo = value + if self._TransformerEndInfo is not None: + if self not in self._TransformerEndInfo._TransformerEnd: + self._TransformerEndInfo._TransformerEnd.append(self) + + TransformerEndInfo = property(getTransformerEndInfo, setTransformerEndInfo) + + def getStarImpedance(self): + """(accurate for 2- or 3-winding transformers only) Pi-model impedances of this transformer end. By convention, for a two winding transformer, the full values of the transformer should be entered on the high voltage end (endNumber=1). + """ + return self._StarImpedance + + def setStarImpedance(self, value): + if self._StarImpedance is not None: + filtered = [x for x in self.StarImpedance.TransformerEnd if x != self] + self._StarImpedance._TransformerEnd = filtered + + self._StarImpedance = value + if self._StarImpedance is not None: + if self not in self._StarImpedance._TransformerEnd: + self._StarImpedance._TransformerEnd.append(self) + + StarImpedance = property(getStarImpedance, setStarImpedance) + diff --git a/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerStarImpedance.py b/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerStarImpedance.py new file mode 100644 index 00000000..f57fbc25 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerStarImpedance.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerStarImpedance(IdentifiedObject): + """Transformer star impedance (Pi-model) that accurately reflects impedance for transformers with 2 or 3 windings. For transformers with 4 or more windings, you must use TransformerTank model and related classes. For transmission networks use PowerTransformerEnd impedances (r, r0, x, x0, b, b0, g and g0). + """ + + def __init__(self, TransformerEnd=None, *args, **kw_args): + """Initialises a new 'TransformerStarImpedance' instance. + + @param TransformerEnd: All transformer ends having this star impedance. + """ + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + super(TransformerStarImpedance, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TransformerEnd"] + _many_refs = ["TransformerEnd"] + + def getTransformerEnd(self): + """All transformer ends having this star impedance. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.StarImpedance = None + for y in value: + y._StarImpedance = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.StarImpedance = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.StarImpedance = None + diff --git a/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerTank.py b/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerTank.py new file mode 100644 index 00000000..b0d82270 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerTank.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerTank(IdentifiedObject): + """An assembly of two or more coupled windings that transform electrical power between voltage levels. These windings are bound on a common core and place in the same tank. Transformer tank can be used to model both single-phase and 3-phase transformers. + """ + + def __init__(self, TransformerTankInfo=None, *args, **kw_args): + """Initialises a new 'TransformerTank' instance. + + @param TransformerTankInfo: Transformer tank data. + """ + self._TransformerTankInfo = None + self.TransformerTankInfo = TransformerTankInfo + + super(TransformerTank, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TransformerTankInfo"] + _many_refs = [] + + def getTransformerTankInfo(self): + """Transformer tank data. + """ + return self._TransformerTankInfo + + def setTransformerTankInfo(self, value): + if self._TransformerTankInfo is not None: + filtered = [x for x in self.TransformerTankInfo.TransformerTanks if x != self] + self._TransformerTankInfo._TransformerTanks = filtered + + self._TransformerTankInfo = value + if self._TransformerTankInfo is not None: + if self not in self._TransformerTankInfo._TransformerTanks: + self._TransformerTankInfo._TransformerTanks.append(self) + + TransformerTankInfo = property(getTransformerTankInfo, setTransformerTankInfo) + diff --git a/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerTankEnd.py b/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerTankEnd.py new file mode 100644 index 00000000..976a0402 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61970/Wires/TransformerTankEnd.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Asset.IEC61970.Wires.TransformerEnd import TransformerEnd + +class TransformerTankEnd(TransformerEnd): + """Transformer tank end represents an individual winding for unbalanced models or for transformer tanks connected into a bank (and bank is modelled with the PowerTransformer). + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'TransformerTankEnd' instance. + + """ + super(TransformerTankEnd, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Asset/IEC61970/Wires/__init__.py b/CIM14/CDPSM/Asset/IEC61970/Wires/__init__.py new file mode 100644 index 00000000..e19f5522 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61970/Wires/__init__.py @@ -0,0 +1,40 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""An extension to the Core and Topology package that models information on the electrical characteristics of Transmission and Distribution networks. This package is used by network applications such as State Estimation, Load Flow and Optimal Power Flow. +""" + +from CIM14.CDPSM.Asset.IEC61970.Wires.PerLengthSequenceImpedance import PerLengthSequenceImpedance +from CIM14.CDPSM.Asset.IEC61970.Wires.ACLineSegment import ACLineSegment +from CIM14.CDPSM.Asset.IEC61970.Wires.TransformerCoreAdmittance import TransformerCoreAdmittance +from CIM14.CDPSM.Asset.IEC61970.Wires.TransformerTank import TransformerTank +from CIM14.CDPSM.Asset.IEC61970.Wires.TransformerTankEnd import TransformerTankEnd +from CIM14.CDPSM.Asset.IEC61970.Wires.TransformerStarImpedance import TransformerStarImpedance +from CIM14.CDPSM.Asset.IEC61970.Wires.PerLengthPhaseImpedance import PerLengthPhaseImpedance +from CIM14.CDPSM.Asset.IEC61970.Wires.TransformerEnd import TransformerEnd + +nsURI = "http://iec.ch/TC57/2009/CIM-schema-cim14?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM/Asset#Wires" +nsPrefix = "cimWires" + + +class WindingConnection(str): + """Values are: Z, A, Yn, Y, Zn, D, I + """ + pass diff --git a/CIM14/CDPSM/Asset/IEC61970/__init__.py b/CIM14/CDPSM/Asset/IEC61970/__init__.py new file mode 100644 index 00000000..99e37095 --- /dev/null +++ b/CIM14/CDPSM/Asset/IEC61970/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The ControlArea package models area specifications which can be used for a variety of purposes. The package as a whole models potentially overlapping control area specifications for the purpose of actual generation control, load forecast area load capture, or powerflow based analysis. +""" + + +nsURI = "http://iec.ch/TC57/2009/CIM-schema-cim14?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM/Asset#IEC61970" +nsPrefix = "cimIEC61970" + diff --git a/CIM14/CDPSM/Asset/__init__.py b/CIM14/CDPSM/Asset/__init__.py new file mode 100644 index 00000000..5cc877c6 --- /dev/null +++ b/CIM14/CDPSM/Asset/__init__.py @@ -0,0 +1,138 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The IEC 61968 subpackages of the CIM are developed, standardized and maintained by IEC TC57 Working Group 14: interfaces for distribution management (WG14). Currently, normative parts of the model support the needs of information exchange defined in IEC 61968-9 and in IEC 61968-13. +""" + +from CIM14.CDPSM.Asset.Element import Element + +nsURI = "http://iec.ch/TC57/2009/CIM-schema-cim14?profile=http://iec.ch/TC57/2011/iec61968-4/CDPSM/Asset" +nsPrefix = "asset" + +packageMap = { + "Element": "CIM14.CDPSM.Asset", + "PerLengthSequenceImpedance": "CIM14.CDPSM.Asset.IEC61970.Wires", + "ACLineSegment": "CIM14.CDPSM.Asset.IEC61970.Wires", + "TransformerCoreAdmittance": "CIM14.CDPSM.Asset.IEC61970.Wires", + "TransformerTank": "CIM14.CDPSM.Asset.IEC61970.Wires", + "TransformerTankEnd": "CIM14.CDPSM.Asset.IEC61970.Wires", + "TransformerStarImpedance": "CIM14.CDPSM.Asset.IEC61970.Wires", + "PerLengthPhaseImpedance": "CIM14.CDPSM.Asset.IEC61970.Wires", + "TransformerEnd": "CIM14.CDPSM.Asset.IEC61970.Wires", + "NameType": "CIM14.CDPSM.Asset.IEC61970.Core", + "IdentifiedObject": "CIM14.CDPSM.Asset.IEC61970.Core", + "Name": "CIM14.CDPSM.Asset.IEC61970.Core", + "ConductorInfo": "CIM14.CDPSM.Asset.IEC61968.AssetModels", + "WireArrangement": "CIM14.CDPSM.Asset.IEC61968.AssetModels", + "WireType": "CIM14.CDPSM.Asset.IEC61968.AssetModels", + "EndDeviceInfo": "CIM14.CDPSM.Asset.IEC61968.AssetModels", + "OverheadConductorInfo": "CIM14.CDPSM.Asset.IEC61968.AssetModels", + "TapChangerInfo": "CIM14.CDPSM.Asset.IEC61968.AssetModels", + "TransformerTankInfo": "CIM14.CDPSM.Asset.IEC61968.AssetModels", + "CableInfo": "CIM14.CDPSM.Asset.IEC61968.AssetModels", + "ConcentricNeutralCableInfo": "CIM14.CDPSM.Asset.IEC61968.AssetModels", + "TapeShieldCableInfo": "CIM14.CDPSM.Asset.IEC61968.AssetModels", + "TransformerEndInfo": "CIM14.CDPSM.Asset.IEC61968.AssetModels", + "PowerTransformerInfo": "CIM14.CDPSM.Asset.IEC61968.AssetModels", + "AssetInfo": "CIM14.CDPSM.Asset.IEC61968.Assets", +} + + +class Resistance(float): + """Resistance (real part of impedance). + """ + pass + +class ResistancePerLength(float): + """Resistance (real part of impedance) per unit of length. + """ + pass + +class Temperature(float): + """Value of temperature in degrees Celsius. + """ + pass + +class PerCent(float): + """Normally 0 - 100 on a defined base + """ + pass + +class Length(float): + """Unit of length. + """ + pass + +class Voltage(float): + """Electrical voltage. + """ + pass + +class CurrentFlow(float): + """Electrical current (positive flow is out of the ConductingEquipment into the ConnectivityNode) + """ + pass + +class ApparentPower(float): + """Product of the RMS value of the voltage and the RMS value of the current + """ + pass + +class Displacement(float): + """Unit of displacement relative a reference position, hence can be negative. + """ + pass + +class AngleDegrees(float): + """Measurement of angle in degrees + """ + pass + +class Frequency(float): + """Cycles per second + """ + pass + +class CIMTime(str): + pass + +class CIMDateTime(str): + pass + +class CIMDuration(str): + pass + +class CIMGYear(str): + pass + +class CIMDate(str): + pass + +class CIMGMonthDay(str): + pass + +class CIMGMonth(str): + pass + +class CIMGDay(str): + pass + +class CIMGYearMonth(str): + pass diff --git a/CIM14/CDPSM/Connectivity/Element.py b/CIM14/CDPSM/Connectivity/Element.py new file mode 100644 index 00000000..fddaa815 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/Element.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +class Element(object): + + def __init__(self, UUID=''): + """Initialises a new 'Element' instance. + + @param UUID: + """ + + self.UUID = UUID + + + _attrs = ["UUID"] + _attr_types = {"UUID": str} + _defaults = {"UUID": ''} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/BaseVoltage.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/BaseVoltage.py new file mode 100644 index 00000000..0c453533 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/BaseVoltage.py @@ -0,0 +1,95 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class BaseVoltage(IdentifiedObject): + """Defines a nominal base voltage which is referenced in the system. + """ + + def __init__(self, nominalVoltage=0.0, ConductingEquipment=None, VoltageLevel=None, *args, **kw_args): + """Initialises a new 'BaseVoltage' instance. + + @param nominalVoltage: The PowerSystemResource's base voltage. + @param ConductingEquipment: Use association to ConductingEquipment only when there is no VoltageLevel container used. + @param VoltageLevel: The VoltageLevels having this BaseVoltage. + """ + #: The PowerSystemResource's base voltage. + self.nominalVoltage = nominalVoltage + + self._ConductingEquipment = [] + self.ConductingEquipment = [] if ConductingEquipment is None else ConductingEquipment + + self._VoltageLevel = [] + self.VoltageLevel = [] if VoltageLevel is None else VoltageLevel + + super(BaseVoltage, self).__init__(*args, **kw_args) + + _attrs = ["nominalVoltage"] + _attr_types = {"nominalVoltage": float} + _defaults = {"nominalVoltage": 0.0} + _enums = {} + _refs = ["ConductingEquipment", "VoltageLevel"] + _many_refs = ["ConductingEquipment", "VoltageLevel"] + + def getConductingEquipment(self): + """Use association to ConductingEquipment only when there is no VoltageLevel container used. + """ + return self._ConductingEquipment + + def setConductingEquipment(self, value): + for x in self._ConductingEquipment: + x.BaseVoltage = None + for y in value: + y._BaseVoltage = self + self._ConductingEquipment = value + + ConductingEquipment = property(getConductingEquipment, setConductingEquipment) + + def addConductingEquipment(self, *ConductingEquipment): + for obj in ConductingEquipment: + obj.BaseVoltage = self + + def removeConductingEquipment(self, *ConductingEquipment): + for obj in ConductingEquipment: + obj.BaseVoltage = None + + def getVoltageLevel(self): + """The VoltageLevels having this BaseVoltage. + """ + return self._VoltageLevel + + def setVoltageLevel(self, value): + for x in self._VoltageLevel: + x.BaseVoltage = None + for y in value: + y._BaseVoltage = self + self._VoltageLevel = value + + VoltageLevel = property(getVoltageLevel, setVoltageLevel) + + def addVoltageLevel(self, *VoltageLevel): + for obj in VoltageLevel: + obj.BaseVoltage = self + + def removeVoltageLevel(self, *VoltageLevel): + for obj in VoltageLevel: + obj.BaseVoltage = None + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/Bay.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/Bay.py new file mode 100644 index 00000000..2847525a --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/Bay.py @@ -0,0 +1,81 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class Bay(EquipmentContainer): + """A collection of power system resources (within a given substation) including conducting equipment, protection relays, measurements, and telemetry. + """ + + def __init__(self, VoltageLevel=None, Substation=None, *args, **kw_args): + """Initialises a new 'Bay' instance. + + @param VoltageLevel: The association is used in the naming hierarchy. + @param Substation: The association is used in the naming hierarchy. + """ + self._VoltageLevel = None + self.VoltageLevel = VoltageLevel + + self._Substation = None + self.Substation = Substation + + super(Bay, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["VoltageLevel", "Substation"] + _many_refs = [] + + def getVoltageLevel(self): + """The association is used in the naming hierarchy. + """ + return self._VoltageLevel + + def setVoltageLevel(self, value): + if self._VoltageLevel is not None: + filtered = [x for x in self.VoltageLevel.Bays if x != self] + self._VoltageLevel._Bays = filtered + + self._VoltageLevel = value + if self._VoltageLevel is not None: + if self not in self._VoltageLevel._Bays: + self._VoltageLevel._Bays.append(self) + + VoltageLevel = property(getVoltageLevel, setVoltageLevel) + + def getSubstation(self): + """The association is used in the naming hierarchy. + """ + return self._Substation + + def setSubstation(self, value): + if self._Substation is not None: + filtered = [x for x in self.Substation.Bays if x != self] + self._Substation._Bays = filtered + + self._Substation = value + if self._Substation is not None: + if self not in self._Substation._Bays: + self._Substation._Bays.append(self) + + Substation = property(getSubstation, setSubstation) + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/ConductingEquipment.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/ConductingEquipment.py new file mode 100644 index 00000000..e2d4c056 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/ConductingEquipment.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.Equipment import Equipment + +class ConductingEquipment(Equipment): + """The parts of the power system that are designed to carry current or that are conductively connected therewith. ConductingEquipment is contained within an EquipmentContainer that may be a Substation, or a VoltageLevel or a Bay within a Substation. + """ + + def __init__(self, Terminals=None, *args, **kw_args): + """Initialises a new 'ConductingEquipment' instance. + + @param Terminals: ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + """ + self._Terminals = [] + self.Terminals = [] if Terminals is None else Terminals + + super(ConductingEquipment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Terminals"] + _many_refs = ["Terminals"] + + def getTerminals(self): + """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + """ + return self._Terminals + + def setTerminals(self, value): + for x in self._Terminals: + x.ConductingEquipment = None + for y in value: + y._ConductingEquipment = self + self._Terminals = value + + Terminals = property(getTerminals, setTerminals) + + def addTerminals(self, *Terminals): + for obj in Terminals: + obj.ConductingEquipment = self + + def removeTerminals(self, *Terminals): + for obj in Terminals: + obj.ConductingEquipment = None + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/ConnectivityNode.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/ConnectivityNode.py new file mode 100644 index 00000000..9c66b8ca --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/ConnectivityNode.py @@ -0,0 +1,86 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ConnectivityNode(IdentifiedObject): + """Connectivity nodes are points where terminals of conducting equipment are connected together with zero impedance. + """ + + def __init__(self, ConnectivityNodeContainer=None, Terminals=None, *args, **kw_args): + """Initialises a new 'ConnectivityNode' instance. + + @param ConnectivityNodeContainer: Container of this connectivity node. + @param Terminals: Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + """ + self._ConnectivityNodeContainer = None + self.ConnectivityNodeContainer = ConnectivityNodeContainer + + self._Terminals = [] + self.Terminals = [] if Terminals is None else Terminals + + super(ConnectivityNode, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ConnectivityNodeContainer", "Terminals"] + _many_refs = ["Terminals"] + + def getConnectivityNodeContainer(self): + """Container of this connectivity node. + """ + return self._ConnectivityNodeContainer + + def setConnectivityNodeContainer(self, value): + if self._ConnectivityNodeContainer is not None: + filtered = [x for x in self.ConnectivityNodeContainer.ConnectivityNodes if x != self] + self._ConnectivityNodeContainer._ConnectivityNodes = filtered + + self._ConnectivityNodeContainer = value + if self._ConnectivityNodeContainer is not None: + if self not in self._ConnectivityNodeContainer._ConnectivityNodes: + self._ConnectivityNodeContainer._ConnectivityNodes.append(self) + + ConnectivityNodeContainer = property(getConnectivityNodeContainer, setConnectivityNodeContainer) + + def getTerminals(self): + """Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + """ + return self._Terminals + + def setTerminals(self, value): + for x in self._Terminals: + x.ConnectivityNode = None + for y in value: + y._ConnectivityNode = self + self._Terminals = value + + Terminals = property(getTerminals, setTerminals) + + def addTerminals(self, *Terminals): + for obj in Terminals: + obj.ConnectivityNode = self + + def removeTerminals(self, *Terminals): + for obj in Terminals: + obj.ConnectivityNode = None + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/ConnectivityNodeContainer.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/ConnectivityNodeContainer.py new file mode 100644 index 00000000..e95d8bee --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/ConnectivityNodeContainer.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class ConnectivityNodeContainer(PowerSystemResource): + """A base class for all objects that may contain ConnectivityNodes or TopologicalNodes. + """ + + def __init__(self, ConnectivityNodes=None, *args, **kw_args): + """Initialises a new 'ConnectivityNodeContainer' instance. + + @param ConnectivityNodes: Connectivity nodes contained by this container. + """ + self._ConnectivityNodes = [] + self.ConnectivityNodes = [] if ConnectivityNodes is None else ConnectivityNodes + + super(ConnectivityNodeContainer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ConnectivityNodes"] + _many_refs = ["ConnectivityNodes"] + + def getConnectivityNodes(self): + """Connectivity nodes contained by this container. + """ + return self._ConnectivityNodes + + def setConnectivityNodes(self, value): + for x in self._ConnectivityNodes: + x.ConnectivityNodeContainer = None + for y in value: + y._ConnectivityNodeContainer = self + self._ConnectivityNodes = value + + ConnectivityNodes = property(getConnectivityNodes, setConnectivityNodes) + + def addConnectivityNodes(self, *ConnectivityNodes): + for obj in ConnectivityNodes: + obj.ConnectivityNodeContainer = self + + def removeConnectivityNodes(self, *ConnectivityNodes): + for obj in ConnectivityNodes: + obj.ConnectivityNodeContainer = None + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/Equipment.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/Equipment.py new file mode 100644 index 00000000..f42ca162 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/Equipment.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class Equipment(PowerSystemResource): + """The parts of a power system that are physical devices, electronic or mechanical + """ + + def __init__(self, EquipmentContainer=None, *args, **kw_args): + """Initialises a new 'Equipment' instance. + + @param EquipmentContainer: The association is used in the naming hierarchy. + """ + self._EquipmentContainer = None + self.EquipmentContainer = EquipmentContainer + + super(Equipment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["EquipmentContainer"] + _many_refs = [] + + def getEquipmentContainer(self): + """The association is used in the naming hierarchy. + """ + return self._EquipmentContainer + + def setEquipmentContainer(self, value): + if self._EquipmentContainer is not None: + filtered = [x for x in self.EquipmentContainer.Equipments if x != self] + self._EquipmentContainer._Equipments = filtered + + self._EquipmentContainer = value + if self._EquipmentContainer is not None: + if self not in self._EquipmentContainer._Equipments: + self._EquipmentContainer._Equipments.append(self) + + EquipmentContainer = property(getEquipmentContainer, setEquipmentContainer) + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/EquipmentContainer.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/EquipmentContainer.py new file mode 100644 index 00000000..8be3eac9 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/EquipmentContainer.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.ConnectivityNodeContainer import ConnectivityNodeContainer + +class EquipmentContainer(ConnectivityNodeContainer): + """A modeling construct to provide a root class for containing equipment. + """ + + def __init__(self, Equipments=None, *args, **kw_args): + """Initialises a new 'EquipmentContainer' instance. + + @param Equipments: The association is used in the naming hierarchy. + """ + self._Equipments = [] + self.Equipments = [] if Equipments is None else Equipments + + super(EquipmentContainer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Equipments"] + _many_refs = ["Equipments"] + + def getEquipments(self): + """The association is used in the naming hierarchy. + """ + return self._Equipments + + def setEquipments(self, value): + for x in self._Equipments: + x.EquipmentContainer = None + for y in value: + y._EquipmentContainer = self + self._Equipments = value + + Equipments = property(getEquipments, setEquipments) + + def addEquipments(self, *Equipments): + for obj in Equipments: + obj.EquipmentContainer = self + + def removeEquipments(self, *Equipments): + for obj in Equipments: + obj.EquipmentContainer = None + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/GeographicalRegion.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/GeographicalRegion.py new file mode 100644 index 00000000..f7daa154 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/GeographicalRegion.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GeographicalRegion(IdentifiedObject): + """A geographical region of a power system network model. + """ + + def __init__(self, Regions=None, *args, **kw_args): + """Initialises a new 'GeographicalRegion' instance. + + @param Regions: The association is used in the naming hierarchy. + """ + self._Regions = [] + self.Regions = [] if Regions is None else Regions + + super(GeographicalRegion, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Regions"] + _many_refs = ["Regions"] + + def getRegions(self): + """The association is used in the naming hierarchy. + """ + return self._Regions + + def setRegions(self, value): + for x in self._Regions: + x.Region = None + for y in value: + y._Region = self + self._Regions = value + + Regions = property(getRegions, setRegions) + + def addRegions(self, *Regions): + for obj in Regions: + obj.Region = self + + def removeRegions(self, *Regions): + for obj in Regions: + obj.Region = None + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/IdentifiedObject.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/IdentifiedObject.py new file mode 100644 index 00000000..dd35e3df --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/IdentifiedObject.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.Element import Element + +class IdentifiedObject(Element): + """This is a root class to provide common identification for all classes needing identification and naming attributes + """ + + def __init__(self, name='', aliasName='', Names=None, *args, **kw_args): + """Initialises a new 'IdentifiedObject' instance. + + @param name: The name is any free human readable and possibly non unique text naming the object. + @param aliasName: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + @param Names: All names of this identified object. + """ + #: The name is any free human readable and possibly non unique text naming the object. + self.name = name + + #: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + self.aliasName = aliasName + + self._Names = [] + self.Names = [] if Names is None else Names + + super(IdentifiedObject, self).__init__(*args, **kw_args) + + _attrs = ["name", "aliasName"] + _attr_types = {"name": str, "aliasName": str} + _defaults = {"name": '', "aliasName": ''} + _enums = {} + _refs = ["Names"] + _many_refs = ["Names"] + + def getNames(self): + """All names of this identified object. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.IdentifiedObject = None + for y in value: + y._IdentifiedObject = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = self + + def removeNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = None + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/Name.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/Name.py new file mode 100644 index 00000000..28a09aeb --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/Name.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.Element import Element + +class Name(Element): + """The Name class provides the means to define any number of human readable names for an object. A name is not to be used for defining inter-object relationships. For inter-object relationships instead use the object identification 'mRID'. + """ + + def __init__(self, name='', IdentifiedObject=None, NameType=None, *args, **kw_args): + """Initialises a new 'Name' instance. + + @param name: Any free text that name the object. + @param IdentifiedObject: Identified object that this name designates. + @param NameType: Type of this name. + """ + #: Any free text that name the object. + self.name = name + + self._IdentifiedObject = None + self.IdentifiedObject = IdentifiedObject + + self._NameType = None + self.NameType = NameType + + super(Name, self).__init__(*args, **kw_args) + + _attrs = ["name"] + _attr_types = {"name": str} + _defaults = {"name": ''} + _enums = {} + _refs = ["IdentifiedObject", "NameType"] + _many_refs = [] + + def getIdentifiedObject(self): + """Identified object that this name designates. + """ + return self._IdentifiedObject + + def setIdentifiedObject(self, value): + if self._IdentifiedObject is not None: + filtered = [x for x in self.IdentifiedObject.Names if x != self] + self._IdentifiedObject._Names = filtered + + self._IdentifiedObject = value + if self._IdentifiedObject is not None: + if self not in self._IdentifiedObject._Names: + self._IdentifiedObject._Names.append(self) + + IdentifiedObject = property(getIdentifiedObject, setIdentifiedObject) + + def getNameType(self): + """Type of this name. + """ + return self._NameType + + def setNameType(self, value): + if self._NameType is not None: + filtered = [x for x in self.NameType.Names if x != self] + self._NameType._Names = filtered + + self._NameType = value + if self._NameType is not None: + if self not in self._NameType._Names: + self._NameType._Names.append(self) + + NameType = property(getNameType, setNameType) + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/NameType.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/NameType.py new file mode 100644 index 00000000..9bab8a72 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/NameType.py @@ -0,0 +1,94 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.Element import Element + +class NameType(Element): + """Type of name. Possible values for attribute 'name' are implementation dependent but standard profiles may specify types. An enterprise may have multiple IT systems each having its own local name for the same object, e.g. a planning system may have different names from an EMS. An object may also have different names within the same IT system, e.g. localName and aliasName as defined in CIM version 14. Their definitions from CIM14 are The localName is a human readable name of the object. It is only used with objects organized in a naming hierarchy. localName: A free text name local to a node in a naming hierarchy similar to a file directory structure. A power system related naming hierarchy may be: Substation, VoltageLevel, Equipment etc. Children of the same parent in such a hierarchy have names that typically are unique among them. aliasName: A free text alternate name typically used in tabular reports where the column width is limited. + """ + + def __init__(self, name='', description='', NameTypeAuthority=None, Names=None, *args, **kw_args): + """Initialises a new 'NameType' instance. + + @param name: Name of the name type. + @param description: Description of the name type. + @param NameTypeAuthority: Authority responsible for managing names of this type. + @param Names: All names of this type. + """ + #: Name of the name type. + self.name = name + + #: Description of the name type. + self.description = description + + self._NameTypeAuthority = None + self.NameTypeAuthority = NameTypeAuthority + + self._Names = [] + self.Names = [] if Names is None else Names + + super(NameType, self).__init__(*args, **kw_args) + + _attrs = ["name", "description"] + _attr_types = {"name": str, "description": str} + _defaults = {"name": '', "description": ''} + _enums = {} + _refs = ["NameTypeAuthority", "Names"] + _many_refs = ["Names"] + + def getNameTypeAuthority(self): + """Authority responsible for managing names of this type. + """ + return self._NameTypeAuthority + + def setNameTypeAuthority(self, value): + if self._NameTypeAuthority is not None: + filtered = [x for x in self.NameTypeAuthority.NameTypes if x != self] + self._NameTypeAuthority._NameTypes = filtered + + self._NameTypeAuthority = value + if self._NameTypeAuthority is not None: + if self not in self._NameTypeAuthority._NameTypes: + self._NameTypeAuthority._NameTypes.append(self) + + NameTypeAuthority = property(getNameTypeAuthority, setNameTypeAuthority) + + def getNames(self): + """All names of this type. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.NameType = None + for y in value: + y._NameType = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.NameType = self + + def removeNames(self, *Names): + for obj in Names: + obj.NameType = None + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/NameTypeAuthority.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/NameTypeAuthority.py new file mode 100644 index 00000000..fe5cf9df --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/NameTypeAuthority.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.Element import Element + +class NameTypeAuthority(Element): + """Authority responsible for creation and management of names of a given type; typically an organization or an enterprise system. + """ + + def __init__(self, name='', description='', NameTypes=None, *args, **kw_args): + """Initialises a new 'NameTypeAuthority' instance. + + @param name: Name of the name type authority. + @param description: Description of the name type authority. + @param NameTypes: All name types managed by this authority. + """ + #: Name of the name type authority. + self.name = name + + #: Description of the name type authority. + self.description = description + + self._NameTypes = [] + self.NameTypes = [] if NameTypes is None else NameTypes + + super(NameTypeAuthority, self).__init__(*args, **kw_args) + + _attrs = ["name", "description"] + _attr_types = {"name": str, "description": str} + _defaults = {"name": '', "description": ''} + _enums = {} + _refs = ["NameTypes"] + _many_refs = ["NameTypes"] + + def getNameTypes(self): + """All name types managed by this authority. + """ + return self._NameTypes + + def setNameTypes(self, value): + for x in self._NameTypes: + x.NameTypeAuthority = None + for y in value: + y._NameTypeAuthority = self + self._NameTypes = value + + NameTypes = property(getNameTypes, setNameTypes) + + def addNameTypes(self, *NameTypes): + for obj in NameTypes: + obj.NameTypeAuthority = self + + def removeNameTypes(self, *NameTypes): + for obj in NameTypes: + obj.NameTypeAuthority = None + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/PSRType.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/PSRType.py new file mode 100644 index 00000000..df6ffb79 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/PSRType.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PSRType(IdentifiedObject): + """Classifying instances of the same class, e.g. overhead and underground ACLineSegments. This classification mechanism is intended to provide flexibility outside the scope of this standard, i.e. provide customisation that is non standard. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'PSRType' instance. + + """ + super(PSRType, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/PowerSystemResource.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/PowerSystemResource.py new file mode 100644 index 00000000..f322d082 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/PowerSystemResource.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PowerSystemResource(IdentifiedObject): + """A power system resource can be an item of equipment such as a Switch, an EquipmentContainer containing many individual items of equipment such as a Substation, or an organisational entity such as Company or SubControlArea. This provides for the nesting of collections of PowerSystemResources within other PowerSystemResources. For example, a Switch could be a member of a Substation and a Substation could be a member of a division of a Company. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'PowerSystemResource' instance. + + """ + super(PowerSystemResource, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/SubGeographicalRegion.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/SubGeographicalRegion.py new file mode 100644 index 00000000..bb4345ce --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/SubGeographicalRegion.py @@ -0,0 +1,112 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class SubGeographicalRegion(IdentifiedObject): + """A subset of a geographical region of a power system network model. + """ + + def __init__(self, Lines=None, Substations=None, Region=None, *args, **kw_args): + """Initialises a new 'SubGeographicalRegion' instance. + + @param Lines: A Line can be contained by a SubGeographical Region. + @param Substations: The association is used in the naming hierarchy. + @param Region: The association is used in the naming hierarchy. + """ + self._Lines = [] + self.Lines = [] if Lines is None else Lines + + self._Substations = [] + self.Substations = [] if Substations is None else Substations + + self._Region = None + self.Region = Region + + super(SubGeographicalRegion, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Lines", "Substations", "Region"] + _many_refs = ["Lines", "Substations"] + + def getLines(self): + """A Line can be contained by a SubGeographical Region. + """ + return self._Lines + + def setLines(self, value): + for x in self._Lines: + x.Region = None + for y in value: + y._Region = self + self._Lines = value + + Lines = property(getLines, setLines) + + def addLines(self, *Lines): + for obj in Lines: + obj.Region = self + + def removeLines(self, *Lines): + for obj in Lines: + obj.Region = None + + def getSubstations(self): + """The association is used in the naming hierarchy. + """ + return self._Substations + + def setSubstations(self, value): + for x in self._Substations: + x.Region = None + for y in value: + y._Region = self + self._Substations = value + + Substations = property(getSubstations, setSubstations) + + def addSubstations(self, *Substations): + for obj in Substations: + obj.Region = self + + def removeSubstations(self, *Substations): + for obj in Substations: + obj.Region = None + + def getRegion(self): + """The association is used in the naming hierarchy. + """ + return self._Region + + def setRegion(self, value): + if self._Region is not None: + filtered = [x for x in self.Region.Regions if x != self] + self._Region._Regions = filtered + + self._Region = value + if self._Region is not None: + if self not in self._Region._Regions: + self._Region._Regions.append(self) + + Region = property(getRegion, setRegion) + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/Substation.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/Substation.py new file mode 100644 index 00000000..b9d79590 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/Substation.py @@ -0,0 +1,112 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class Substation(EquipmentContainer): + """A collection of equipment for purposes other than generation or utilization, through which electric energy in bulk is passed for the purposes of switching or modifying its characteristics. + """ + + def __init__(self, Region=None, VoltageLevels=None, Bays=None, *args, **kw_args): + """Initialises a new 'Substation' instance. + + @param Region: The association is used in the naming hierarchy. + @param VoltageLevels: The association is used in the naming hierarchy. + @param Bays: The association is used in the naming hierarchy. + """ + self._Region = None + self.Region = Region + + self._VoltageLevels = [] + self.VoltageLevels = [] if VoltageLevels is None else VoltageLevels + + self._Bays = [] + self.Bays = [] if Bays is None else Bays + + super(Substation, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Region", "VoltageLevels", "Bays"] + _many_refs = ["VoltageLevels", "Bays"] + + def getRegion(self): + """The association is used in the naming hierarchy. + """ + return self._Region + + def setRegion(self, value): + if self._Region is not None: + filtered = [x for x in self.Region.Substations if x != self] + self._Region._Substations = filtered + + self._Region = value + if self._Region is not None: + if self not in self._Region._Substations: + self._Region._Substations.append(self) + + Region = property(getRegion, setRegion) + + def getVoltageLevels(self): + """The association is used in the naming hierarchy. + """ + return self._VoltageLevels + + def setVoltageLevels(self, value): + for x in self._VoltageLevels: + x.Substation = None + for y in value: + y._Substation = self + self._VoltageLevels = value + + VoltageLevels = property(getVoltageLevels, setVoltageLevels) + + def addVoltageLevels(self, *VoltageLevels): + for obj in VoltageLevels: + obj.Substation = self + + def removeVoltageLevels(self, *VoltageLevels): + for obj in VoltageLevels: + obj.Substation = None + + def getBays(self): + """The association is used in the naming hierarchy. + """ + return self._Bays + + def setBays(self, value): + for x in self._Bays: + x.Substation = None + for y in value: + y._Substation = self + self._Bays = value + + Bays = property(getBays, setBays) + + def addBays(self, *Bays): + for obj in Bays: + obj.Substation = self + + def removeBays(self, *Bays): + for obj in Bays: + obj.Substation = None + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/Terminal.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/Terminal.py new file mode 100644 index 00000000..d9ae7beb --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/Terminal.py @@ -0,0 +1,111 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Terminal(IdentifiedObject): + """An electrical connection point to a piece of conducting equipment. Terminals are connected at physical connection points called 'connectivity nodes'. + """ + + def __init__(self, phases="s12N", ConnectivityNode=None, TransformerEnd=None, ConductingEquipment=None, *args, **kw_args): + """Initialises a new 'Terminal' instance. + + @param phases: Represents the normal network phasing condition. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param ConnectivityNode: Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + @param TransformerEnd: All transformer ends connected at this external terminal. + @param ConductingEquipment: ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + """ + #: Represents the normal network phasing condition. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.phases = phases + + self._ConnectivityNode = None + self.ConnectivityNode = ConnectivityNode + + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + self._ConductingEquipment = None + self.ConductingEquipment = ConductingEquipment + + super(Terminal, self).__init__(*args, **kw_args) + + _attrs = ["phases"] + _attr_types = {"phases": str} + _defaults = {"phases": "s12N"} + _enums = {"phases": "PhaseCode"} + _refs = ["ConnectivityNode", "TransformerEnd", "ConductingEquipment"] + _many_refs = ["TransformerEnd"] + + def getConnectivityNode(self): + """Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + """ + return self._ConnectivityNode + + def setConnectivityNode(self, value): + if self._ConnectivityNode is not None: + filtered = [x for x in self.ConnectivityNode.Terminals if x != self] + self._ConnectivityNode._Terminals = filtered + + self._ConnectivityNode = value + if self._ConnectivityNode is not None: + if self not in self._ConnectivityNode._Terminals: + self._ConnectivityNode._Terminals.append(self) + + ConnectivityNode = property(getConnectivityNode, setConnectivityNode) + + def getTransformerEnd(self): + """All transformer ends connected at this external terminal. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.Terminal = None + for y in value: + y._Terminal = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.Terminal = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.Terminal = None + + def getConductingEquipment(self): + """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + """ + return self._ConductingEquipment + + def setConductingEquipment(self, value): + if self._ConductingEquipment is not None: + filtered = [x for x in self.ConductingEquipment.Terminals if x != self] + self._ConductingEquipment._Terminals = filtered + + self._ConductingEquipment = value + if self._ConductingEquipment is not None: + if self not in self._ConductingEquipment._Terminals: + self._ConductingEquipment._Terminals.append(self) + + ConductingEquipment = property(getConductingEquipment, setConductingEquipment) + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/VoltageLevel.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/VoltageLevel.py new file mode 100644 index 00000000..e3f83cf2 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/VoltageLevel.py @@ -0,0 +1,115 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class VoltageLevel(EquipmentContainer): + """A collection of equipment at one common system voltage forming a switchgear. The equipment typically consist of breakers, busbars, instrumentation, control, regulation and protection devices as well as assemblies of all these. + """ + + def __init__(self, lowVoltageLimit=0.0, highVoltageLimit=0.0, Bays=None, BaseVoltage=None, Substation=None, *args, **kw_args): + """Initialises a new 'VoltageLevel' instance. + + @param lowVoltageLimit: The bus bar's low voltage limit + @param highVoltageLimit: The bus bar's high voltage limit + @param Bays: The association is used in the naming hierarchy. + @param BaseVoltage: The base voltage used for all equipment within the VoltageLevel. + @param Substation: The association is used in the naming hierarchy. + """ + #: The bus bar's low voltage limit + self.lowVoltageLimit = lowVoltageLimit + + #: The bus bar's high voltage limit + self.highVoltageLimit = highVoltageLimit + + self._Bays = [] + self.Bays = [] if Bays is None else Bays + + self._BaseVoltage = None + self.BaseVoltage = BaseVoltage + + self._Substation = None + self.Substation = Substation + + super(VoltageLevel, self).__init__(*args, **kw_args) + + _attrs = ["lowVoltageLimit", "highVoltageLimit"] + _attr_types = {"lowVoltageLimit": float, "highVoltageLimit": float} + _defaults = {"lowVoltageLimit": 0.0, "highVoltageLimit": 0.0} + _enums = {} + _refs = ["Bays", "BaseVoltage", "Substation"] + _many_refs = ["Bays"] + + def getBays(self): + """The association is used in the naming hierarchy. + """ + return self._Bays + + def setBays(self, value): + for x in self._Bays: + x.VoltageLevel = None + for y in value: + y._VoltageLevel = self + self._Bays = value + + Bays = property(getBays, setBays) + + def addBays(self, *Bays): + for obj in Bays: + obj.VoltageLevel = self + + def removeBays(self, *Bays): + for obj in Bays: + obj.VoltageLevel = None + + def getBaseVoltage(self): + """The base voltage used for all equipment within the VoltageLevel. + """ + return self._BaseVoltage + + def setBaseVoltage(self, value): + if self._BaseVoltage is not None: + filtered = [x for x in self.BaseVoltage.VoltageLevel if x != self] + self._BaseVoltage._VoltageLevel = filtered + + self._BaseVoltage = value + if self._BaseVoltage is not None: + if self not in self._BaseVoltage._VoltageLevel: + self._BaseVoltage._VoltageLevel.append(self) + + BaseVoltage = property(getBaseVoltage, setBaseVoltage) + + def getSubstation(self): + """The association is used in the naming hierarchy. + """ + return self._Substation + + def setSubstation(self, value): + if self._Substation is not None: + filtered = [x for x in self.Substation.VoltageLevels if x != self] + self._Substation._VoltageLevels = filtered + + self._Substation = value + if self._Substation is not None: + if self not in self._Substation._VoltageLevels: + self._Substation._VoltageLevels.append(self) + + Substation = property(getSubstation, setSubstation) + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Core/__init__.py b/CIM14/CDPSM/Connectivity/IEC61970/Core/__init__.py new file mode 100644 index 00000000..3c48eed6 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Core/__init__.py @@ -0,0 +1,50 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""Contains the core PowerSystemResource and ConductingEquipment entities shared by all applications plus common collections of those entities. Not all applications require all the Core entities. This package does not depend on any other package except the Domain package, but most of the other packages have associations and generalizations that depend on it. +""" + +from CIM14.CDPSM.Connectivity.IEC61970.Core.Terminal import Terminal +from CIM14.CDPSM.Connectivity.IEC61970.Core.Bay import Bay +from CIM14.CDPSM.Connectivity.IEC61970.Core.NameTypeAuthority import NameTypeAuthority +from CIM14.CDPSM.Connectivity.IEC61970.Core.VoltageLevel import VoltageLevel +from CIM14.CDPSM.Connectivity.IEC61970.Core.SubGeographicalRegion import SubGeographicalRegion +from CIM14.CDPSM.Connectivity.IEC61970.Core.PSRType import PSRType +from CIM14.CDPSM.Connectivity.IEC61970.Core.EquipmentContainer import EquipmentContainer +from CIM14.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment +from CIM14.CDPSM.Connectivity.IEC61970.Core.GeographicalRegion import GeographicalRegion +from CIM14.CDPSM.Connectivity.IEC61970.Core.NameType import NameType +from CIM14.CDPSM.Connectivity.IEC61970.Core.Equipment import Equipment +from CIM14.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject +from CIM14.CDPSM.Connectivity.IEC61970.Core.ConnectivityNodeContainer import ConnectivityNodeContainer +from CIM14.CDPSM.Connectivity.IEC61970.Core.Substation import Substation +from CIM14.CDPSM.Connectivity.IEC61970.Core.ConnectivityNode import ConnectivityNode +from CIM14.CDPSM.Connectivity.IEC61970.Core.Name import Name +from CIM14.CDPSM.Connectivity.IEC61970.Core.BaseVoltage import BaseVoltage +from CIM14.CDPSM.Connectivity.IEC61970.Core.PowerSystemResource import PowerSystemResource + +nsURI = "http://iec.ch/TC57/2009/CIM-schema-cim14?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Connectivity#Core" +nsPrefix = "cimCore" + + +class PhaseCode(str): + """Values are: s12N, BN, BC, ABN, s2N, N, ACN, BCN, ABCN, AC, s1N, AN, B, AB, C, A, CN, ABC + """ + pass diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/ACLineSegment.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/ACLineSegment.py new file mode 100644 index 00000000..c9b55a5c --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/ACLineSegment.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Wires.Conductor import Conductor + +class ACLineSegment(Conductor): + """A wire or combination of wires, with consistent electrical characteristics, building a single electrical system, used to carry alternating current between points in the power system. For symmetrical, transposed 3ph lines, it is sufficient to use ACLineSegment attributes, which describe sequence impedances and admittances for the entire length of the segment. If per lenght impedance data is available from a library of standard types, impedances and admittances can be calculated in one of the following ways: - calculate electrical parameters from asset data, using associated ConductorInfo, with values then multiplied by Conductor.length to produce a matrix model. - calculate unbalanced electrical parameters from associated PerLengthPhaseImpedance, then multiplied by Conductor.length to produce a matrix model. - calculate transposed electrical parameters from associated PerLengthSequenceImpedance, then multiplied by Conductor.length to produce a sequence model. + """ + + def __init__(self, BaseVoltage=None, *args, **kw_args): + """Initialises a new 'ACLineSegment' instance. + + @param BaseVoltage: Use association to ConductingEquipment only when there is no VoltageLevel container used. + """ + self._BaseVoltage = None + self.BaseVoltage = BaseVoltage + + super(ACLineSegment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["BaseVoltage"] + _many_refs = [] + + def getBaseVoltage(self): + """Use association to ConductingEquipment only when there is no VoltageLevel container used. + """ + return self._BaseVoltage + + def setBaseVoltage(self, value): + if self._BaseVoltage is not None: + filtered = [x for x in self.BaseVoltage.ConductingEquipment if x != self] + self._BaseVoltage._ConductingEquipment = filtered + + self._BaseVoltage = value + if self._BaseVoltage is not None: + if self not in self._BaseVoltage._ConductingEquipment: + self._BaseVoltage._ConductingEquipment.append(self) + + BaseVoltage = property(getBaseVoltage, setBaseVoltage) + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/Breaker.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Breaker.py new file mode 100644 index 00000000..ae8a63ab --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Breaker.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch + +class Breaker(Switch): + """A mechanical switching device capable of making, carrying, and breaking currents under normal circuit conditions and also making, carrying for a specified time, and breaking currents under specified abnormal circuit conditions e.g. those of short circuit. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Breaker' instance. + + """ + super(Breaker, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/BusbarSection.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/BusbarSection.py new file mode 100644 index 00000000..7a7960f6 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/BusbarSection.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class BusbarSection(ConductingEquipment): + """A conductor, or group of conductors, with negligible impedance, that serve to connect other conducting equipment within a single substation. Voltage measurements are typically obtained from VoltageTransformers that are connected to busbar sections. A bus bar section may have many physical terminals but for analysis is modelled with exactly one logical terminal. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'BusbarSection' instance. + + """ + super(BusbarSection, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/Conductor.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Conductor.py new file mode 100644 index 00000000..c0cb0c8f --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Conductor.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Conductor(ConductingEquipment): + """Combination of conducting material with consistent electrical characteristics, building a single electrical system, used to carry current between points in the power system. + """ + + def __init__(self, length=0.0, *args, **kw_args): + """Initialises a new 'Conductor' instance. + + @param length: Segment length for calculating line section capabilities + """ + #: Segment length for calculating line section capabilities + self.length = length + + super(Conductor, self).__init__(*args, **kw_args) + + _attrs = ["length"] + _attr_types = {"length": float} + _defaults = {"length": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/DCLineSegment.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/DCLineSegment.py new file mode 100644 index 00000000..affa7b0f --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/DCLineSegment.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Wires.Conductor import Conductor + +class DCLineSegment(Conductor): + """A wire or combination of wires not insulated from one another, with consistent electrical characteristics, used to carry direct current between points in the DC region of the power system. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'DCLineSegment' instance. + + """ + super(DCLineSegment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/Disconnector.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Disconnector.py new file mode 100644 index 00000000..fc07f848 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Disconnector.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch + +class Disconnector(Switch): + """A manually operated or motor operated mechanical switching device used for changing the connections in a circuit, or for isolating a circuit or equipment from a source of power. It is required to open or close circuits when negligible current is broken or made. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Disconnector' instance. + + """ + super(Disconnector, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/EnergyConsumer.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/EnergyConsumer.py new file mode 100644 index 00000000..1eb6cc77 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/EnergyConsumer.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class EnergyConsumer(ConductingEquipment): + """Generic user of energy - a point of consumption on the power system model + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'EnergyConsumer' instance. + + """ + super(EnergyConsumer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/EnergySource.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/EnergySource.py new file mode 100644 index 00000000..f06be837 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/EnergySource.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class EnergySource(ConductingEquipment): + """A generic equivalent for an energy supplier on a transmission or distribution voltage level. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'EnergySource' instance. + + """ + super(EnergySource, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/Fuse.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Fuse.py new file mode 100644 index 00000000..d2cc1a63 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Fuse.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch + +class Fuse(Switch): + """An overcurrent protective device with a circuit opening fusible part that is heated and severed by the passage of overcurrent through it. A fuse is considered a switching device because it breaks current. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Fuse' instance. + + """ + super(Fuse, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/Ground.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Ground.py new file mode 100644 index 00000000..6d34e449 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Ground.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Ground(ConductingEquipment): + """A common point for connecting grounded conducting equipment such as shunt capacitors. The power system model can have more than one ground. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Ground' instance. + + """ + super(Ground, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/GroundDisconnector.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/GroundDisconnector.py new file mode 100644 index 00000000..50c5473e --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/GroundDisconnector.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch + +class GroundDisconnector(Switch): + """A manually operated or motor operated mechanical switching device used for isolating a circuit or equipment from Ground. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'GroundDisconnector' instance. + + """ + super(GroundDisconnector, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/Jumper.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Jumper.py new file mode 100644 index 00000000..b458b76c --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Jumper.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch + +class Jumper(Switch): + """A short section of conductor with negligible impedance which can be manually removed and replaced if the circuit is de-energized. Note that zero-impedance branches can be modelled by an ACLineSegment with a zero impedance ConductorType + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Jumper' instance. + + """ + super(Jumper, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/Junction.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Junction.py new file mode 100644 index 00000000..4da4c050 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Junction.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Junction(ConductingEquipment): + """A point where one or more conducting equipments are connected with zero resistance. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Junction' instance. + + """ + super(Junction, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/Line.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Line.py new file mode 100644 index 00000000..7b79ca9a --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Line.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class Line(EquipmentContainer): + """Contains equipment beyond a substation belonging to a power transmission line. + """ + + def __init__(self, Region=None, *args, **kw_args): + """Initialises a new 'Line' instance. + + @param Region: A Line can be contained by a SubGeographical Region. + """ + self._Region = None + self.Region = Region + + super(Line, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Region"] + _many_refs = [] + + def getRegion(self): + """A Line can be contained by a SubGeographical Region. + """ + return self._Region + + def setRegion(self, value): + if self._Region is not None: + filtered = [x for x in self.Region.Lines if x != self] + self._Region._Lines = filtered + + self._Region = value + if self._Region is not None: + if self not in self._Region._Lines: + self._Region._Lines.append(self) + + Region = property(getRegion, setRegion) + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/LoadBreakSwitch.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/LoadBreakSwitch.py new file mode 100644 index 00000000..ed30164e --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/LoadBreakSwitch.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch + +class LoadBreakSwitch(Switch): + """A mechanical switching device capable of making, carrying, and breaking currents under normal operating conditions. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'LoadBreakSwitch' instance. + + """ + super(LoadBreakSwitch, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/PowerTransformer.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/PowerTransformer.py new file mode 100644 index 00000000..dd9f5c79 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/PowerTransformer.py @@ -0,0 +1,91 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class PowerTransformer(ConductingEquipment): + """An electrical device consisting of two or more coupled windings, with or without a magnetic core, for introducing mutual coupling between electric circuits. Transformers can be used to control voltage and phase shift (active power flow). A power transformer may be composed of separate transformer tanks that need not be identical. The same power transformer can be modelled in two ways, namely with and without tanks:
  1. The power transformer that uses power transformer ends directly (without tanks) is suitable for balanced three-phase models. This is typical for transmission and sub-transmission network modelling. Such a transformer will require one power transformer end for each physical winding. There must be a one-to-one association between PowerTransformerEnd and Core::Terminal.
  2. The power transformer that uses transformer tanks is suitable for an unbalanced transformer, a balanced transformer within a single tank, or a balanced transformer made up of three tanks. This is typical for distribution network modelling and the only choice when modelling an unbalanced transformer, or a transformer that has more than three windings. Power transformer modelled with tanks will require for each tank, one transformer tank end per physical winding in the tank. There may be one, two, or three phases in the transformer tank end. Examples: 3 phases for 3-phase delta or wye connected windings, 2 for one phase-to-phase winding, and 1 for a phase-to-neutral or phase-to-ground winding. With 1 or 2 phases, more than one transformer tank end may be associated to the same 3-phase Core::Terminal instance, while with 3 phases there should be a one-to-one association.
This power transformer model is flexible in order to support different kinds of data exchange requirements. There are 5 possible ways to combine available classes and their attributes:
  1. Instance parameters - Use the r, x, r0, x0, b, b0, g, and g0 attributes on PowerTransformerEnd and ignore related TransformerStarImpedance, TransformerMeshImpedance, or TransformerCoreAdmittance. This option assumes a star connection of the series impedances. It is suitable for typical transmission, balanced three-phase transformer models, for transformers with 2 or three windings.
  2. Star instance parameters by association - Instead of the r, x, r0, x0, b, b0, g, and g0 attributes, use associations to TransformerStarImpedance and TransformerCoreAdmitance. This option is suitable in same scenarios as option 1, but when catalogue data is available for transformers.
  3. Mesh instance parameters by association: Instead of the r, x, r0, x0, b, b0, g, and g0 attributes, use associations to TransformerMeshImpedance and TransformerCoreAdmittance. This option supports transformers with more than three windings.
  4. Catalog mesh parameters by association - Instead of attributes r, x, r0, x0, b, b0, g, and g0 and associations to TransformerStarImpedance, TransformerMeshImpedance, or TransformerCoreAdmittance, use the association to TransformerEndInfo. The TransformerEnd.endNumber should match the corresponding TransformerEndInfo.endNumber, following the IEC standard convention of numbering from the highest voltage ends to the lowest, starting at 1. This matching supports higher-level use of a catalog, through just one association between TransformerTank and TransformerTankInfo, with simpler exchanges and incremental updates. The associated TransformerEndInfo will have associations to TransformerMeshImpedance and TransformerCoreAdmittance. This option supports unbalanced transformer, with more than three windings and is suitable whenever the transformer test data has been converted to an electrical model.
  5. Catalog test data by association - This is the same as option 4, except TransformerEndInfo will have associations to AssetModels::TransformerTest decendents, instead of to TransformerMeshImpedance and TransformerCoreAdmittance. This option is suitable when the test data is available, and the receiving application is able to interpret the test data.
Every profile should specify which one or more of these options are supported. + """ + + def __init__(self, TransformerTanks=None, PowerTransformerEnd=None, *args, **kw_args): + """Initialises a new 'PowerTransformer' instance. + + @param TransformerTanks: All transformers that belong to this bank. + @param PowerTransformerEnd: + """ + self._TransformerTanks = [] + self.TransformerTanks = [] if TransformerTanks is None else TransformerTanks + + self._PowerTransformerEnd = [] + self.PowerTransformerEnd = [] if PowerTransformerEnd is None else PowerTransformerEnd + + super(PowerTransformer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TransformerTanks", "PowerTransformerEnd"] + _many_refs = ["TransformerTanks", "PowerTransformerEnd"] + + def getTransformerTanks(self): + """All transformers that belong to this bank. + """ + return self._TransformerTanks + + def setTransformerTanks(self, value): + for x in self._TransformerTanks: + x.PowerTransformer = None + for y in value: + y._PowerTransformer = self + self._TransformerTanks = value + + TransformerTanks = property(getTransformerTanks, setTransformerTanks) + + def addTransformerTanks(self, *TransformerTanks): + for obj in TransformerTanks: + obj.PowerTransformer = self + + def removeTransformerTanks(self, *TransformerTanks): + for obj in TransformerTanks: + obj.PowerTransformer = None + + def getPowerTransformerEnd(self): + """ + """ + return self._PowerTransformerEnd + + def setPowerTransformerEnd(self, value): + for x in self._PowerTransformerEnd: + x.PowerTransformer = None + for y in value: + y._PowerTransformer = self + self._PowerTransformerEnd = value + + PowerTransformerEnd = property(getPowerTransformerEnd, setPowerTransformerEnd) + + def addPowerTransformerEnd(self, *PowerTransformerEnd): + for obj in PowerTransformerEnd: + obj.PowerTransformer = self + + def removePowerTransformerEnd(self, *PowerTransformerEnd): + for obj in PowerTransformerEnd: + obj.PowerTransformer = None + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/PowerTransformerEnd.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/PowerTransformerEnd.py new file mode 100644 index 00000000..6fedbe33 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/PowerTransformerEnd.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Wires.TransformerEnd import TransformerEnd + +class PowerTransformerEnd(TransformerEnd): + """A PowerTransformerEnd is associated with each Terminal of a PowerTransformer. The impdedance values r, r0, x, and x0 of a PowerTransformerEnd represents a star equivalentas follows 1) for a two Terminal PowerTransformer the high voltage PowerTransformerEnd has non zero values on r, r0, x, and x0 while the low voltage PowerTransformerEnd has zero values for r, r0, x, and x0. 2) for a three Terminal PowerTransformer the three PowerTransformerEnds represents a star equivalent with each leg in the star represented by r, r0, x, and x0 values. 3) for a PowerTransformer with more than three Terminals the PowerTransformerEnd impedance values cannot be used. Instead use the TransformerMeshImpedance or split the transformer into multiple PowerTransformers. + """ + + def __init__(self, PowerTransformer=None, *args, **kw_args): + """Initialises a new 'PowerTransformerEnd' instance. + + @param PowerTransformer: + """ + self._PowerTransformer = None + self.PowerTransformer = PowerTransformer + + super(PowerTransformerEnd, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["PowerTransformer"] + _many_refs = [] + + def getPowerTransformer(self): + + return self._PowerTransformer + + def setPowerTransformer(self, value): + if self._PowerTransformer is not None: + filtered = [x for x in self.PowerTransformer.PowerTransformerEnd if x != self] + self._PowerTransformer._PowerTransformerEnd = filtered + + self._PowerTransformer = value + if self._PowerTransformer is not None: + if self not in self._PowerTransformer._PowerTransformerEnd: + self._PowerTransformer._PowerTransformerEnd.append(self) + + PowerTransformer = property(getPowerTransformer, setPowerTransformer) + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/Sectionaliser.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Sectionaliser.py new file mode 100644 index 00000000..d22ce750 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Sectionaliser.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch + +class Sectionaliser(Switch): + """Automatic switch that will lock open to isolate a faulted section. It may, or may not, have load breaking capability. Its primary purpose is to provide fault sectionalising at locations where the fault current is either too high, or too low, for proper coordination of fuses. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'Sectionaliser' instance. + + """ + super(Sectionaliser, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/SeriesCompensator.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/SeriesCompensator.py new file mode 100644 index 00000000..d5f7de7d --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/SeriesCompensator.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class SeriesCompensator(ConductingEquipment): + """A Series Compensator is a series capacitor or reactor or an AC transmission line without charging susceptance. It is a two terminal device. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'SeriesCompensator' instance. + + """ + super(SeriesCompensator, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/ShuntCompensator.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/ShuntCompensator.py new file mode 100644 index 00000000..5e8b9104 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/ShuntCompensator.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class ShuntCompensator(ConductingEquipment): + """A shunt capacitor or reactor or switchable bank of shunt capacitors or reactors. A section of a shunt compensator is an individual capacitor or reactor. A negative value for reactivePerSection indicates that the compensator is a reactor. ShuntCompensator is a single terminal device. Ground is implied. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'ShuntCompensator' instance. + + """ + super(ShuntCompensator, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/Switch.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Switch.py new file mode 100644 index 00000000..6d2c853a --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/Switch.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class Switch(ConductingEquipment): + """A generic device designed to close, or open, or both, one or more electric circuits. + """ + + def __init__(self, normalOpen=False, *args, **kw_args): + """Initialises a new 'Switch' instance. + + @param normalOpen: The attribute is used in cases when no Measurement for the status value is present. If the Switch has a status measurment the Discrete.normalValue is expected to match with the Switch.normalOpen. + """ + #: The attribute is used in cases when no Measurement for the status value is present. If the Switch has a status measurment the Discrete.normalValue is expected to match with the Switch.normalOpen. + self.normalOpen = normalOpen + + super(Switch, self).__init__(*args, **kw_args) + + _attrs = ["normalOpen"] + _attr_types = {"normalOpen": bool} + _defaults = {"normalOpen": False} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/SynchronousMachine.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/SynchronousMachine.py new file mode 100644 index 00000000..ec950f60 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/SynchronousMachine.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.ConductingEquipment import ConductingEquipment + +class SynchronousMachine(ConductingEquipment): + """An electromechanical device that operates synchronously with the network. It is a single machine operating either as a generator or synchronous condenser or pump. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'SynchronousMachine' instance. + + """ + super(SynchronousMachine, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/TransformerEnd.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/TransformerEnd.py new file mode 100644 index 00000000..b636abae --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/TransformerEnd.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class TransformerEnd(IdentifiedObject): + """TransformerEnd is a conducting connection point of a power transformer. It corresponds to a physical transformer winding terminal. In earlier CIM versions, the TransformerWinding class served a similar purpose. This successor TransformerEnd class is more flexible and has important differences with TransformerWinding. + """ + + def __init__(self, Terminal=None, *args, **kw_args): + """Initialises a new 'TransformerEnd' instance. + + @param Terminal: External terminal of the power transformer to which this end belongs. + """ + self._Terminal = None + self.Terminal = Terminal + + super(TransformerEnd, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Terminal"] + _many_refs = [] + + def getTerminal(self): + """External terminal of the power transformer to which this end belongs. + """ + return self._Terminal + + def setTerminal(self, value): + if self._Terminal is not None: + filtered = [x for x in self.Terminal.TransformerEnd if x != self] + self._Terminal._TransformerEnd = filtered + + self._Terminal = value + if self._Terminal is not None: + if self not in self._Terminal._TransformerEnd: + self._Terminal._TransformerEnd.append(self) + + Terminal = property(getTerminal, setTerminal) + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/TransformerTank.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/TransformerTank.py new file mode 100644 index 00000000..5fb2d5a5 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/TransformerTank.py @@ -0,0 +1,86 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.Equipment import Equipment + +class TransformerTank(Equipment): + """An assembly of two or more coupled windings that transform electrical power between voltage levels. These windings are bound on a common core and place in the same tank. Transformer tank can be used to model both single-phase and 3-phase transformers. + """ + + def __init__(self, PowerTransformer=None, TransformerTankEnds=None, *args, **kw_args): + """Initialises a new 'TransformerTank' instance. + + @param PowerTransformer: Bank this transformer belongs to. + @param TransformerTankEnds: All windings of this transformer. + """ + self._PowerTransformer = None + self.PowerTransformer = PowerTransformer + + self._TransformerTankEnds = [] + self.TransformerTankEnds = [] if TransformerTankEnds is None else TransformerTankEnds + + super(TransformerTank, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["PowerTransformer", "TransformerTankEnds"] + _many_refs = ["TransformerTankEnds"] + + def getPowerTransformer(self): + """Bank this transformer belongs to. + """ + return self._PowerTransformer + + def setPowerTransformer(self, value): + if self._PowerTransformer is not None: + filtered = [x for x in self.PowerTransformer.TransformerTanks if x != self] + self._PowerTransformer._TransformerTanks = filtered + + self._PowerTransformer = value + if self._PowerTransformer is not None: + if self not in self._PowerTransformer._TransformerTanks: + self._PowerTransformer._TransformerTanks.append(self) + + PowerTransformer = property(getPowerTransformer, setPowerTransformer) + + def getTransformerTankEnds(self): + """All windings of this transformer. + """ + return self._TransformerTankEnds + + def setTransformerTankEnds(self, value): + for x in self._TransformerTankEnds: + x.TransformerTank = None + for y in value: + y._TransformerTank = self + self._TransformerTankEnds = value + + TransformerTankEnds = property(getTransformerTankEnds, setTransformerTankEnds) + + def addTransformerTankEnds(self, *TransformerTankEnds): + for obj in TransformerTankEnds: + obj.TransformerTank = self + + def removeTransformerTankEnds(self, *TransformerTankEnds): + for obj in TransformerTankEnds: + obj.TransformerTank = None + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/TransformerTankEnd.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/TransformerTankEnd.py new file mode 100644 index 00000000..b6ee66ff --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/TransformerTankEnd.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Wires.TransformerEnd import TransformerEnd + +class TransformerTankEnd(TransformerEnd): + """Transformer tank end represents an individual winding for unbalanced models or for transformer tanks connected into a bank (and bank is modelled with the PowerTransformer). + """ + + def __init__(self, phases="s12N", TransformerTank=None, *args, **kw_args): + """Initialises a new 'TransformerTankEnd' instance. + + @param phases: Describes the phases carried by a conducting equipment. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param TransformerTank: Transformer this winding belongs to. + """ + #: Describes the phases carried by a conducting equipment. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.phases = phases + + self._TransformerTank = None + self.TransformerTank = TransformerTank + + super(TransformerTankEnd, self).__init__(*args, **kw_args) + + _attrs = ["phases"] + _attr_types = {"phases": str} + _defaults = {"phases": "s12N"} + _enums = {"phases": "PhaseCode"} + _refs = ["TransformerTank"] + _many_refs = [] + + def getTransformerTank(self): + """Transformer this winding belongs to. + """ + return self._TransformerTank + + def setTransformerTank(self, value): + if self._TransformerTank is not None: + filtered = [x for x in self.TransformerTank.TransformerTankEnds if x != self] + self._TransformerTank._TransformerTankEnds = filtered + + self._TransformerTank = value + if self._TransformerTank is not None: + if self not in self._TransformerTank._TransformerTankEnds: + self._TransformerTank._TransformerTankEnds.append(self) + + TransformerTank = property(getTransformerTank, setTransformerTank) + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/Wires/__init__.py b/CIM14/CDPSM/Connectivity/IEC61970/Wires/__init__.py new file mode 100644 index 00000000..f25dac77 --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/Wires/__init__.py @@ -0,0 +1,52 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""An extension to the Core and Topology package that models information on the electrical characteristics of Transmission and Distribution networks. This package is used by network applications such as State Estimation, Load Flow and Optimal Power Flow. +""" + +from CIM14.CDPSM.Connectivity.IEC61970.Wires.Fuse import Fuse +from CIM14.CDPSM.Connectivity.IEC61970.Wires.EnergyConsumer import EnergyConsumer +from CIM14.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch +from CIM14.CDPSM.Connectivity.IEC61970.Wires.Disconnector import Disconnector +from CIM14.CDPSM.Connectivity.IEC61970.Wires.ACLineSegment import ACLineSegment +from CIM14.CDPSM.Connectivity.IEC61970.Wires.SynchronousMachine import SynchronousMachine +from CIM14.CDPSM.Connectivity.IEC61970.Wires.BusbarSection import BusbarSection +from CIM14.CDPSM.Connectivity.IEC61970.Wires.LoadBreakSwitch import LoadBreakSwitch +from CIM14.CDPSM.Connectivity.IEC61970.Wires.TransformerTank import TransformerTank +from CIM14.CDPSM.Connectivity.IEC61970.Wires.GroundDisconnector import GroundDisconnector +from CIM14.CDPSM.Connectivity.IEC61970.Wires.PowerTransformerEnd import PowerTransformerEnd +from CIM14.CDPSM.Connectivity.IEC61970.Wires.Junction import Junction +from CIM14.CDPSM.Connectivity.IEC61970.Wires.SeriesCompensator import SeriesCompensator +from CIM14.CDPSM.Connectivity.IEC61970.Wires.Breaker import Breaker +from CIM14.CDPSM.Connectivity.IEC61970.Wires.TransformerTankEnd import TransformerTankEnd +from CIM14.CDPSM.Connectivity.IEC61970.Wires.Sectionaliser import Sectionaliser +from CIM14.CDPSM.Connectivity.IEC61970.Wires.DCLineSegment import DCLineSegment +from CIM14.CDPSM.Connectivity.IEC61970.Wires.Line import Line +from CIM14.CDPSM.Connectivity.IEC61970.Wires.Conductor import Conductor +from CIM14.CDPSM.Connectivity.IEC61970.Wires.PowerTransformer import PowerTransformer +from CIM14.CDPSM.Connectivity.IEC61970.Wires.Ground import Ground +from CIM14.CDPSM.Connectivity.IEC61970.Wires.TransformerEnd import TransformerEnd +from CIM14.CDPSM.Connectivity.IEC61970.Wires.ShuntCompensator import ShuntCompensator +from CIM14.CDPSM.Connectivity.IEC61970.Wires.EnergySource import EnergySource +from CIM14.CDPSM.Connectivity.IEC61970.Wires.Jumper import Jumper + +nsURI = "http://iec.ch/TC57/2009/CIM-schema-cim14?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Connectivity#Wires" +nsPrefix = "cimWires" + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/WiresPhaseModel/ShuntCompensatorPhase.py b/CIM14/CDPSM/Connectivity/IEC61970/WiresPhaseModel/ShuntCompensatorPhase.py new file mode 100644 index 00000000..b5612edc --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/WiresPhaseModel/ShuntCompensatorPhase.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class ShuntCompensatorPhase(PowerSystemResource): + """Single phase of a multi-phase shunt compensator when its attributes might be different per phase. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'ShuntCompensatorPhase' instance. + + """ + super(ShuntCompensatorPhase, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/WiresPhaseModel/SwitchPhase.py b/CIM14/CDPSM/Connectivity/IEC61970/WiresPhaseModel/SwitchPhase.py new file mode 100644 index 00000000..7f8b0d4f --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/WiresPhaseModel/SwitchPhase.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM15.CDPSM.Connectivity.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class SwitchPhase(PowerSystemResource): + """Single phase of a multi-phase switch when its attributes might be different per phase. + """ + + def __init__(self, *args, **kw_args): + """Initialises a new 'SwitchPhase' instance. + + """ + super(SwitchPhase, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM14/CDPSM/Connectivity/IEC61970/WiresPhaseModel/__init__.py b/CIM14/CDPSM/Connectivity/IEC61970/WiresPhaseModel/__init__.py new file mode 100644 index 00000000..2eeb012a --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/WiresPhaseModel/__init__.py @@ -0,0 +1,32 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +from CIM14.CDPSM.Connectivity.IEC61970.WiresPhaseModel.ShuntCompensatorPhase import ShuntCompensatorPhase +from CIM14.CDPSM.Connectivity.IEC61970.WiresPhaseModel.SwitchPhase import SwitchPhase + +nsURI = "http://iec.ch/TC57/2009/CIM-schema-cim14?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Connectivity#WiresPhaseModel" +nsPrefix = "cimWiresPhaseModel" + + +class SinglePhaseKind(str): + """Values are: C, N, s1, B, s2, A + """ + pass diff --git a/CIM14/CDPSM/Connectivity/IEC61970/__init__.py b/CIM14/CDPSM/Connectivity/IEC61970/__init__.py new file mode 100644 index 00000000..5221d20f --- /dev/null +++ b/CIM14/CDPSM/Connectivity/IEC61970/__init__.py @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The ControlArea package models area specifications which can be used for a variety of purposes. The package as a whole models potentially overlapping control area specifications for the purpose of actual generation control, load forecast area load capture, or powerflow based analysis. +""" + + +nsURI = "http://iec.ch/TC57/2009/CIM-schema-cim14?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Connectivity#IEC61970" +nsPrefix = "cimIEC61970" + diff --git a/CIM14/CDPSM/Connectivity/__init__.py b/CIM14/CDPSM/Connectivity/__init__.py new file mode 100644 index 00000000..e3ddf7eb --- /dev/null +++ b/CIM14/CDPSM/Connectivity/__init__.py @@ -0,0 +1,114 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""The IEC 61968 subpackages of the CIM are developed, standardized and maintained by IEC TC57 Working Group 14: interfaces for distribution management (WG14). Currently, normative parts of the model support the needs of information exchange defined in IEC 61968-9 and in IEC 61968-13. +""" + +from CIM14.CDPSM.Connectivity.Element import Element + +nsURI = "http://iec.ch/TC57/2009/CIM-schema-cim14?profile=http://iec.ch/TC57/2011/iec61968-13/CDPSM/Connectivity" +nsPrefix = "conn" + +packageMap = { + "Element": "CIM14.CDPSM.Connectivity", + "Fuse": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "EnergyConsumer": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "Switch": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "Disconnector": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "ACLineSegment": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "SynchronousMachine": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "BusbarSection": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "LoadBreakSwitch": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "TransformerTank": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "GroundDisconnector": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "PowerTransformerEnd": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "Junction": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "SeriesCompensator": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "Breaker": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "TransformerTankEnd": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "Sectionaliser": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "DCLineSegment": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "Line": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "Conductor": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "PowerTransformer": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "Ground": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "TransformerEnd": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "ShuntCompensator": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "EnergySource": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "Jumper": "CIM14.CDPSM.Connectivity.IEC61970.Wires", + "ShuntCompensatorPhase": "CIM14.CDPSM.Connectivity.IEC61970.WiresPhaseModel", + "SwitchPhase": "CIM14.CDPSM.Connectivity.IEC61970.WiresPhaseModel", + "Terminal": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "Bay": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "NameTypeAuthority": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "VoltageLevel": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "SubGeographicalRegion": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "PSRType": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "EquipmentContainer": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "ConductingEquipment": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "GeographicalRegion": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "NameType": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "Equipment": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "IdentifiedObject": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "ConnectivityNodeContainer": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "Substation": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "ConnectivityNode": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "Name": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "BaseVoltage": "CIM14.CDPSM.Connectivity.IEC61970.Core", + "PowerSystemResource": "CIM14.CDPSM.Connectivity.IEC61970.Core", +} + + +class Length(float): + """Unit of length. + """ + pass + +class Voltage(float): + """Electrical voltage. + """ + pass + +class CIMTime(str): + pass + +class CIMDateTime(str): + pass + +class CIMDuration(str): + pass + +class CIMGYear(str): + pass + +class CIMDate(str): + pass + +class CIMGMonthDay(str): + pass + +class CIMGMonth(str): + pass + +class CIMGDay(str): + pass + +class CIMGYearMonth(str): + pass diff --git a/CIM16/IEC61970/Base/Core/BasePower.py b/CIM16/IEC61970/Base/Core/BasePower.py new file mode 100755 index 00000000..e1b0a214 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/BasePower.py @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class BasePower(IdentifiedObject): + """The BasePower class defines the base power used in the per unit calculations.The BasePower class defines the base power used in the per unit calculations. + """ + + def __init__(self, basePower=0.0, *args, **kw_args): + """Initialises a new 'BasePower' instance. + + @param basePower: Definition of base power. + """ + #: Definition of base power. + self.basePower = basePower + + super(BasePower, self).__init__(*args, **kw_args) + + _attrs = ["basePower"] + _attr_types = {"basePower": float} + _defaults = {"basePower": 0.0} + _enums = {} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Base/Core/BaseVoltage.py b/CIM16/IEC61970/Base/Core/BaseVoltage.py new file mode 100755 index 00000000..8a9dc20e --- /dev/null +++ b/CIM16/IEC61970/Base/Core/BaseVoltage.py @@ -0,0 +1,147 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class BaseVoltage(IdentifiedObject): + """Defines a nominal base voltage which is referenced in the system.Defines a nominal base voltage which is referenced in the system. + """ + + def __init__(self, nominalVoltage=0.0, isDC=False, TopologicalNode=None, VoltageLevel=None, ConductingEquipment=None, TransformerEnd=None, *args, **kw_args): + """Initialises a new 'BaseVoltage' instance. + + @param nominalVoltage: The PowerSystemResource's base voltage. + @param isDC: If true, this is a direct current base voltage and items assigned to this base voltage are also associated with a direct current capabilities. False indicates alternating current. + @param TopologicalNode: The topological nodes at the base voltage. + @param VoltageLevel: The VoltageLevels having this BaseVoltage. + @param ConductingEquipment: Use association to ConductingEquipment only when there is no VoltageLevel container used. + """ + #: The PowerSystemResource's base voltage. + self.nominalVoltage = nominalVoltage + + #: If true, this is a direct current base voltage and items assigned to this base voltage are also associated with a direct current capabilities. False indicates alternating current. + self.isDC = isDC + + self._TopologicalNode = [] + self.TopologicalNode = [] if TopologicalNode is None else TopologicalNode + + self._VoltageLevel = [] + self.VoltageLevel = [] if VoltageLevel is None else VoltageLevel + + self._ConductingEquipment = [] + self.ConductingEquipment = [] if ConductingEquipment is None else ConductingEquipment + + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + super(BaseVoltage, self).__init__(*args, **kw_args) + + _attrs = ["nominalVoltage", "isDC"] + _attr_types = {"nominalVoltage": float, "isDC": bool} + _defaults = {"nominalVoltage": 0.0, "isDC": False} + _enums = {} + _refs = ["TopologicalNode", "VoltageLevel", "ConductingEquipment", "TransformerEnd"] + _many_refs = ["TopologicalNode", "VoltageLevel", "ConductingEquipment", "TransformerEnd"] + + def getTopologicalNode(self): + """The topological nodes at the base voltage. + """ + return self._TopologicalNode + + def setTopologicalNode(self, value): + for x in self._TopologicalNode: + x.BaseVoltage = None + for y in value: + y._BaseVoltage = self + self._TopologicalNode = value + + TopologicalNode = property(getTopologicalNode, setTopologicalNode) + + def addTopologicalNode(self, *TopologicalNode): + for obj in TopologicalNode: + obj.BaseVoltage = self + + def removeTopologicalNode(self, *TopologicalNode): + for obj in TopologicalNode: + obj.BaseVoltage = None + + def getVoltageLevel(self): + """The VoltageLevels having this BaseVoltage. + """ + return self._VoltageLevel + + def setVoltageLevel(self, value): + for x in self._VoltageLevel: + x.BaseVoltage = None + for y in value: + y._BaseVoltage = self + self._VoltageLevel = value + + VoltageLevel = property(getVoltageLevel, setVoltageLevel) + + def addVoltageLevel(self, *VoltageLevel): + for obj in VoltageLevel: + obj.BaseVoltage = self + + def removeVoltageLevel(self, *VoltageLevel): + for obj in VoltageLevel: + obj.BaseVoltage = None + + def getConductingEquipment(self): + """Use association to ConductingEquipment only when there is no VoltageLevel container used. + """ + return self._ConductingEquipment + + def setConductingEquipment(self, value): + for x in self._ConductingEquipment: + x.BaseVoltage = None + for y in value: + y._BaseVoltage = self + self._ConductingEquipment = value + + ConductingEquipment = property(getConductingEquipment, setConductingEquipment) + + def addConductingEquipment(self, *ConductingEquipment): + for obj in ConductingEquipment: + obj.BaseVoltage = self + + def removeConductingEquipment(self, *ConductingEquipment): + for obj in ConductingEquipment: + obj.BaseVoltage = None + + def getTransformerEnd(self): + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.BaseVoltage = None + for y in value: + y._BaseVoltage = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.BaseVoltage = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.BaseVoltage = None diff --git a/CIM16/IEC61970/Base/Core/BasicIntervalSchedule.py b/CIM16/IEC61970/Base/Core/BasicIntervalSchedule.py new file mode 100755 index 00000000..210534b9 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/BasicIntervalSchedule.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class BasicIntervalSchedule(IdentifiedObject): + """Schedule of values at points in time.Schedule of values at points in time. + """ + + def __init__(self, startTime='', value1Multiplier="M", value2Unit="N", value1Unit="N", value2Multiplier="M", *args, **kw_args): + """Initialises a new 'BasicIntervalSchedule' instance. + + @param startTime: The time for the first time point. + @param value1Multiplier: Multiplier for value1. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param value2Unit: Value2 units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param value1Unit: Value1 units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param value2Multiplier: Multiplier for value2. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + """ + #: The time for the first time point. + self.startTime = startTime + + #: Multiplier for value1. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.value1Multiplier = value1Multiplier + + #: Value2 units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.value2Unit = value2Unit + + #: Value1 units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.value1Unit = value1Unit + + #: Multiplier for value2. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.value2Multiplier = value2Multiplier + + super(BasicIntervalSchedule, self).__init__(*args, **kw_args) + + _attrs = ["startTime", "value1Multiplier", "value2Unit", "value1Unit", "value2Multiplier"] + _attr_types = {"startTime": str, "value1Multiplier": str, "value2Unit": str, "value1Unit": str, "value2Multiplier": str} + _defaults = {"startTime": '', "value1Multiplier": "M", "value2Unit": "N", "value1Unit": "N", "value2Multiplier": "M"} + _enums = {"value1Multiplier": "UnitMultiplier", "value2Unit": "UnitSymbol", "value1Unit": "UnitSymbol", "value2Multiplier": "UnitMultiplier"} + _refs = [] + _many_refs = [] + diff --git a/CIM16/IEC61970/Base/Core/Bay.py b/CIM16/IEC61970/Base/Core/Bay.py new file mode 100755 index 00000000..ca090ae6 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/Bay.py @@ -0,0 +1,97 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class Bay(EquipmentContainer): + """A collection of power system resources (within a given substation) including conducting equipment, protection relays, measurements, and telemetry.A collection of power system resources (within a given substation) including conducting equipment, protection relays, measurements, and telemetry. + """ + + def __init__(self, bayPowerMeasFlag=False, bayEnergyMeasFlag=False, busBarConfiguration="doubleBus", breakerConfiguration="breakerAndAHalf", VoltageLevel=None, Substation=None, *args, **kw_args): + """Initialises a new 'Bay' instance. + + @param bayPowerMeasFlag: Indicates the presence/absence of active/reactive power measurements. + @param bayEnergyMeasFlag: Indicates the presence/absence of energy measurements. + @param busBarConfiguration: Bus bar configuration. Values are: "doubleBus", "ringBus", "singleBus", "mainWithTransfer" + @param breakerConfiguration: Breaker configuration. Values are: "breakerAndAHalf", "noBreaker", "singleBreaker", "doubleBreaker" + @param VoltageLevel: The association is used in the naming hierarchy. + @param Substation: The association is used in the naming hierarchy. + """ + #: Indicates the presence/absence of active/reactive power measurements. + self.bayPowerMeasFlag = bayPowerMeasFlag + + #: Indicates the presence/absence of energy measurements. + self.bayEnergyMeasFlag = bayEnergyMeasFlag + + #: Bus bar configuration. Values are: "doubleBus", "ringBus", "singleBus", "mainWithTransfer" + self.busBarConfiguration = busBarConfiguration + + #: Breaker configuration. Values are: "breakerAndAHalf", "noBreaker", "singleBreaker", "doubleBreaker" + self.breakerConfiguration = breakerConfiguration + + self._VoltageLevel = None + self.VoltageLevel = VoltageLevel + + self._Substation = None + self.Substation = Substation + + super(Bay, self).__init__(*args, **kw_args) + + _attrs = ["bayPowerMeasFlag", "bayEnergyMeasFlag", "busBarConfiguration", "breakerConfiguration"] + _attr_types = {"bayPowerMeasFlag": bool, "bayEnergyMeasFlag": bool, "busBarConfiguration": str, "breakerConfiguration": str} + _defaults = {"bayPowerMeasFlag": False, "bayEnergyMeasFlag": False, "busBarConfiguration": "doubleBus", "breakerConfiguration": "breakerAndAHalf"} + _enums = {"busBarConfiguration": "BusbarConfiguration", "breakerConfiguration": "BreakerConfiguration"} + _refs = ["VoltageLevel", "Substation"] + _many_refs = [] + + def getVoltageLevel(self): + """The association is used in the naming hierarchy. + """ + return self._VoltageLevel + + def setVoltageLevel(self, value): + if self._VoltageLevel is not None: + filtered = [x for x in self.VoltageLevel.Bays if x != self] + self._VoltageLevel._Bays = filtered + + self._VoltageLevel = value + if self._VoltageLevel is not None: + if self not in self._VoltageLevel._Bays: + self._VoltageLevel._Bays.append(self) + + VoltageLevel = property(getVoltageLevel, setVoltageLevel) + + def getSubstation(self): + """The association is used in the naming hierarchy. + """ + return self._Substation + + def setSubstation(self, value): + if self._Substation is not None: + filtered = [x for x in self.Substation.Bays if x != self] + self._Substation._Bays = filtered + + self._Substation = value + if self._Substation is not None: + if self not in self._Substation._Bays: + self._Substation._Bays.append(self) + + Substation = property(getSubstation, setSubstation) + diff --git a/CIM16/IEC61970/Base/Core/ConductingEquipment.py b/CIM16/IEC61970/Base/Core/ConductingEquipment.py new file mode 100755 index 00000000..7e7276a2 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/ConductingEquipment.py @@ -0,0 +1,189 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.Equipment import Equipment + +class ConductingEquipment(Equipment): + """The parts of the power system that are designed to carry current or that are conductively connected therewith. ConductingEquipment is contained within an EquipmentContainer that may be a Substation, or a VoltageLevel or a Bay within a Substation.The parts of the power system that are designed to carry current or that are conductively connected therewith. ConductingEquipment is contained within an EquipmentContainer that may be a Substation, or a VoltageLevel or a Bay within a Substation. + """ + + def __init__(self, BaseVoltage=None, ClearanceTags=None, ProtectionEquipments=None, Terminals=None, OutageStepRoles=None, SvStatus=None, *args, **kw_args): + """Initialises a new 'ConductingEquipment' instance. + + @param BaseVoltage: Use association to ConductingEquipment only when there is no VoltageLevel container used. + @param ClearanceTags: Conducting equipment may have multiple clearance tags for authorized field work + @param ProtectionEquipments: Protection equipment may be used to protect specific Conducting Equipment. Multiple equipment may be protected or monitored by multiple protection equipment. + @param Terminals: ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + @param OutageStepRoles: + @param SvStatus: The status state associated with the conducting equipment. + """ + self._BaseVoltage = None + self.BaseVoltage = BaseVoltage + + self._ClearanceTags = [] + self.ClearanceTags = [] if ClearanceTags is None else ClearanceTags + + self._ProtectionEquipments = [] + self.ProtectionEquipments = [] if ProtectionEquipments is None else ProtectionEquipments + + self._Terminals = [] + self.Terminals = [] if Terminals is None else Terminals + + self._OutageStepRoles = [] + self.OutageStepRoles = [] if OutageStepRoles is None else OutageStepRoles + + self._SvStatus = None + self.SvStatus = SvStatus + + super(ConductingEquipment, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["BaseVoltage", "ClearanceTags", "ProtectionEquipments", "Terminals", "OutageStepRoles", "SvStatus"] + _many_refs = ["ClearanceTags", "ProtectionEquipments", "Terminals", "OutageStepRoles"] + + def getBaseVoltage(self): + """Use association to ConductingEquipment only when there is no VoltageLevel container used. + """ + return self._BaseVoltage + + def setBaseVoltage(self, value): + if self._BaseVoltage is not None: + filtered = [x for x in self.BaseVoltage.ConductingEquipment if x != self] + self._BaseVoltage._ConductingEquipment = filtered + + self._BaseVoltage = value + if self._BaseVoltage is not None: + if self not in self._BaseVoltage._ConductingEquipment: + self._BaseVoltage._ConductingEquipment.append(self) + + BaseVoltage = property(getBaseVoltage, setBaseVoltage) + + def getClearanceTags(self): + """Conducting equipment may have multiple clearance tags for authorized field work + """ + return self._ClearanceTags + + def setClearanceTags(self, value): + for x in self._ClearanceTags: + x.ConductingEquipment = None + for y in value: + y._ConductingEquipment = self + self._ClearanceTags = value + + ClearanceTags = property(getClearanceTags, setClearanceTags) + + def addClearanceTags(self, *ClearanceTags): + for obj in ClearanceTags: + obj.ConductingEquipment = self + + def removeClearanceTags(self, *ClearanceTags): + for obj in ClearanceTags: + obj.ConductingEquipment = None + + def getProtectionEquipments(self): + """Protection equipment may be used to protect specific Conducting Equipment. Multiple equipment may be protected or monitored by multiple protection equipment. + """ + return self._ProtectionEquipments + + def setProtectionEquipments(self, value): + for p in self._ProtectionEquipments: + filtered = [q for q in p.ConductingEquipments if q != self] + self._ProtectionEquipments._ConductingEquipments = filtered + for r in value: + if self not in r._ConductingEquipments: + r._ConductingEquipments.append(self) + self._ProtectionEquipments = value + + ProtectionEquipments = property(getProtectionEquipments, setProtectionEquipments) + + def addProtectionEquipments(self, *ProtectionEquipments): + for obj in ProtectionEquipments: + if self not in obj._ConductingEquipments: + obj._ConductingEquipments.append(self) + self._ProtectionEquipments.append(obj) + + def removeProtectionEquipments(self, *ProtectionEquipments): + for obj in ProtectionEquipments: + if self in obj._ConductingEquipments: + obj._ConductingEquipments.remove(self) + self._ProtectionEquipments.remove(obj) + + def getTerminals(self): + """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + """ + return self._Terminals + + def setTerminals(self, value): + for x in self._Terminals: + x.ConductingEquipment = None + for y in value: + y._ConductingEquipment = self + self._Terminals = value + + Terminals = property(getTerminals, setTerminals) + + def addTerminals(self, *Terminals): + for obj in Terminals: + obj.ConductingEquipment = self + + def removeTerminals(self, *Terminals): + for obj in Terminals: + obj.ConductingEquipment = None + + def getOutageStepRoles(self): + + return self._OutageStepRoles + + def setOutageStepRoles(self, value): + for x in self._OutageStepRoles: + x.ConductingEquipment = None + for y in value: + y._ConductingEquipment = self + self._OutageStepRoles = value + + OutageStepRoles = property(getOutageStepRoles, setOutageStepRoles) + + def addOutageStepRoles(self, *OutageStepRoles): + for obj in OutageStepRoles: + obj.ConductingEquipment = self + + def removeOutageStepRoles(self, *OutageStepRoles): + for obj in OutageStepRoles: + obj.ConductingEquipment = None + + def getSvStatus(self): + """The status state associated with the conducting equipment. + """ + return self._SvStatus + + def setSvStatus(self, value): + if self._SvStatus is not None: + self._SvStatus._ConductingEquipment = None + + self._SvStatus = value + if self._SvStatus is not None: + self._SvStatus.ConductingEquipment = None + self._SvStatus._ConductingEquipment = self + + SvStatus = property(getSvStatus, setSvStatus) + diff --git a/CIM16/IEC61970/Base/Core/ConnectivityNode.py b/CIM16/IEC61970/Base/Core/ConnectivityNode.py new file mode 100755 index 00000000..64502518 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/ConnectivityNode.py @@ -0,0 +1,107 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ConnectivityNode(IdentifiedObject): + """Connectivity nodes are points where terminals of conducting equipment are connected together with zero impedance.Connectivity nodes are points where terminals of conducting equipment are connected together with zero impedance. + """ + + def __init__(self, TopologicalNode=None, ConnectivityNodeContainer=None, Terminals=None, *args, **kw_args): + """Initialises a new 'ConnectivityNode' instance. + + @param TopologicalNode: Several ConnectivityNode(s) may combine together to form a single TopologicalNode, depending on the current state of the network. + @param ConnectivityNodeContainer: Container of this connectivity node. + @param Terminals: Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + """ + self._TopologicalNode = None + self.TopologicalNode = TopologicalNode + + self._ConnectivityNodeContainer = None + self.ConnectivityNodeContainer = ConnectivityNodeContainer + + self._Terminals = [] + self.Terminals = [] if Terminals is None else Terminals + + super(ConnectivityNode, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TopologicalNode", "ConnectivityNodeContainer", "Terminals"] + _many_refs = ["Terminals"] + + def getTopologicalNode(self): + """Several ConnectivityNode(s) may combine together to form a single TopologicalNode, depending on the current state of the network. + """ + return self._TopologicalNode + + def setTopologicalNode(self, value): + if self._TopologicalNode is not None: + filtered = [x for x in self.TopologicalNode.ConnectivityNodes if x != self] + self._TopologicalNode._ConnectivityNodes = filtered + + self._TopologicalNode = value + if self._TopologicalNode is not None: + if self not in self._TopologicalNode._ConnectivityNodes: + self._TopologicalNode._ConnectivityNodes.append(self) + + TopologicalNode = property(getTopologicalNode, setTopologicalNode) + + def getConnectivityNodeContainer(self): + """Container of this connectivity node. + """ + return self._ConnectivityNodeContainer + + def setConnectivityNodeContainer(self, value): + if self._ConnectivityNodeContainer is not None: + filtered = [x for x in self.ConnectivityNodeContainer.ConnectivityNodes if x != self] + self._ConnectivityNodeContainer._ConnectivityNodes = filtered + + self._ConnectivityNodeContainer = value + if self._ConnectivityNodeContainer is not None: + if self not in self._ConnectivityNodeContainer._ConnectivityNodes: + self._ConnectivityNodeContainer._ConnectivityNodes.append(self) + + ConnectivityNodeContainer = property(getConnectivityNodeContainer, setConnectivityNodeContainer) + + def getTerminals(self): + """Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + """ + return self._Terminals + + def setTerminals(self, value): + for x in self._Terminals: + x.ConnectivityNode = None + for y in value: + y._ConnectivityNode = self + self._Terminals = value + + Terminals = property(getTerminals, setTerminals) + + def addTerminals(self, *Terminals): + for obj in Terminals: + obj.ConnectivityNode = self + + def removeTerminals(self, *Terminals): + for obj in Terminals: + obj.ConnectivityNode = None + diff --git a/CIM16/IEC61970/Base/Core/ConnectivityNodeContainer.py b/CIM16/IEC61970/Base/Core/ConnectivityNodeContainer.py new file mode 100755 index 00000000..28f285b7 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/ConnectivityNodeContainer.py @@ -0,0 +1,91 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class ConnectivityNodeContainer(PowerSystemResource): + """A base class for all objects that may contain ConnectivityNodes or TopologicalNodes.A base class for all objects that may contain ConnectivityNodes or TopologicalNodes. + """ + + def __init__(self, TopologicalNode=None, ConnectivityNodes=None, *args, **kw_args): + """Initialises a new 'ConnectivityNodeContainer' instance. + + @param TopologicalNode: The topological nodes which belong to this connectivity node container. + @param ConnectivityNodes: Connectivity nodes contained by this container. + """ + self._TopologicalNode = [] + self.TopologicalNode = [] if TopologicalNode is None else TopologicalNode + + self._ConnectivityNodes = [] + self.ConnectivityNodes = [] if ConnectivityNodes is None else ConnectivityNodes + + super(ConnectivityNodeContainer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TopologicalNode", "ConnectivityNodes"] + _many_refs = ["TopologicalNode", "ConnectivityNodes"] + + def getTopologicalNode(self): + """The topological nodes which belong to this connectivity node container. + """ + return self._TopologicalNode + + def setTopologicalNode(self, value): + for x in self._TopologicalNode: + x.ConnectivityNodeContainer = None + for y in value: + y._ConnectivityNodeContainer = self + self._TopologicalNode = value + + TopologicalNode = property(getTopologicalNode, setTopologicalNode) + + def addTopologicalNode(self, *TopologicalNode): + for obj in TopologicalNode: + obj.ConnectivityNodeContainer = self + + def removeTopologicalNode(self, *TopologicalNode): + for obj in TopologicalNode: + obj.ConnectivityNodeContainer = None + + def getConnectivityNodes(self): + """Connectivity nodes contained by this container. + """ + return self._ConnectivityNodes + + def setConnectivityNodes(self, value): + for x in self._ConnectivityNodes: + x.ConnectivityNodeContainer = None + for y in value: + y._ConnectivityNodeContainer = self + self._ConnectivityNodes = value + + ConnectivityNodes = property(getConnectivityNodes, setConnectivityNodes) + + def addConnectivityNodes(self, *ConnectivityNodes): + for obj in ConnectivityNodes: + obj.ConnectivityNodeContainer = self + + def removeConnectivityNodes(self, *ConnectivityNodes): + for obj in ConnectivityNodes: + obj.ConnectivityNodeContainer = None + diff --git a/CIM16/IEC61970/Base/Core/Curve.py b/CIM16/IEC61970/Base/Core/Curve.py new file mode 100755 index 00000000..303785d9 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/Curve.py @@ -0,0 +1,101 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Curve(IdentifiedObject): + """A multi-purpose curve or functional relationship between an independent variable (X-axis) and dependent (Y-axis) variables.A multi-purpose curve or functional relationship between an independent variable (X-axis) and dependent (Y-axis) variables. + """ + + def __init__(self, xUnit="N", y1Multiplier="M", y2Unit="N", y3Multiplier="M", y1Unit="N", xMultiplier="M", y3Unit="N", y2Multiplier="M", curveStyle="formula", CurveDatas=None, *args, **kw_args): + """Initialises a new 'Curve' instance. + + @param xUnit: The X-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param y1Multiplier: Multiplier for Y1-axis Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param y2Unit: The Y2-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param y3Multiplier: Multiplier for Y3-axis. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param y1Unit: The Y1-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param xMultiplier: Multiplier for X-axis. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param y3Unit: The Y3-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param y2Multiplier: Multiplier for Y2-axis. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param curveStyle: The style or shape of the curve. Values are: "formula", "constantYValue", "straightLineYValues", "rampYValue" + @param CurveDatas: The point data values that define a curve + """ + #: The X-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.xUnit = xUnit + + #: Multiplier for Y1-axis Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.y1Multiplier = y1Multiplier + + #: The Y2-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.y2Unit = y2Unit + + #: Multiplier for Y3-axis. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.y3Multiplier = y3Multiplier + + #: The Y1-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.y1Unit = y1Unit + + #: Multiplier for X-axis. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.xMultiplier = xMultiplier + + #: The Y3-axis units of measure. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "oC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.y3Unit = y3Unit + + #: Multiplier for Y2-axis. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.y2Multiplier = y2Multiplier + + #: The style or shape of the curve. Values are: "formula", "constantYValue", "straightLineYValues", "rampYValue" + self.curveStyle = curveStyle + + self._CurveDatas = [] + self.CurveDatas = [] if CurveDatas is None else CurveDatas + + super(Curve, self).__init__(*args, **kw_args) + + _attrs = ["xUnit", "y1Multiplier", "y2Unit", "y3Multiplier", "y1Unit", "xMultiplier", "y3Unit", "y2Multiplier", "curveStyle"] + _attr_types = {"xUnit": str, "y1Multiplier": str, "y2Unit": str, "y3Multiplier": str, "y1Unit": str, "xMultiplier": str, "y3Unit": str, "y2Multiplier": str, "curveStyle": str} + _defaults = {"xUnit": "N", "y1Multiplier": "M", "y2Unit": "N", "y3Multiplier": "M", "y1Unit": "N", "xMultiplier": "M", "y3Unit": "N", "y2Multiplier": "M", "curveStyle": "formula"} + _enums = {"xUnit": "UnitSymbol", "y1Multiplier": "UnitMultiplier", "y2Unit": "UnitSymbol", "y3Multiplier": "UnitMultiplier", "y1Unit": "UnitSymbol", "xMultiplier": "UnitMultiplier", "y3Unit": "UnitSymbol", "y2Multiplier": "UnitMultiplier", "curveStyle": "CurveStyle"} + _refs = ["CurveDatas"] + _many_refs = ["CurveDatas"] + + def getCurveDatas(self): + """The point data values that define a curve + """ + return self._CurveDatas + + def setCurveDatas(self, value): + for x in self._CurveDatas: + x.Curve = None + for y in value: + y._Curve = self + self._CurveDatas = value + + CurveDatas = property(getCurveDatas, setCurveDatas) + + def addCurveDatas(self, *CurveDatas): + for obj in CurveDatas: + obj.Curve = self + + def removeCurveDatas(self, *CurveDatas): + for obj in CurveDatas: + obj.Curve = None + diff --git a/CIM16/IEC61970/Base/Core/CurveData.py b/CIM16/IEC61970/Base/Core/CurveData.py new file mode 100755 index 00000000..3c1d643e --- /dev/null +++ b/CIM16/IEC61970/Base/Core/CurveData.py @@ -0,0 +1,76 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class CurveData(Element): + """Multi-purpose data points for defining a curve.Multi-purpose data points for defining a curve. + """ + + def __init__(self, y3value=0.0, xvalue=0.0, y2value=0.0, y1value=0.0, Curve=None, *args, **kw_args): + """Initialises a new 'CurveData' instance. + + @param y3value: The data value of the third Y-axis variable (if present), depending on the Y-axis units + @param xvalue: The data value of the X-axis variable, depending on the X-axis units + @param y2value: The data value of the second Y-axis variable (if present), depending on the Y-axis units + @param y1value: The data value of the first Y-axis variable, depending on the Y-axis units + @param Curve: The Curve defined by this CurveData. + """ + #: The data value of the third Y-axis variable (if present), depending on the Y-axis units + self.y3value = y3value + + #: The data value of the X-axis variable, depending on the X-axis units + self.xvalue = xvalue + + #: The data value of the second Y-axis variable (if present), depending on the Y-axis units + self.y2value = y2value + + #: The data value of the first Y-axis variable, depending on the Y-axis units + self.y1value = y1value + + self._Curve = None + self.Curve = Curve + + super(CurveData, self).__init__(*args, **kw_args) + + _attrs = ["y3value", "xvalue", "y2value", "y1value"] + _attr_types = {"y3value": float, "xvalue": float, "y2value": float, "y1value": float} + _defaults = {"y3value": 0.0, "xvalue": 0.0, "y2value": 0.0, "y1value": 0.0} + _enums = {} + _refs = ["Curve"] + _many_refs = [] + + def getCurve(self): + """The Curve defined by this CurveData. + """ + return self._Curve + + def setCurve(self, value): + if self._Curve is not None: + filtered = [x for x in self.Curve.CurveDatas if x != self] + self._Curve._CurveDatas = filtered + + self._Curve = value + if self._Curve is not None: + if self not in self._Curve._CurveDatas: + self._Curve._CurveDatas.append(self) + + Curve = property(getCurve, setCurve) + diff --git a/CIM16/IEC61970/Base/Core/Equipment.py b/CIM16/IEC61970/Base/Core/Equipment.py new file mode 100755 index 00000000..7a1b0cd7 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/Equipment.py @@ -0,0 +1,125 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.PowerSystemResource import PowerSystemResource + +class Equipment(PowerSystemResource): + """The parts of a power system that are physical devices, electronic or mechanicalThe parts of a power system that are physical devices, electronic or mechanical + """ + + def __init__(self, normallyInService=False, aggregate=False, ContingencyEquipment=None, CustomerAgreements=None, EquipmentContainer=None, *args, **kw_args): + """Initialises a new 'Equipment' instance. + + @param normallyInService: The equipment is normally in service. + @param aggregate: The single instance of equipment represents multiple pieces of equipment that have been modeled together as an aggregate. Examples would be PowerTransformers or SychronousMachines operating in parallel modeled as a single aggregate PowerTransformer or aggregate SynchronousMachine. This is not to be used to indicate equipment that is part of a group of interdependent equipment produced by a network production program. + @param ContingencyEquipment: The contingency element associated with the equipment. + @param CustomerAgreements: + @param EquipmentContainer: The association is used in the naming hierarchy. + """ + #: The equipment is normally in service. + self.normallyInService = normallyInService + + #: The single instance of equipment represents multiple pieces of equipment that have been modeled together as an aggregate. Examples would be PowerTransformers or SychronousMachines operating in parallel modeled as a single aggregate PowerTransformer or aggregate SynchronousMachine. This is not to be used to indicate equipment that is part of a group of interdependent equipment produced by a network production program. + self.aggregate = aggregate + + self._ContingencyEquipment = [] + self.ContingencyEquipment = [] if ContingencyEquipment is None else ContingencyEquipment + + self._CustomerAgreements = [] + self.CustomerAgreements = [] if CustomerAgreements is None else CustomerAgreements + + self._EquipmentContainer = None + self.EquipmentContainer = EquipmentContainer + + super(Equipment, self).__init__(*args, **kw_args) + + _attrs = ["normallyInService", "aggregate"] + _attr_types = {"normallyInService": bool, "aggregate": bool} + _defaults = {"normallyInService": False, "aggregate": False} + _enums = {} + _refs = ["ContingencyEquipment", "CustomerAgreements", "EquipmentContainer"] + _many_refs = ["ContingencyEquipment", "CustomerAgreements"] + + def getContingencyEquipment(self): + """The contingency element associated with the equipment. + """ + return self._ContingencyEquipment + + def setContingencyEquipment(self, value): + for x in self._ContingencyEquipment: + x.Equipment = None + for y in value: + y._Equipment = self + self._ContingencyEquipment = value + + ContingencyEquipment = property(getContingencyEquipment, setContingencyEquipment) + + def addContingencyEquipment(self, *ContingencyEquipment): + for obj in ContingencyEquipment: + obj.Equipment = self + + def removeContingencyEquipment(self, *ContingencyEquipment): + for obj in ContingencyEquipment: + obj.Equipment = None + + def getCustomerAgreements(self): + + return self._CustomerAgreements + + def setCustomerAgreements(self, value): + for p in self._CustomerAgreements: + filtered = [q for q in p.Equipments if q != self] + self._CustomerAgreements._Equipments = filtered + for r in value: + if self not in r._Equipments: + r._Equipments.append(self) + self._CustomerAgreements = value + + CustomerAgreements = property(getCustomerAgreements, setCustomerAgreements) + + def addCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + if self not in obj._Equipments: + obj._Equipments.append(self) + self._CustomerAgreements.append(obj) + + def removeCustomerAgreements(self, *CustomerAgreements): + for obj in CustomerAgreements: + if self in obj._Equipments: + obj._Equipments.remove(self) + self._CustomerAgreements.remove(obj) + + def getEquipmentContainer(self): + """The association is used in the naming hierarchy. + """ + return self._EquipmentContainer + + def setEquipmentContainer(self, value): + if self._EquipmentContainer is not None: + filtered = [x for x in self.EquipmentContainer.Equipments if x != self] + self._EquipmentContainer._Equipments = filtered + + self._EquipmentContainer = value + if self._EquipmentContainer is not None: + if self not in self._EquipmentContainer._Equipments: + self._EquipmentContainer._Equipments.append(self) + + EquipmentContainer = property(getEquipmentContainer, setEquipmentContainer) + diff --git a/CIM16/IEC61970/Base/Core/EquipmentContainer.py b/CIM16/IEC61970/Base/Core/EquipmentContainer.py new file mode 100755 index 00000000..d631db58 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/EquipmentContainer.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.ConnectivityNodeContainer import ConnectivityNodeContainer + +class EquipmentContainer(ConnectivityNodeContainer): + """A modeling construct to provide a root class for containing equipment.A modeling construct to provide a root class for containing equipment. + """ + + def __init__(self, Equipments=None, *args, **kw_args): + """Initialises a new 'EquipmentContainer' instance. + + @param Equipments: The association is used in the naming hierarchy. + """ + self._Equipments = [] + self.Equipments = [] if Equipments is None else Equipments + + super(EquipmentContainer, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Equipments"] + _many_refs = ["Equipments"] + + def getEquipments(self): + """The association is used in the naming hierarchy. + """ + return self._Equipments + + def setEquipments(self, value): + for x in self._Equipments: + x.EquipmentContainer = None + for y in value: + y._EquipmentContainer = self + self._Equipments = value + + Equipments = property(getEquipments, setEquipments) + + def addEquipments(self, *Equipments): + for obj in Equipments: + obj.EquipmentContainer = self + + def removeEquipments(self, *Equipments): + for obj in Equipments: + obj.EquipmentContainer = None + diff --git a/CIM16/IEC61970/Base/Core/GeographicalRegion.py b/CIM16/IEC61970/Base/Core/GeographicalRegion.py new file mode 100755 index 00000000..2b98d643 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/GeographicalRegion.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class GeographicalRegion(IdentifiedObject): + """A geographical region of a power system network model.A geographical region of a power system network model. + """ + + def __init__(self, Regions=None, *args, **kw_args): + """Initialises a new 'GeographicalRegion' instance. + + @param Regions: The association is used in the naming hierarchy. + """ + self._Regions = [] + self.Regions = [] if Regions is None else Regions + + super(GeographicalRegion, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Regions"] + _many_refs = ["Regions"] + + def getRegions(self): + """The association is used in the naming hierarchy. + """ + return self._Regions + + def setRegions(self, value): + for x in self._Regions: + x.Region = None + for y in value: + y._Region = self + self._Regions = value + + Regions = property(getRegions, setRegions) + + def addRegions(self, *Regions): + for obj in Regions: + obj.Region = self + + def removeRegions(self, *Regions): + for obj in Regions: + obj.Region = None + diff --git a/CIM16/IEC61970/Base/Core/IdentifiedObject.py b/CIM16/IEC61970/Base/Core/IdentifiedObject.py new file mode 100755 index 00000000..cddf8e7c --- /dev/null +++ b/CIM16/IEC61970/Base/Core/IdentifiedObject.py @@ -0,0 +1,124 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class IdentifiedObject(Element): + """This is a root class to provide common identification for all classes needing identification and naming attributesThis is a root class to provide common identification for all classes needing identification and naming attributes + """ + + def __init__(self, mRID='', aliasName='', name='', Names=None, DiagramObjects=None, ModelingAuthoritySet=None, *args, **kw_args): + """Initialises a new 'IdentifiedObject' instance. + + @param mRID: A Model Authority issues mRIDs. Given that each Model Authority has a unique id and this id is part of the mRID, then the mRID is globally unique. Global uniqeness is easily achived by using a UUID for the mRID. It is strongly recommended to do this. For CIMXML data files the mRID is mapped to rdf:ID or rdf:about attributes that identifies CIM object elements. + @param aliasName: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + @param name: The name is any free human readable and possibly non unique text naming the object. + @param Names: All names of this identified object. + @param DiagramObjects: The diagram objects that are associated with the domain object + @param ModelingAuthoritySet: An IdentifiedObject belongs to a Modeling Authority Set for purposes of defining a group of data maintained by the same Modeling Authority. + """ + #: A Model Authority issues mRIDs. Given that each Model Authority has a unique id and this id is part of the mRID, then the mRID is globally unique. Global uniqeness is easily achived by using a UUID for the mRID. It is strongly recommended to do this. For CIMXML data files the mRID is mapped to rdf:ID or rdf:about attributes that identifies CIM object elements. + self.mRID = mRID + + #: The aliasName is free text human readable name of the object alternative to IdentifiedObject.name. It may be non unique and may not correlate to a naming hierarchy. The attribute aliasName is put back because of backwards compatibility between CIM relases. It is however recommended to replace aliasName with the Name class as aliasName is planned for retirement at a future time. This was decided at a joint WG13/14 meeting in Minneapolis 2010-10-06. + self.aliasName = aliasName + + #: The name is any free human readable and possibly non unique text naming the object. + self.name = name + + self._Names = [] + self.Names = [] if Names is None else Names + + self._DiagramObjects = [] + self.DiagramObjects = [] if DiagramObjects is None else DiagramObjects + + self._ModelingAuthoritySet = None + self.ModelingAuthoritySet = ModelingAuthoritySet + + super(IdentifiedObject, self).__init__(*args, **kw_args) + + _attrs = ["mRID", "aliasName", "name"] + _attr_types = {"mRID": str, "aliasName": str, "name": str} + _defaults = {"mRID": '', "aliasName": '', "name": ''} + _enums = {} + _refs = ["Names", "DiagramObjects", "ModelingAuthoritySet"] + _many_refs = ["Names", "DiagramObjects"] + + def getNames(self): + """All names of this identified object. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.IdentifiedObject = None + for y in value: + y._IdentifiedObject = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = self + + def removeNames(self, *Names): + for obj in Names: + obj.IdentifiedObject = None + + def getDiagramObjects(self): + """The diagram objects that are associated with the domain object + """ + return self._DiagramObjects + + def setDiagramObjects(self, value): + for x in self._DiagramObjects: + x.IdentifiedObject = None + for y in value: + y._IdentifiedObject = self + self._DiagramObjects = value + + DiagramObjects = property(getDiagramObjects, setDiagramObjects) + + def addDiagramObjects(self, *DiagramObjects): + for obj in DiagramObjects: + obj.IdentifiedObject = self + + def removeDiagramObjects(self, *DiagramObjects): + for obj in DiagramObjects: + obj.IdentifiedObject = None + + def getModelingAuthoritySet(self): + """An IdentifiedObject belongs to a Modeling Authority Set for purposes of defining a group of data maintained by the same Modeling Authority. + """ + return self._ModelingAuthoritySet + + def setModelingAuthoritySet(self, value): + if self._ModelingAuthoritySet is not None: + filtered = [x for x in self.ModelingAuthoritySet.IdentifiedObjects if x != self] + self._ModelingAuthoritySet._IdentifiedObjects = filtered + + self._ModelingAuthoritySet = value + if self._ModelingAuthoritySet is not None: + if self not in self._ModelingAuthoritySet._IdentifiedObjects: + self._ModelingAuthoritySet._IdentifiedObjects.append(self) + + ModelingAuthoritySet = property(getModelingAuthoritySet, setModelingAuthoritySet) + diff --git a/CIM16/IEC61970/Base/Core/IrregularIntervalSchedule.py b/CIM16/IEC61970/Base/Core/IrregularIntervalSchedule.py new file mode 100755 index 00000000..52b0abbf --- /dev/null +++ b/CIM16/IEC61970/Base/Core/IrregularIntervalSchedule.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.BasicIntervalSchedule import BasicIntervalSchedule + +class IrregularIntervalSchedule(BasicIntervalSchedule): + """The schedule has TimePoints where the time between them varies.The schedule has TimePoints where the time between them varies. + """ + + def __init__(self, TimePoints=None, *args, **kw_args): + """Initialises a new 'IrregularIntervalSchedule' instance. + + @param TimePoints: The point data values that define a curve + """ + self._TimePoints = [] + self.TimePoints = [] if TimePoints is None else TimePoints + + super(IrregularIntervalSchedule, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["TimePoints"] + _many_refs = ["TimePoints"] + + def getTimePoints(self): + """The point data values that define a curve + """ + return self._TimePoints + + def setTimePoints(self, value): + for x in self._TimePoints: + x.IntervalSchedule = None + for y in value: + y._IntervalSchedule = self + self._TimePoints = value + + TimePoints = property(getTimePoints, setTimePoints) + + def addTimePoints(self, *TimePoints): + for obj in TimePoints: + obj.IntervalSchedule = self + + def removeTimePoints(self, *TimePoints): + for obj in TimePoints: + obj.IntervalSchedule = None + diff --git a/CIM16/IEC61970/Base/Core/IrregularTimePoint.py b/CIM16/IEC61970/Base/Core/IrregularTimePoint.py new file mode 100755 index 00000000..082daa36 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/IrregularTimePoint.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class IrregularTimePoint(Element): + """TimePoints for a schedule where the time between the points varies.TimePoints for a schedule where the time between the points varies. + """ + + def __init__(self, time=0.0, value1=0.0, value2=0.0, IntervalSchedule=None, *args, **kw_args): + """Initialises a new 'IrregularTimePoint' instance. + + @param time: The time is relative the BasicTimeSchedule.startTime. + @param value1: The first value at the time. The meaning of the value is defined by the class inhering the IrregularIntervalSchedule. + @param value2: The second value at the time. The meaning of the value is defined by the class inhering the IrregularIntervalSchedule. + @param IntervalSchedule: An IrregularTimePoint belongs to an IrregularIntervalSchedule. + """ + #: The time is relative the BasicTimeSchedule.startTime. + self.time = time + + #: The first value at the time. The meaning of the value is defined by the class inhering the IrregularIntervalSchedule. + self.value1 = value1 + + #: The second value at the time. The meaning of the value is defined by the class inhering the IrregularIntervalSchedule. + self.value2 = value2 + + self._IntervalSchedule = None + self.IntervalSchedule = IntervalSchedule + + super(IrregularTimePoint, self).__init__(*args, **kw_args) + + _attrs = ["time", "value1", "value2"] + _attr_types = {"time": float, "value1": float, "value2": float} + _defaults = {"time": 0.0, "value1": 0.0, "value2": 0.0} + _enums = {} + _refs = ["IntervalSchedule"] + _many_refs = [] + + def getIntervalSchedule(self): + """An IrregularTimePoint belongs to an IrregularIntervalSchedule. + """ + return self._IntervalSchedule + + def setIntervalSchedule(self, value): + if self._IntervalSchedule is not None: + filtered = [x for x in self.IntervalSchedule.TimePoints if x != self] + self._IntervalSchedule._TimePoints = filtered + + self._IntervalSchedule = value + if self._IntervalSchedule is not None: + if self not in self._IntervalSchedule._TimePoints: + self._IntervalSchedule._TimePoints.append(self) + + IntervalSchedule = property(getIntervalSchedule, setIntervalSchedule) + diff --git a/CIM16/IEC61970/Base/Core/Name.py b/CIM16/IEC61970/Base/Core/Name.py new file mode 100755 index 00000000..55ce8059 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/Name.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class Name(Element): + """The Name class provides the means to define any number of human readable names for an object. A name is not to be used for defining inter-object relationships. For inter-object relationships instead use the object identification 'mRID'.The Name class provides the means to define any number of human readable names for an object. A name is not to be used for defining inter-object relationships. For inter-object relationships instead use the object identification 'mRID'. + """ + + def __init__(self, name='', NameType=None, IdentifiedObject=None, *args, **kw_args): + """Initialises a new 'Name' instance. + + @param name: Any free text that name the object. + @param NameType: Type of this name. + @param IdentifiedObject: Identified object that this name designates. + """ + #: Any free text that name the object. + self.name = name + + self._NameType = None + self.NameType = NameType + + self._IdentifiedObject = None + self.IdentifiedObject = IdentifiedObject + + super(Name, self).__init__(*args, **kw_args) + + _attrs = ["name"] + _attr_types = {"name": str} + _defaults = {"name": ''} + _enums = {} + _refs = ["NameType", "IdentifiedObject"] + _many_refs = [] + + def getNameType(self): + """Type of this name. + """ + return self._NameType + + def setNameType(self, value): + if self._NameType is not None: + filtered = [x for x in self.NameType.Names if x != self] + self._NameType._Names = filtered + + self._NameType = value + if self._NameType is not None: + if self not in self._NameType._Names: + self._NameType._Names.append(self) + + NameType = property(getNameType, setNameType) + + def getIdentifiedObject(self): + """Identified object that this name designates. + """ + return self._IdentifiedObject + + def setIdentifiedObject(self, value): + if self._IdentifiedObject is not None: + filtered = [x for x in self.IdentifiedObject.Names if x != self] + self._IdentifiedObject._Names = filtered + + self._IdentifiedObject = value + if self._IdentifiedObject is not None: + if self not in self._IdentifiedObject._Names: + self._IdentifiedObject._Names.append(self) + + IdentifiedObject = property(getIdentifiedObject, setIdentifiedObject) + diff --git a/CIM16/IEC61970/Base/Core/NameType.py b/CIM16/IEC61970/Base/Core/NameType.py new file mode 100755 index 00000000..dcc9aba7 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/NameType.py @@ -0,0 +1,94 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class NameType(Element): + """Type of name. Possible values for attribute 'name' are implementation dependent but standard profiles may specify types. An enterprise may have multiple IT systems each having its own local name for the same object, e.g. a planning system may have different names from an EMS. An object may also have different names within the same IT system, e.g. localName and aliasName as defined in CIM version 14. Their definitions from CIM14 are The localName is a human readable name of the object. It is only used with objects organized in a naming hierarchy. localName: A free text name local to a node in a naming hierarchy similar to a file directory structure. A power system related naming hierarchy may be: Substation, VoltageLevel, Equipment etc. Children of the same parent in such a hierarchy have names that typically are unique among them. aliasName: A free text alternate name typically used in tabular reports where the column width is limited.Type of name. Possible values for attribute 'name' are implementation dependent but standard profiles may specify types. An enterprise may have multiple IT systems each having its own local name for the same object, e.g. a planning system may have different names from an EMS. An object may also have different names within the same IT system, e.g. localName and aliasName as defined in CIM version 14. Their definitions from CIM14 are The localName is a human readable name of the object. It is only used with objects organized in a naming hierarchy. localName: A free text name local to a node in a naming hierarchy similar to a file directory structure. A power system related naming hierarchy may be: Substation, VoltageLevel, Equipment etc. Children of the same parent in such a hierarchy have names that typically are unique among them. aliasName: A free text alternate name typically used in tabular reports where the column width is limited. + """ + + def __init__(self, name='', description='', Names=None, NameTypeAuthority=None, *args, **kw_args): + """Initialises a new 'NameType' instance. + + @param name: Name of the name type. + @param description: Description of the name type. + @param Names: All names of this type. + @param NameTypeAuthority: Authority responsible for managing names of this type. + """ + #: Name of the name type. + self.name = name + + #: Description of the name type. + self.description = description + + self._Names = [] + self.Names = [] if Names is None else Names + + self._NameTypeAuthority = None + self.NameTypeAuthority = NameTypeAuthority + + super(NameType, self).__init__(*args, **kw_args) + + _attrs = ["name", "description"] + _attr_types = {"name": str, "description": str} + _defaults = {"name": '', "description": ''} + _enums = {} + _refs = ["Names", "NameTypeAuthority"] + _many_refs = ["Names"] + + def getNames(self): + """All names of this type. + """ + return self._Names + + def setNames(self, value): + for x in self._Names: + x.NameType = None + for y in value: + y._NameType = self + self._Names = value + + Names = property(getNames, setNames) + + def addNames(self, *Names): + for obj in Names: + obj.NameType = self + + def removeNames(self, *Names): + for obj in Names: + obj.NameType = None + + def getNameTypeAuthority(self): + """Authority responsible for managing names of this type. + """ + return self._NameTypeAuthority + + def setNameTypeAuthority(self, value): + if self._NameTypeAuthority is not None: + filtered = [x for x in self.NameTypeAuthority.NameTypes if x != self] + self._NameTypeAuthority._NameTypes = filtered + + self._NameTypeAuthority = value + if self._NameTypeAuthority is not None: + if self not in self._NameTypeAuthority._NameTypes: + self._NameTypeAuthority._NameTypes.append(self) + + NameTypeAuthority = property(getNameTypeAuthority, setNameTypeAuthority) + diff --git a/CIM16/IEC61970/Base/Core/NameTypeAuthority.py b/CIM16/IEC61970/Base/Core/NameTypeAuthority.py new file mode 100755 index 00000000..d5af2ef7 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/NameTypeAuthority.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class NameTypeAuthority(Element): + """Authority responsible for creation and management of names of a given type; typically an organization or an enterprise system.Authority responsible for creation and management of names of a given type; typically an organization or an enterprise system. + """ + + def __init__(self, name='', description='', NameTypes=None, *args, **kw_args): + """Initialises a new 'NameTypeAuthority' instance. + + @param name: Name of the name type authority. + @param description: Description of the name type authority. + @param NameTypes: All name types managed by this authority. + """ + #: Name of the name type authority. + self.name = name + + #: Description of the name type authority. + self.description = description + + self._NameTypes = [] + self.NameTypes = [] if NameTypes is None else NameTypes + + super(NameTypeAuthority, self).__init__(*args, **kw_args) + + _attrs = ["name", "description"] + _attr_types = {"name": str, "description": str} + _defaults = {"name": '', "description": ''} + _enums = {} + _refs = ["NameTypes"] + _many_refs = ["NameTypes"] + + def getNameTypes(self): + """All name types managed by this authority. + """ + return self._NameTypes + + def setNameTypes(self, value): + for x in self._NameTypes: + x.NameTypeAuthority = None + for y in value: + y._NameTypeAuthority = self + self._NameTypes = value + + NameTypes = property(getNameTypes, setNameTypes) + + def addNameTypes(self, *NameTypes): + for obj in NameTypes: + obj.NameTypeAuthority = self + + def removeNameTypes(self, *NameTypes): + for obj in NameTypes: + obj.NameTypeAuthority = None + diff --git a/CIM16/IEC61970/Base/Core/OperatingParticipant.py b/CIM16/IEC61970/Base/Core/OperatingParticipant.py new file mode 100755 index 00000000..fb75117e --- /dev/null +++ b/CIM16/IEC61970/Base/Core/OperatingParticipant.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class OperatingParticipant(IdentifiedObject): + """An operator of multiple PowerSystemResource objects. Note multple OperatingParticipants may operate the same PowerSystemResource object. This can be used for modeling jointly owned units where each owner operates as a contractual share.An operator of multiple PowerSystemResource objects. Note multple OperatingParticipants may operate the same PowerSystemResource object. This can be used for modeling jointly owned units where each owner operates as a contractual share. + """ + + def __init__(self, OperatingShare=None, *args, **kw_args): + """Initialises a new 'OperatingParticipant' instance. + + @param OperatingShare: The operating shares of an operating participant. An operating participant can be reused for any number of PSR's. + """ + self._OperatingShare = [] + self.OperatingShare = [] if OperatingShare is None else OperatingShare + + super(OperatingParticipant, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["OperatingShare"] + _many_refs = ["OperatingShare"] + + def getOperatingShare(self): + """The operating shares of an operating participant. An operating participant can be reused for any number of PSR's. + """ + return self._OperatingShare + + def setOperatingShare(self, value): + for x in self._OperatingShare: + x.OperatingParticipant = None + for y in value: + y._OperatingParticipant = self + self._OperatingShare = value + + OperatingShare = property(getOperatingShare, setOperatingShare) + + def addOperatingShare(self, *OperatingShare): + for obj in OperatingShare: + obj.OperatingParticipant = self + + def removeOperatingShare(self, *OperatingShare): + for obj in OperatingShare: + obj.OperatingParticipant = None + diff --git a/CIM16/IEC61970/Base/Core/OperatingShare.py b/CIM16/IEC61970/Base/Core/OperatingShare.py new file mode 100755 index 00000000..9bebcdfb --- /dev/null +++ b/CIM16/IEC61970/Base/Core/OperatingShare.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class OperatingShare(Element): + """Specifies the contract relationship between a PowerSystemResource and a contract participant.Specifies the contract relationship between a PowerSystemResource and a contract participant. + """ + + def __init__(self, percentage=0.0, PowerSystemResource=None, OperatingParticipant=None, *args, **kw_args): + """Initialises a new 'OperatingShare' instance. + + @param percentage: Percentage ownership for this device. The percentage indicates the percentage ownership of the PSROwner for the PowerSystemResource. The total percentage ownership for a PowerSystemResource should add to 100%. + @param PowerSystemResource: The PowerSystemResource to which the attribues apply. The percentage ownership of all owners of a PowerSystemResource should add to 100%. + @param OperatingParticipant: The linkage to a owners and its linkage attributes like percentage ownership. The ownership percentage should add to 100% for all owners of a PowerSystemResource, but a PSROwner may own any percentage of any number of PowerSystemResource objects. + """ + #: Percentage ownership for this device. The percentage indicates the percentage ownership of the PSROwner for the PowerSystemResource. The total percentage ownership for a PowerSystemResource should add to 100%. + self.percentage = percentage + + self._PowerSystemResource = None + self.PowerSystemResource = PowerSystemResource + + self._OperatingParticipant = None + self.OperatingParticipant = OperatingParticipant + + super(OperatingShare, self).__init__(*args, **kw_args) + + _attrs = ["percentage"] + _attr_types = {"percentage": float} + _defaults = {"percentage": 0.0} + _enums = {} + _refs = ["PowerSystemResource", "OperatingParticipant"] + _many_refs = [] + + def getPowerSystemResource(self): + """The PowerSystemResource to which the attribues apply. The percentage ownership of all owners of a PowerSystemResource should add to 100%. + """ + return self._PowerSystemResource + + def setPowerSystemResource(self, value): + if self._PowerSystemResource is not None: + filtered = [x for x in self.PowerSystemResource.OperatingShare if x != self] + self._PowerSystemResource._OperatingShare = filtered + + self._PowerSystemResource = value + if self._PowerSystemResource is not None: + if self not in self._PowerSystemResource._OperatingShare: + self._PowerSystemResource._OperatingShare.append(self) + + PowerSystemResource = property(getPowerSystemResource, setPowerSystemResource) + + def getOperatingParticipant(self): + """The linkage to a owners and its linkage attributes like percentage ownership. The ownership percentage should add to 100% for all owners of a PowerSystemResource, but a PSROwner may own any percentage of any number of PowerSystemResource objects. + """ + return self._OperatingParticipant + + def setOperatingParticipant(self, value): + if self._OperatingParticipant is not None: + filtered = [x for x in self.OperatingParticipant.OperatingShare if x != self] + self._OperatingParticipant._OperatingShare = filtered + + self._OperatingParticipant = value + if self._OperatingParticipant is not None: + if self not in self._OperatingParticipant._OperatingShare: + self._OperatingParticipant._OperatingShare.append(self) + + OperatingParticipant = property(getOperatingParticipant, setOperatingParticipant) + diff --git a/CIM16/IEC61970/Base/Core/PSRType.py b/CIM16/IEC61970/Base/Core/PSRType.py new file mode 100755 index 00000000..3f6bd471 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/PSRType.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PSRType(IdentifiedObject): + """Classifying instances of the same class, e.g. overhead and underground ACLineSegments. This classification mechanism is intended to provide flexibility outside the scope of this standard, i.e. provide customisation that is non standard.Classifying instances of the same class, e.g. overhead and underground ACLineSegments. This classification mechanism is intended to provide flexibility outside the scope of this standard, i.e. provide customisation that is non standard. + """ + + def __init__(self, PowerSystemResources=None, *args, **kw_args): + """Initialises a new 'PSRType' instance. + + @param PowerSystemResources: Power system resources classified with this PSRType. + """ + self._PowerSystemResources = [] + self.PowerSystemResources = [] if PowerSystemResources is None else PowerSystemResources + + super(PSRType, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["PowerSystemResources"] + _many_refs = ["PowerSystemResources"] + + def getPowerSystemResources(self): + """Power system resources classified with this PSRType. + """ + return self._PowerSystemResources + + def setPowerSystemResources(self, value): + for x in self._PowerSystemResources: + x.PSRType = None + for y in value: + y._PSRType = self + self._PowerSystemResources = value + + PowerSystemResources = property(getPowerSystemResources, setPowerSystemResources) + + def addPowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + obj.PSRType = self + + def removePowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + obj.PSRType = None + diff --git a/CIM16/IEC61970/Base/Core/PowerSystemResource.py b/CIM16/IEC61970/Base/Core/PowerSystemResource.py new file mode 100755 index 00000000..b3c5717d --- /dev/null +++ b/CIM16/IEC61970/Base/Core/PowerSystemResource.py @@ -0,0 +1,436 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Base.Core.IdentifiedObject import IdentifiedObject + +class PowerSystemResource(IdentifiedObject): + """A power system resource can be an item of equipment such as a Switch, an EquipmentContainer containing many individual items of equipment such as a Substation, or an organisational entity such as Company or SubControlArea. This provides for the nesting of collections of PowerSystemResources within other PowerSystemResources. For example, a Switch could be a member of a Substation and a Substation could be a member of a division of a Company.A power system resource can be an item of equipment such as a Switch, an EquipmentContainer containing many individual items of equipment such as a Substation, or an organisational entity such as Company or SubControlArea. This provides for the nesting of collections of PowerSystemResources within other PowerSystemResources. For example, a Switch could be a member of a Substation and a Substation could be a member of a division of a Company. + """ + + def __init__(self, ChangeItems=None, ScheduleSteps=None, SafetyDocuments=None, OperatingShare=None, DocumentRoles=None, PsrLists=None, Measurements=None, ReportingGroup=None, PSRType=None, Assets=None, ErpOrganisationRoles=None, Location=None, PSREvent=None, NetworkDataSets=None, OutageSchedule=None, *args, **kw_args): + """Initialises a new 'PowerSystemResource' instance. + + @param ChangeItems: + @param ScheduleSteps: + @param SafetyDocuments: + @param OperatingShare: The linkage to any number of operating share objects. + @param DocumentRoles: + @param PsrLists: + @param Measurements: The Measurements that are included in the naming hierarchy where the PSR is the containing object + @param ReportingGroup: Reporting groups to which this PSR belongs. + @param PSRType: PSRType (custom classification) for this PowerSystemResource. + @param Assets: All assets represented by this power system resource. For example, multiple conductor assets are electrically modelled as a single AC line segment. + @param ErpOrganisationRoles: + @param Location: Location of this power system resource. + @param PSREvent: All events associated with this power system resource. + @param NetworkDataSets: + @param OutageSchedule: A power system resource may have an outage schedule + """ + self._ChangeItems = [] + self.ChangeItems = [] if ChangeItems is None else ChangeItems + + self._ScheduleSteps = [] + self.ScheduleSteps = [] if ScheduleSteps is None else ScheduleSteps + + self._SafetyDocuments = [] + self.SafetyDocuments = [] if SafetyDocuments is None else SafetyDocuments + + self._OperatingShare = [] + self.OperatingShare = [] if OperatingShare is None else OperatingShare + + self._DocumentRoles = [] + self.DocumentRoles = [] if DocumentRoles is None else DocumentRoles + + self._PsrLists = [] + self.PsrLists = [] if PsrLists is None else PsrLists + + self._Measurements = [] + self.Measurements = [] if Measurements is None else Measurements + + self._ReportingGroup = [] + self.ReportingGroup = [] if ReportingGroup is None else ReportingGroup + + self._PSRType = None + self.PSRType = PSRType + + self._Assets = [] + self.Assets = [] if Assets is None else Assets + + self._ErpOrganisationRoles = [] + self.ErpOrganisationRoles = [] if ErpOrganisationRoles is None else ErpOrganisationRoles + + self._Location = None + self.Location = Location + + self._PSREvent = [] + self.PSREvent = [] if PSREvent is None else PSREvent + + self._NetworkDataSets = [] + self.NetworkDataSets = [] if NetworkDataSets is None else NetworkDataSets + + self._OutageSchedule = None + self.OutageSchedule = OutageSchedule + + super(PowerSystemResource, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ChangeItems", "ScheduleSteps", "SafetyDocuments", "OperatingShare", "DocumentRoles", "PsrLists", "Measurements", "ReportingGroup", "PSRType", "Assets", "ErpOrganisationRoles", "Location", "PSREvent", "NetworkDataSets", "OutageSchedule"] + _many_refs = ["ChangeItems", "ScheduleSteps", "SafetyDocuments", "OperatingShare", "DocumentRoles", "PsrLists", "Measurements", "ReportingGroup", "Assets", "ErpOrganisationRoles", "PSREvent", "NetworkDataSets"] + + def getChangeItems(self): + + return self._ChangeItems + + def setChangeItems(self, value): + for x in self._ChangeItems: + x.PowerSystemResource = None + for y in value: + y._PowerSystemResource = self + self._ChangeItems = value + + ChangeItems = property(getChangeItems, setChangeItems) + + def addChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.PowerSystemResource = self + + def removeChangeItems(self, *ChangeItems): + for obj in ChangeItems: + obj.PowerSystemResource = None + + def getScheduleSteps(self): + + return self._ScheduleSteps + + def setScheduleSteps(self, value): + for p in self._ScheduleSteps: + filtered = [q for q in p.PowerSystemResources if q != self] + self._ScheduleSteps._PowerSystemResources = filtered + for r in value: + if self not in r._PowerSystemResources: + r._PowerSystemResources.append(self) + self._ScheduleSteps = value + + ScheduleSteps = property(getScheduleSteps, setScheduleSteps) + + def addScheduleSteps(self, *ScheduleSteps): + for obj in ScheduleSteps: + if self not in obj._PowerSystemResources: + obj._PowerSystemResources.append(self) + self._ScheduleSteps.append(obj) + + def removeScheduleSteps(self, *ScheduleSteps): + for obj in ScheduleSteps: + if self in obj._PowerSystemResources: + obj._PowerSystemResources.remove(self) + self._ScheduleSteps.remove(obj) + + def getSafetyDocuments(self): + + return self._SafetyDocuments + + def setSafetyDocuments(self, value): + for x in self._SafetyDocuments: + x.PowerSystemResource = None + for y in value: + y._PowerSystemResource = self + self._SafetyDocuments = value + + SafetyDocuments = property(getSafetyDocuments, setSafetyDocuments) + + def addSafetyDocuments(self, *SafetyDocuments): + for obj in SafetyDocuments: + obj.PowerSystemResource = self + + def removeSafetyDocuments(self, *SafetyDocuments): + for obj in SafetyDocuments: + obj.PowerSystemResource = None + + def getOperatingShare(self): + """The linkage to any number of operating share objects. + """ + return self._OperatingShare + + def setOperatingShare(self, value): + for x in self._OperatingShare: + x.PowerSystemResource = None + for y in value: + y._PowerSystemResource = self + self._OperatingShare = value + + OperatingShare = property(getOperatingShare, setOperatingShare) + + def addOperatingShare(self, *OperatingShare): + for obj in OperatingShare: + obj.PowerSystemResource = self + + def removeOperatingShare(self, *OperatingShare): + for obj in OperatingShare: + obj.PowerSystemResource = None + + def getDocumentRoles(self): + + return self._DocumentRoles + + def setDocumentRoles(self, value): + for x in self._DocumentRoles: + x.PowerSystemResource = None + for y in value: + y._PowerSystemResource = self + self._DocumentRoles = value + + DocumentRoles = property(getDocumentRoles, setDocumentRoles) + + def addDocumentRoles(self, *DocumentRoles): + for obj in DocumentRoles: + obj.PowerSystemResource = self + + def removeDocumentRoles(self, *DocumentRoles): + for obj in DocumentRoles: + obj.PowerSystemResource = None + + def getPsrLists(self): + + return self._PsrLists + + def setPsrLists(self, value): + for p in self._PsrLists: + filtered = [q for q in p.PowerSystemResources if q != self] + self._PsrLists._PowerSystemResources = filtered + for r in value: + if self not in r._PowerSystemResources: + r._PowerSystemResources.append(self) + self._PsrLists = value + + PsrLists = property(getPsrLists, setPsrLists) + + def addPsrLists(self, *PsrLists): + for obj in PsrLists: + if self not in obj._PowerSystemResources: + obj._PowerSystemResources.append(self) + self._PsrLists.append(obj) + + def removePsrLists(self, *PsrLists): + for obj in PsrLists: + if self in obj._PowerSystemResources: + obj._PowerSystemResources.remove(self) + self._PsrLists.remove(obj) + + def getMeasurements(self): + """The Measurements that are included in the naming hierarchy where the PSR is the containing object + """ + return self._Measurements + + def setMeasurements(self, value): + for x in self._Measurements: + x.PowerSystemResource = None + for y in value: + y._PowerSystemResource = self + self._Measurements = value + + Measurements = property(getMeasurements, setMeasurements) + + def addMeasurements(self, *Measurements): + for obj in Measurements: + obj.PowerSystemResource = self + + def removeMeasurements(self, *Measurements): + for obj in Measurements: + obj.PowerSystemResource = None + + def getReportingGroup(self): + """Reporting groups to which this PSR belongs. + """ + return self._ReportingGroup + + def setReportingGroup(self, value): + for p in self._ReportingGroup: + filtered = [q for q in p.PowerSystemResource if q != self] + self._ReportingGroup._PowerSystemResource = filtered + for r in value: + if self not in r._PowerSystemResource: + r._PowerSystemResource.append(self) + self._ReportingGroup = value + + ReportingGroup = property(getReportingGroup, setReportingGroup) + + def addReportingGroup(self, *ReportingGroup): + for obj in ReportingGroup: + if self not in obj._PowerSystemResource: + obj._PowerSystemResource.append(self) + self._ReportingGroup.append(obj) + + def removeReportingGroup(self, *ReportingGroup): + for obj in ReportingGroup: + if self in obj._PowerSystemResource: + obj._PowerSystemResource.remove(self) + self._ReportingGroup.remove(obj) + + def getPSRType(self): + """PSRType (custom classification) for this PowerSystemResource. + """ + return self._PSRType + + def setPSRType(self, value): + if self._PSRType is not None: + filtered = [x for x in self.PSRType.PowerSystemResources if x != self] + self._PSRType._PowerSystemResources = filtered + + self._PSRType = value + if self._PSRType is not None: + if self not in self._PSRType._PowerSystemResources: + self._PSRType._PowerSystemResources.append(self) + + PSRType = property(getPSRType, setPSRType) + + def getAssets(self): + """All assets represented by this power system resource. For example, multiple conductor assets are electrically modelled as a single AC line segment. + """ + return self._Assets + + def setAssets(self, value): + for p in self._Assets: + filtered = [q for q in p.PowerSystemResources if q != self] + self._Assets._PowerSystemResources = filtered + for r in value: + if self not in r._PowerSystemResources: + r._PowerSystemResources.append(self) + self._Assets = value + + Assets = property(getAssets, setAssets) + + def addAssets(self, *Assets): + for obj in Assets: + if self not in obj._PowerSystemResources: + obj._PowerSystemResources.append(self) + self._Assets.append(obj) + + def removeAssets(self, *Assets): + for obj in Assets: + if self in obj._PowerSystemResources: + obj._PowerSystemResources.remove(self) + self._Assets.remove(obj) + + def getErpOrganisationRoles(self): + + return self._ErpOrganisationRoles + + def setErpOrganisationRoles(self, value): + for x in self._ErpOrganisationRoles: + x.PowerSystemResource = None + for y in value: + y._PowerSystemResource = self + self._ErpOrganisationRoles = value + + ErpOrganisationRoles = property(getErpOrganisationRoles, setErpOrganisationRoles) + + def addErpOrganisationRoles(self, *ErpOrganisationRoles): + for obj in ErpOrganisationRoles: + obj.PowerSystemResource = self + + def removeErpOrganisationRoles(self, *ErpOrganisationRoles): + for obj in ErpOrganisationRoles: + obj.PowerSystemResource = None + + def getLocation(self): + """Location of this power system resource. + """ + return self._Location + + def setLocation(self, value): + if self._Location is not None: + filtered = [x for x in self.Location.PowerSystemResources if x != self] + self._Location._PowerSystemResources = filtered + + self._Location = value + if self._Location is not None: + if self not in self._Location._PowerSystemResources: + self._Location._PowerSystemResources.append(self) + + Location = property(getLocation, setLocation) + + def getPSREvent(self): + """All events associated with this power system resource. + """ + return self._PSREvent + + def setPSREvent(self, value): + for x in self._PSREvent: + x.PowerSystemResource = None + for y in value: + y._PowerSystemResource = self + self._PSREvent = value + + PSREvent = property(getPSREvent, setPSREvent) + + def addPSREvent(self, *PSREvent): + for obj in PSREvent: + obj.PowerSystemResource = self + + def removePSREvent(self, *PSREvent): + for obj in PSREvent: + obj.PowerSystemResource = None + + def getNetworkDataSets(self): + + return self._NetworkDataSets + + def setNetworkDataSets(self, value): + for p in self._NetworkDataSets: + filtered = [q for q in p.PowerSystemResources if q != self] + self._NetworkDataSets._PowerSystemResources = filtered + for r in value: + if self not in r._PowerSystemResources: + r._PowerSystemResources.append(self) + self._NetworkDataSets = value + + NetworkDataSets = property(getNetworkDataSets, setNetworkDataSets) + + def addNetworkDataSets(self, *NetworkDataSets): + for obj in NetworkDataSets: + if self not in obj._PowerSystemResources: + obj._PowerSystemResources.append(self) + self._NetworkDataSets.append(obj) + + def removeNetworkDataSets(self, *NetworkDataSets): + for obj in NetworkDataSets: + if self in obj._PowerSystemResources: + obj._PowerSystemResources.remove(self) + self._NetworkDataSets.remove(obj) + + def getOutageSchedule(self): + """A power system resource may have an outage schedule + """ + return self._OutageSchedule + + def setOutageSchedule(self, value): + if self._OutageSchedule is not None: + self._OutageSchedule._PowerSystemResource = None + + self._OutageSchedule = value + if self._OutageSchedule is not None: + self._OutageSchedule.PowerSystemResource = None + self._OutageSchedule._PowerSystemResource = self + + OutageSchedule = property(getOutageSchedule, setOutageSchedule) + diff --git a/CIM16/IEC61970/Base/Core/PsrList.py b/CIM16/IEC61970/Base/Core/PsrList.py new file mode 100755 index 00000000..49c524ce --- /dev/null +++ b/CIM16/IEC61970/Base/Core/PsrList.py @@ -0,0 +1,74 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class PsrList(IdentifiedObject): + """Arbitrary list of PowerSystemResources. Can be used for various purposes, including grouping for report generation.Arbitrary list of PowerSystemResources. Can be used for various purposes, including grouping for report generation. + """ + + def __init__(self, typePSRList='', PowerSystemResources=None, *args, **kw_args): + """Initialises a new 'PsrList' instance. + + @param typePSRList: Type of power system resources in this list. + @param PowerSystemResources: + """ + #: Type of power system resources in this list. + self.typePSRList = typePSRList + + self._PowerSystemResources = [] + self.PowerSystemResources = [] if PowerSystemResources is None else PowerSystemResources + + super(PsrList, self).__init__(*args, **kw_args) + + _attrs = ["typePSRList"] + _attr_types = {"typePSRList": str} + _defaults = {"typePSRList": ''} + _enums = {} + _refs = ["PowerSystemResources"] + _many_refs = ["PowerSystemResources"] + + def getPowerSystemResources(self): + + return self._PowerSystemResources + + def setPowerSystemResources(self, value): + for p in self._PowerSystemResources: + filtered = [q for q in p.PsrLists if q != self] + self._PowerSystemResources._PsrLists = filtered + for r in value: + if self not in r._PsrLists: + r._PsrLists.append(self) + self._PowerSystemResources = value + + PowerSystemResources = property(getPowerSystemResources, setPowerSystemResources) + + def addPowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + if self not in obj._PsrLists: + obj._PsrLists.append(self) + self._PowerSystemResources.append(obj) + + def removePowerSystemResources(self, *PowerSystemResources): + for obj in PowerSystemResources: + if self in obj._PsrLists: + obj._PsrLists.remove(self) + self._PowerSystemResources.remove(obj) + diff --git a/CIM16/IEC61970/Base/Core/RegularIntervalSchedule.py b/CIM16/IEC61970/Base/Core/RegularIntervalSchedule.py new file mode 100755 index 00000000..fea9119a --- /dev/null +++ b/CIM16/IEC61970/Base/Core/RegularIntervalSchedule.py @@ -0,0 +1,73 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.BasicIntervalSchedule import BasicIntervalSchedule + +class RegularIntervalSchedule(BasicIntervalSchedule): + """The schedule has TimePoints where the time between them is constant.The schedule has TimePoints where the time between them is constant. + """ + + def __init__(self, endTime='', timeStep=0.0, TimePoints=None, *args, **kw_args): + """Initialises a new 'RegularIntervalSchedule' instance. + + @param endTime: The time for the last time point. + @param timeStep: The time between each pair of subsequent RegularTimePoints. + @param TimePoints: The point data values that define a curve + """ + #: The time for the last time point. + self.endTime = endTime + + #: The time between each pair of subsequent RegularTimePoints. + self.timeStep = timeStep + + self._TimePoints = [] + self.TimePoints = [] if TimePoints is None else TimePoints + + super(RegularIntervalSchedule, self).__init__(*args, **kw_args) + + _attrs = ["endTime", "timeStep"] + _attr_types = {"endTime": str, "timeStep": float} + _defaults = {"endTime": '', "timeStep": 0.0} + _enums = {} + _refs = ["TimePoints"] + _many_refs = ["TimePoints"] + + def getTimePoints(self): + """The point data values that define a curve + """ + return self._TimePoints + + def setTimePoints(self, value): + for x in self._TimePoints: + x.IntervalSchedule = None + for y in value: + y._IntervalSchedule = self + self._TimePoints = value + + TimePoints = property(getTimePoints, setTimePoints) + + def addTimePoints(self, *TimePoints): + for obj in TimePoints: + obj.IntervalSchedule = self + + def removeTimePoints(self, *TimePoints): + for obj in TimePoints: + obj.IntervalSchedule = None + diff --git a/CIM16/IEC61970/Base/Core/RegularTimePoint.py b/CIM16/IEC61970/Base/Core/RegularTimePoint.py new file mode 100755 index 00000000..aabc0b23 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/RegularTimePoint.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.Element import Element + +class RegularTimePoint(Element): + """TimePoints for a schedule where the time between the points is constant.TimePoints for a schedule where the time between the points is constant. + """ + + def __init__(self, value2=0.0, value1=0.0, sequenceNumber=0, IntervalSchedule=None, *args, **kw_args): + """Initialises a new 'RegularTimePoint' instance. + + @param value2: The second value at the time. The meaning of the value is defined by the class inhering the RegularIntervalSchedule. + @param value1: The first value at the time. The meaning of the value is defined by the class inhering the RegularIntervalSchedule. + @param sequenceNumber: The position of the RegularTimePoint in the sequence. Note that time points don't have to be sequential, i.e. time points may be omitted. The actual time for a RegularTimePoint is computed by multiplying the RegularIntervalSchedule.timeStep with the RegularTimePoint.sequenceNumber and add the BasicIntervalSchedule.startTime. + @param IntervalSchedule: A RegularTimePoint belongs to a RegularIntervalSchedule. + """ + #: The second value at the time. The meaning of the value is defined by the class inhering the RegularIntervalSchedule. + self.value2 = value2 + + #: The first value at the time. The meaning of the value is defined by the class inhering the RegularIntervalSchedule. + self.value1 = value1 + + #: The position of the RegularTimePoint in the sequence. Note that time points don't have to be sequential, i.e. time points may be omitted. The actual time for a RegularTimePoint is computed by multiplying the RegularIntervalSchedule.timeStep with the RegularTimePoint.sequenceNumber and add the BasicIntervalSchedule.startTime. + self.sequenceNumber = sequenceNumber + + self._IntervalSchedule = None + self.IntervalSchedule = IntervalSchedule + + super(RegularTimePoint, self).__init__(*args, **kw_args) + + _attrs = ["value2", "value1", "sequenceNumber"] + _attr_types = {"value2": float, "value1": float, "sequenceNumber": int} + _defaults = {"value2": 0.0, "value1": 0.0, "sequenceNumber": 0} + _enums = {} + _refs = ["IntervalSchedule"] + _many_refs = [] + + def getIntervalSchedule(self): + """A RegularTimePoint belongs to a RegularIntervalSchedule. + """ + return self._IntervalSchedule + + def setIntervalSchedule(self, value): + if self._IntervalSchedule is not None: + filtered = [x for x in self.IntervalSchedule.TimePoints if x != self] + self._IntervalSchedule._TimePoints = filtered + + self._IntervalSchedule = value + if self._IntervalSchedule is not None: + if self not in self._IntervalSchedule._TimePoints: + self._IntervalSchedule._TimePoints.append(self) + + IntervalSchedule = property(getIntervalSchedule, setIntervalSchedule) + diff --git a/CIM16/IEC61970/Base/Core/ReportingGroup.py b/CIM16/IEC61970/Base/Core/ReportingGroup.py new file mode 100755 index 00000000..c5c57567 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/ReportingGroup.py @@ -0,0 +1,144 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ReportingGroup(IdentifiedObject): + """A reporting group is used for various ad-hoc groupings used for reporting.A reporting group is used for various ad-hoc groupings used for reporting. + """ + + def __init__(self, BusNameMarker=None, ReportingSuperGroup=None, TopologicalNode=None, PowerSystemResource=None, *args, **kw_args): + """Initialises a new 'ReportingGroup' instance. + + @param BusNameMarker: The BusNameMarkers that belong to this reporting group. + @param ReportingSuperGroup: Reporting super group to which this reporting group belongs. + @param TopologicalNode: The topological nodes that belong to the reporting group. + @param PowerSystemResource: PSR's which belong to this reporting group. + """ + self._BusNameMarker = [] + self.BusNameMarker = [] if BusNameMarker is None else BusNameMarker + + self._ReportingSuperGroup = None + self.ReportingSuperGroup = ReportingSuperGroup + + self._TopologicalNode = [] + self.TopologicalNode = [] if TopologicalNode is None else TopologicalNode + + self._PowerSystemResource = [] + self.PowerSystemResource = [] if PowerSystemResource is None else PowerSystemResource + + super(ReportingGroup, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["BusNameMarker", "ReportingSuperGroup", "TopologicalNode", "PowerSystemResource"] + _many_refs = ["BusNameMarker", "TopologicalNode", "PowerSystemResource"] + + def getBusNameMarker(self): + """The BusNameMarkers that belong to this reporting group. + """ + return self._BusNameMarker + + def setBusNameMarker(self, value): + for x in self._BusNameMarker: + x.ReportingGroup = None + for y in value: + y._ReportingGroup = self + self._BusNameMarker = value + + BusNameMarker = property(getBusNameMarker, setBusNameMarker) + + def addBusNameMarker(self, *BusNameMarker): + for obj in BusNameMarker: + obj.ReportingGroup = self + + def removeBusNameMarker(self, *BusNameMarker): + for obj in BusNameMarker: + obj.ReportingGroup = None + + def getReportingSuperGroup(self): + """Reporting super group to which this reporting group belongs. + """ + return self._ReportingSuperGroup + + def setReportingSuperGroup(self, value): + if self._ReportingSuperGroup is not None: + filtered = [x for x in self.ReportingSuperGroup.ReportingGroup if x != self] + self._ReportingSuperGroup._ReportingGroup = filtered + + self._ReportingSuperGroup = value + if self._ReportingSuperGroup is not None: + if self not in self._ReportingSuperGroup._ReportingGroup: + self._ReportingSuperGroup._ReportingGroup.append(self) + + ReportingSuperGroup = property(getReportingSuperGroup, setReportingSuperGroup) + + def getTopologicalNode(self): + """The topological nodes that belong to the reporting group. + """ + return self._TopologicalNode + + def setTopologicalNode(self, value): + for x in self._TopologicalNode: + x.ReportingGroup = None + for y in value: + y._ReportingGroup = self + self._TopologicalNode = value + + TopologicalNode = property(getTopologicalNode, setTopologicalNode) + + def addTopologicalNode(self, *TopologicalNode): + for obj in TopologicalNode: + obj.ReportingGroup = self + + def removeTopologicalNode(self, *TopologicalNode): + for obj in TopologicalNode: + obj.ReportingGroup = None + + def getPowerSystemResource(self): + """PSR's which belong to this reporting group. + """ + return self._PowerSystemResource + + def setPowerSystemResource(self, value): + for p in self._PowerSystemResource: + filtered = [q for q in p.ReportingGroup if q != self] + self._PowerSystemResource._ReportingGroup = filtered + for r in value: + if self not in r._ReportingGroup: + r._ReportingGroup.append(self) + self._PowerSystemResource = value + + PowerSystemResource = property(getPowerSystemResource, setPowerSystemResource) + + def addPowerSystemResource(self, *PowerSystemResource): + for obj in PowerSystemResource: + if self not in obj._ReportingGroup: + obj._ReportingGroup.append(self) + self._PowerSystemResource.append(obj) + + def removePowerSystemResource(self, *PowerSystemResource): + for obj in PowerSystemResource: + if self in obj._ReportingGroup: + obj._ReportingGroup.remove(self) + self._PowerSystemResource.remove(obj) + diff --git a/CIM16/IEC61970/Base/Core/ReportingSuperGroup.py b/CIM16/IEC61970/Base/Core/ReportingSuperGroup.py new file mode 100755 index 00000000..b3df483c --- /dev/null +++ b/CIM16/IEC61970/Base/Core/ReportingSuperGroup.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class ReportingSuperGroup(IdentifiedObject): + """A reporting super group, groups reporting groups for a higher level report.A reporting super group, groups reporting groups for a higher level report. + """ + + def __init__(self, ReportingGroup=None, *args, **kw_args): + """Initialises a new 'ReportingSuperGroup' instance. + + @param ReportingGroup: Reporting groups that are grouped under this group group. + """ + self._ReportingGroup = [] + self.ReportingGroup = [] if ReportingGroup is None else ReportingGroup + + super(ReportingSuperGroup, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["ReportingGroup"] + _many_refs = ["ReportingGroup"] + + def getReportingGroup(self): + """Reporting groups that are grouped under this group group. + """ + return self._ReportingGroup + + def setReportingGroup(self, value): + for x in self._ReportingGroup: + x.ReportingSuperGroup = None + for y in value: + y._ReportingSuperGroup = self + self._ReportingGroup = value + + ReportingGroup = property(getReportingGroup, setReportingGroup) + + def addReportingGroup(self, *ReportingGroup): + for obj in ReportingGroup: + obj.ReportingSuperGroup = self + + def removeReportingGroup(self, *ReportingGroup): + for obj in ReportingGroup: + obj.ReportingSuperGroup = None + diff --git a/CIM16/IEC61970/Base/Core/SubGeographicalRegion.py b/CIM16/IEC61970/Base/Core/SubGeographicalRegion.py new file mode 100755 index 00000000..cabdf9c2 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/SubGeographicalRegion.py @@ -0,0 +1,112 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class SubGeographicalRegion(IdentifiedObject): + """A subset of a geographical region of a power system network model.A subset of a geographical region of a power system network model. + """ + + def __init__(self, Substations=None, Lines=None, Region=None, *args, **kw_args): + """Initialises a new 'SubGeographicalRegion' instance. + + @param Substations: The association is used in the naming hierarchy. + @param Lines: A Line can be contained by a SubGeographical Region. + @param Region: The association is used in the naming hierarchy. + """ + self._Substations = [] + self.Substations = [] if Substations is None else Substations + + self._Lines = [] + self.Lines = [] if Lines is None else Lines + + self._Region = None + self.Region = Region + + super(SubGeographicalRegion, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Substations", "Lines", "Region"] + _many_refs = ["Substations", "Lines"] + + def getSubstations(self): + """The association is used in the naming hierarchy. + """ + return self._Substations + + def setSubstations(self, value): + for x in self._Substations: + x.Region = None + for y in value: + y._Region = self + self._Substations = value + + Substations = property(getSubstations, setSubstations) + + def addSubstations(self, *Substations): + for obj in Substations: + obj.Region = self + + def removeSubstations(self, *Substations): + for obj in Substations: + obj.Region = None + + def getLines(self): + """A Line can be contained by a SubGeographical Region. + """ + return self._Lines + + def setLines(self, value): + for x in self._Lines: + x.Region = None + for y in value: + y._Region = self + self._Lines = value + + Lines = property(getLines, setLines) + + def addLines(self, *Lines): + for obj in Lines: + obj.Region = self + + def removeLines(self, *Lines): + for obj in Lines: + obj.Region = None + + def getRegion(self): + """The association is used in the naming hierarchy. + """ + return self._Region + + def setRegion(self, value): + if self._Region is not None: + filtered = [x for x in self.Region.Regions if x != self] + self._Region._Regions = filtered + + self._Region = value + if self._Region is not None: + if self not in self._Region._Regions: + self._Region._Regions.append(self) + + Region = property(getRegion, setRegion) + diff --git a/CIM16/IEC61970/Base/Core/Substation.py b/CIM16/IEC61970/Base/Core/Substation.py new file mode 100755 index 00000000..8afb90af --- /dev/null +++ b/CIM16/IEC61970/Base/Core/Substation.py @@ -0,0 +1,112 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class Substation(EquipmentContainer): + """A collection of equipment for purposes other than generation or utilization, through which electric energy in bulk is passed for the purposes of switching or modifying its characteristics.A collection of equipment for purposes other than generation or utilization, through which electric energy in bulk is passed for the purposes of switching or modifying its characteristics. + """ + + def __init__(self, Bays=None, VoltageLevels=None, Region=None, *args, **kw_args): + """Initialises a new 'Substation' instance. + + @param Bays: The association is used in the naming hierarchy. + @param VoltageLevels: The association is used in the naming hierarchy. + @param Region: The association is used in the naming hierarchy. + """ + self._Bays = [] + self.Bays = [] if Bays is None else Bays + + self._VoltageLevels = [] + self.VoltageLevels = [] if VoltageLevels is None else VoltageLevels + + self._Region = None + self.Region = Region + + super(Substation, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Bays", "VoltageLevels", "Region"] + _many_refs = ["Bays", "VoltageLevels"] + + def getBays(self): + """The association is used in the naming hierarchy. + """ + return self._Bays + + def setBays(self, value): + for x in self._Bays: + x.Substation = None + for y in value: + y._Substation = self + self._Bays = value + + Bays = property(getBays, setBays) + + def addBays(self, *Bays): + for obj in Bays: + obj.Substation = self + + def removeBays(self, *Bays): + for obj in Bays: + obj.Substation = None + + def getVoltageLevels(self): + """The association is used in the naming hierarchy. + """ + return self._VoltageLevels + + def setVoltageLevels(self, value): + for x in self._VoltageLevels: + x.Substation = None + for y in value: + y._Substation = self + self._VoltageLevels = value + + VoltageLevels = property(getVoltageLevels, setVoltageLevels) + + def addVoltageLevels(self, *VoltageLevels): + for obj in VoltageLevels: + obj.Substation = self + + def removeVoltageLevels(self, *VoltageLevels): + for obj in VoltageLevels: + obj.Substation = None + + def getRegion(self): + """The association is used in the naming hierarchy. + """ + return self._Region + + def setRegion(self, value): + if self._Region is not None: + filtered = [x for x in self.Region.Substations if x != self] + self._Region._Substations = filtered + + self._Region = value + if self._Region is not None: + if self not in self._Region._Substations: + self._Region._Substations.append(self) + + Region = property(getRegion, setRegion) + diff --git a/CIM16/IEC61970/Base/Core/Terminal.py b/CIM16/IEC61970/Base/Core/Terminal.py new file mode 100755 index 00000000..fa1f7b61 --- /dev/null +++ b/CIM16/IEC61970/Base/Core/Terminal.py @@ -0,0 +1,407 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject + +class Terminal(IdentifiedObject): + """An electrical connection point to a piece of conducting equipment. Terminals are connected at physical connection points called 'connectivity nodes'.An electrical connection point to a piece of conducting equipment. Terminals are connected at physical connection points called 'connectivity nodes'. + """ + + def __init__(self, phases="s12N", connected=False, sequenceNumber=0, BushingInfo=None, TieFlow=None, HasSecond_MutualCoupling=None, OperationalLimitSet=None, Measurements=None, ConductingEquipment=None, RegulatingControl=None, HasFirst_MutualCoupling=None, AuxiliaryEquipment=None, TransformerEnd=None, ConnectivityNode=None, BranchGroupTerminal=None, BusNameMarker=None, SvPowerFlow=None, TopologicalNode=None, *args, **kw_args): + """Initialises a new 'Terminal' instance. + + @param phases: Represents the normal network phasing condition. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param connected: The connected status is related to a bus-branch model and the TopologicalNode-Terminal relation. True implies the Terminal is connected to the related TopologicalNode and false implies it is not. In a bus-branch model the connected status is used to tell if equipment is disconnected without having to change the connectivity described by the TopologicalNode-Terminal relation. A valid case is that ConductingEquipment can be connected in one end and open in the other. In particular for an ACLineSegment where the charging can be significant this is a relevant case. + @param sequenceNumber: The orientation of the terminal connections for a multiple terminal conducting equipment. The sequence numbering starts with 1 and additional terminals should follow in increasing order. The first terminal is the 'starting point' for a two terminal branch. In the case of class TransformerWinding only one terminal is used so its sequenceNumber must be 1. + @param BushingInfo: + @param TieFlow: The control area tie flows to which this terminal associates. + @param HasSecond_MutualCoupling: Mutual couplings with the branch associated as the first branch. + @param OperationalLimitSet: The operatinal limits sets that applie specifically to this terminal. Other operational limits sets may apply to this terminal through the association to Equipment. + @param Measurements: One or more measurements may be associated with a terminal in the network. Measurement-Terminal defines where the measurement is placed in the network topology. Some Measurements represent quantities related to a particular sensor position, e.g. a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. The sensing position is captured by the Measurement - Terminal association that makes it possible to place the sensing position at a well defined place. The place is defined by the connection of the Terminal to ConductingEquipment. + @param ConductingEquipment: ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + @param RegulatingControl: The terminal is regulated by a control. + @param HasFirst_MutualCoupling: Mutual couplings associated with the branch as the first branch. + @param AuxiliaryEquipment: + @param TransformerEnd: All transformer ends connected at this external terminal. + @param ConnectivityNode: Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + @param BranchGroupTerminal: The directed branch group terminals for which the terminal is monitored. + @param BusNameMarker: The BusNameMarker used to name the bus (TopologicalNode) with the Terminal having the BusNameMarker. A bus typically have multiple Terminals connected and in of normal topologies Terminals with different BusNameMarker may be connected to the bus. In such cases the BusNameMarker can be arbitrarily selected. + @param SvPowerFlow: The power flow state associated with the terminal. + @param TopologicalNode: The topological node associated with the terminal. This can be used as an alternative to the connectivity node path to topological node, thus making it unneccesary to model connedtivity nodes in some cases. Note that the if connectivity nodes are in the model, this association would proably not be used. + """ + #: Represents the normal network phasing condition. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.phases = phases + + #: The connected status is related to a bus-branch model and the TopologicalNode-Terminal relation. True implies the Terminal is connected to the related TopologicalNode and false implies it is not. In a bus-branch model the connected status is used to tell if equipment is disconnected without having to change the connectivity described by the TopologicalNode-Terminal relation. A valid case is that ConductingEquipment can be connected in one end and open in the other. In particular for an ACLineSegment where the charging can be significant this is a relevant case. + self.connected = connected + + #: The orientation of the terminal connections for a multiple terminal conducting equipment. The sequence numbering starts with 1 and additional terminals should follow in increasing order. The first terminal is the 'starting point' for a two terminal branch. In the case of class TransformerWinding only one terminal is used so its sequenceNumber must be 1. + self.sequenceNumber = sequenceNumber + + self._BushingInfo = None + self.BushingInfo = BushingInfo + + self._TieFlow = [] + self.TieFlow = [] if TieFlow is None else TieFlow + + self._HasSecond_MutualCoupling = [] + self.HasSecond_MutualCoupling = [] if HasSecond_MutualCoupling is None else HasSecond_MutualCoupling + + self._OperationalLimitSet = [] + self.OperationalLimitSet = [] if OperationalLimitSet is None else OperationalLimitSet + + self._Measurements = [] + self.Measurements = [] if Measurements is None else Measurements + + self._ConductingEquipment = None + self.ConductingEquipment = ConductingEquipment + + self._RegulatingControl = [] + self.RegulatingControl = [] if RegulatingControl is None else RegulatingControl + + self._HasFirst_MutualCoupling = [] + self.HasFirst_MutualCoupling = [] if HasFirst_MutualCoupling is None else HasFirst_MutualCoupling + + self._AuxiliaryEquipment = [] + self.AuxiliaryEquipment = [] if AuxiliaryEquipment is None else AuxiliaryEquipment + + self._TransformerEnd = [] + self.TransformerEnd = [] if TransformerEnd is None else TransformerEnd + + self._ConnectivityNode = None + self.ConnectivityNode = ConnectivityNode + + self._BranchGroupTerminal = [] + self.BranchGroupTerminal = [] if BranchGroupTerminal is None else BranchGroupTerminal + + self._BusNameMarker = None + self.BusNameMarker = BusNameMarker + + self._SvPowerFlow = None + self.SvPowerFlow = SvPowerFlow + + self._TopologicalNode = None + self.TopologicalNode = TopologicalNode + + super(Terminal, self).__init__(*args, **kw_args) + + _attrs = ["phases", "connected", "sequenceNumber"] + _attr_types = {"phases": str, "connected": bool, "sequenceNumber": int} + _defaults = {"phases": "s12N", "connected": False, "sequenceNumber": 0} + _enums = {"phases": "PhaseCode"} + _refs = ["BushingInfo", "TieFlow", "HasSecond_MutualCoupling", "OperationalLimitSet", "Measurements", "ConductingEquipment", "RegulatingControl", "HasFirst_MutualCoupling", "AuxiliaryEquipment", "TransformerEnd", "ConnectivityNode", "BranchGroupTerminal", "BusNameMarker", "SvPowerFlow", "TopologicalNode"] + _many_refs = ["TieFlow", "HasSecond_MutualCoupling", "OperationalLimitSet", "Measurements", "RegulatingControl", "HasFirst_MutualCoupling", "AuxiliaryEquipment", "TransformerEnd", "BranchGroupTerminal"] + + def getBushingInfo(self): + + return self._BushingInfo + + def setBushingInfo(self, value): + if self._BushingInfo is not None: + self._BushingInfo._Terminal = None + + self._BushingInfo = value + if self._BushingInfo is not None: + self._BushingInfo.Terminal = None + self._BushingInfo._Terminal = self + + BushingInfo = property(getBushingInfo, setBushingInfo) + + def getTieFlow(self): + """The control area tie flows to which this terminal associates. + """ + return self._TieFlow + + def setTieFlow(self, value): + for x in self._TieFlow: + x.Terminal = None + for y in value: + y._Terminal = self + self._TieFlow = value + + TieFlow = property(getTieFlow, setTieFlow) + + def addTieFlow(self, *TieFlow): + for obj in TieFlow: + obj.Terminal = self + + def removeTieFlow(self, *TieFlow): + for obj in TieFlow: + obj.Terminal = None + + def getHasSecond_MutualCoupling(self): + """Mutual couplings with the branch associated as the first branch. + """ + return self._HasSecond_MutualCoupling + + def setHasSecond_MutualCoupling(self, value): + for x in self._HasSecond_MutualCoupling: + x.Second_Terminal = None + for y in value: + y._Second_Terminal = self + self._HasSecond_MutualCoupling = value + + HasSecond_MutualCoupling = property(getHasSecond_MutualCoupling, setHasSecond_MutualCoupling) + + def addHasSecond_MutualCoupling(self, *HasSecond_MutualCoupling): + for obj in HasSecond_MutualCoupling: + obj.Second_Terminal = self + + def removeHasSecond_MutualCoupling(self, *HasSecond_MutualCoupling): + for obj in HasSecond_MutualCoupling: + obj.Second_Terminal = None + + def getOperationalLimitSet(self): + """The operatinal limits sets that applie specifically to this terminal. Other operational limits sets may apply to this terminal through the association to Equipment. + """ + return self._OperationalLimitSet + + def setOperationalLimitSet(self, value): + for x in self._OperationalLimitSet: + x.Terminal = None + for y in value: + y._Terminal = self + self._OperationalLimitSet = value + + OperationalLimitSet = property(getOperationalLimitSet, setOperationalLimitSet) + + def addOperationalLimitSet(self, *OperationalLimitSet): + for obj in OperationalLimitSet: + obj.Terminal = self + + def removeOperationalLimitSet(self, *OperationalLimitSet): + for obj in OperationalLimitSet: + obj.Terminal = None + + def getMeasurements(self): + """One or more measurements may be associated with a terminal in the network. Measurement-Terminal defines where the measurement is placed in the network topology. Some Measurements represent quantities related to a particular sensor position, e.g. a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. The sensing position is captured by the Measurement - Terminal association that makes it possible to place the sensing position at a well defined place. The place is defined by the connection of the Terminal to ConductingEquipment. + """ + return self._Measurements + + def setMeasurements(self, value): + for x in self._Measurements: + x.Terminal = None + for y in value: + y._Terminal = self + self._Measurements = value + + Measurements = property(getMeasurements, setMeasurements) + + def addMeasurements(self, *Measurements): + for obj in Measurements: + obj.Terminal = self + + def removeMeasurements(self, *Measurements): + for obj in Measurements: + obj.Terminal = None + + def getConductingEquipment(self): + """ConductingEquipment has 1 or 2 terminals that may be connected to other ConductingEquipment terminals via ConnectivityNodes + """ + return self._ConductingEquipment + + def setConductingEquipment(self, value): + if self._ConductingEquipment is not None: + filtered = [x for x in self.ConductingEquipment.Terminals if x != self] + self._ConductingEquipment._Terminals = filtered + + self._ConductingEquipment = value + if self._ConductingEquipment is not None: + if self not in self._ConductingEquipment._Terminals: + self._ConductingEquipment._Terminals.append(self) + + ConductingEquipment = property(getConductingEquipment, setConductingEquipment) + + def getRegulatingControl(self): + """The terminal is regulated by a control. + """ + return self._RegulatingControl + + def setRegulatingControl(self, value): + for x in self._RegulatingControl: + x.Terminal = None + for y in value: + y._Terminal = self + self._RegulatingControl = value + + RegulatingControl = property(getRegulatingControl, setRegulatingControl) + + def addRegulatingControl(self, *RegulatingControl): + for obj in RegulatingControl: + obj.Terminal = self + + def removeRegulatingControl(self, *RegulatingControl): + for obj in RegulatingControl: + obj.Terminal = None + + def getHasFirst_MutualCoupling(self): + """Mutual couplings associated with the branch as the first branch. + """ + return self._HasFirst_MutualCoupling + + def setHasFirst_MutualCoupling(self, value): + for x in self._HasFirst_MutualCoupling: + x.First_Terminal = None + for y in value: + y._First_Terminal = self + self._HasFirst_MutualCoupling = value + + HasFirst_MutualCoupling = property(getHasFirst_MutualCoupling, setHasFirst_MutualCoupling) + + def addHasFirst_MutualCoupling(self, *HasFirst_MutualCoupling): + for obj in HasFirst_MutualCoupling: + obj.First_Terminal = self + + def removeHasFirst_MutualCoupling(self, *HasFirst_MutualCoupling): + for obj in HasFirst_MutualCoupling: + obj.First_Terminal = None + + def getAuxiliaryEquipment(self): + + return self._AuxiliaryEquipment + + def setAuxiliaryEquipment(self, value): + for x in self._AuxiliaryEquipment: + x.Terminal = None + for y in value: + y._Terminal = self + self._AuxiliaryEquipment = value + + AuxiliaryEquipment = property(getAuxiliaryEquipment, setAuxiliaryEquipment) + + def addAuxiliaryEquipment(self, *AuxiliaryEquipment): + for obj in AuxiliaryEquipment: + obj.Terminal = self + + def removeAuxiliaryEquipment(self, *AuxiliaryEquipment): + for obj in AuxiliaryEquipment: + obj.Terminal = None + + def getTransformerEnd(self): + """All transformer ends connected at this external terminal. + """ + return self._TransformerEnd + + def setTransformerEnd(self, value): + for x in self._TransformerEnd: + x.Terminal = None + for y in value: + y._Terminal = self + self._TransformerEnd = value + + TransformerEnd = property(getTransformerEnd, setTransformerEnd) + + def addTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.Terminal = self + + def removeTransformerEnd(self, *TransformerEnd): + for obj in TransformerEnd: + obj.Terminal = None + + def getConnectivityNode(self): + """Terminals interconnect with zero impedance at a node. Measurements on a node apply to all of its terminals. + """ + return self._ConnectivityNode + + def setConnectivityNode(self, value): + if self._ConnectivityNode is not None: + filtered = [x for x in self.ConnectivityNode.Terminals if x != self] + self._ConnectivityNode._Terminals = filtered + + self._ConnectivityNode = value + if self._ConnectivityNode is not None: + if self not in self._ConnectivityNode._Terminals: + self._ConnectivityNode._Terminals.append(self) + + ConnectivityNode = property(getConnectivityNode, setConnectivityNode) + + def getBranchGroupTerminal(self): + """The directed branch group terminals for which the terminal is monitored. + """ + return self._BranchGroupTerminal + + def setBranchGroupTerminal(self, value): + for x in self._BranchGroupTerminal: + x.Terminal = None + for y in value: + y._Terminal = self + self._BranchGroupTerminal = value + + BranchGroupTerminal = property(getBranchGroupTerminal, setBranchGroupTerminal) + + def addBranchGroupTerminal(self, *BranchGroupTerminal): + for obj in BranchGroupTerminal: + obj.Terminal = self + + def removeBranchGroupTerminal(self, *BranchGroupTerminal): + for obj in BranchGroupTerminal: + obj.Terminal = None + + def getBusNameMarker(self): + """The BusNameMarker used to name the bus (TopologicalNode) with the Terminal having the BusNameMarker. A bus typically have multiple Terminals connected and in of normal topologies Terminals with different BusNameMarker may be connected to the bus. In such cases the BusNameMarker can be arbitrarily selected. + """ + return self._BusNameMarker + + def setBusNameMarker(self, value): + if self._BusNameMarker is not None: + filtered = [x for x in self.BusNameMarker.Terminal if x != self] + self._BusNameMarker._Terminal = filtered + + self._BusNameMarker = value + if self._BusNameMarker is not None: + if self not in self._BusNameMarker._Terminal: + self._BusNameMarker._Terminal.append(self) + + BusNameMarker = property(getBusNameMarker, setBusNameMarker) + + def getSvPowerFlow(self): + """The power flow state associated with the terminal. + """ + return self._SvPowerFlow + + def setSvPowerFlow(self, value): + if self._SvPowerFlow is not None: + self._SvPowerFlow._Terminal = None + + self._SvPowerFlow = value + if self._SvPowerFlow is not None: + self._SvPowerFlow.Terminal = None + self._SvPowerFlow._Terminal = self + + SvPowerFlow = property(getSvPowerFlow, setSvPowerFlow) + + def getTopologicalNode(self): + """The topological node associated with the terminal. This can be used as an alternative to the connectivity node path to topological node, thus making it unneccesary to model connedtivity nodes in some cases. Note that the if connectivity nodes are in the model, this association would proably not be used. + """ + return self._TopologicalNode + + def setTopologicalNode(self, value): + if self._TopologicalNode is not None: + filtered = [x for x in self.TopologicalNode.Terminal if x != self] + self._TopologicalNode._Terminal = filtered + + self._TopologicalNode = value + if self._TopologicalNode is not None: + if self not in self._TopologicalNode._Terminal: + self._TopologicalNode._Terminal.append(self) + + TopologicalNode = property(getTopologicalNode, setTopologicalNode) + diff --git a/CIM16/IEC61970/Base/Core/VoltageLevel.py b/CIM16/IEC61970/Base/Core/VoltageLevel.py new file mode 100755 index 00000000..de64e5ca --- /dev/null +++ b/CIM16/IEC61970/Base/Core/VoltageLevel.py @@ -0,0 +1,115 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Core.EquipmentContainer import EquipmentContainer + +class VoltageLevel(EquipmentContainer): + """A collection of equipment at one common system voltage forming a switchgear. The equipment typically consist of breakers, busbars, instrumentation, control, regulation and protection devices as well as assemblies of all these.A collection of equipment at one common system voltage forming a switchgear. The equipment typically consist of breakers, busbars, instrumentation, control, regulation and protection devices as well as assemblies of all these. + """ + + def __init__(self, highVoltageLimit=0.0, lowVoltageLimit=0.0, Bays=None, Substation=None, BaseVoltage=None, *args, **kw_args): + """Initialises a new 'VoltageLevel' instance. + + @param highVoltageLimit: The bus bar's high voltage limit + @param lowVoltageLimit: The bus bar's low voltage limit + @param Bays: The association is used in the naming hierarchy. + @param Substation: The association is used in the naming hierarchy. + @param BaseVoltage: The base voltage used for all equipment within the VoltageLevel. + """ + #: The bus bar's high voltage limit + self.highVoltageLimit = highVoltageLimit + + #: The bus bar's low voltage limit + self.lowVoltageLimit = lowVoltageLimit + + self._Bays = [] + self.Bays = [] if Bays is None else Bays + + self._Substation = None + self.Substation = Substation + + self._BaseVoltage = None + self.BaseVoltage = BaseVoltage + + super(VoltageLevel, self).__init__(*args, **kw_args) + + _attrs = ["highVoltageLimit", "lowVoltageLimit"] + _attr_types = {"highVoltageLimit": float, "lowVoltageLimit": float} + _defaults = {"highVoltageLimit": 0.0, "lowVoltageLimit": 0.0} + _enums = {} + _refs = ["Bays", "Substation", "BaseVoltage"] + _many_refs = ["Bays"] + + def getBays(self): + """The association is used in the naming hierarchy. + """ + return self._Bays + + def setBays(self, value): + for x in self._Bays: + x.VoltageLevel = None + for y in value: + y._VoltageLevel = self + self._Bays = value + + Bays = property(getBays, setBays) + + def addBays(self, *Bays): + for obj in Bays: + obj.VoltageLevel = self + + def removeBays(self, *Bays): + for obj in Bays: + obj.VoltageLevel = None + + def getSubstation(self): + """The association is used in the naming hierarchy. + """ + return self._Substation + + def setSubstation(self, value): + if self._Substation is not None: + filtered = [x for x in self.Substation.VoltageLevels if x != self] + self._Substation._VoltageLevels = filtered + + self._Substation = value + if self._Substation is not None: + if self not in self._Substation._VoltageLevels: + self._Substation._VoltageLevels.append(self) + + Substation = property(getSubstation, setSubstation) + + def getBaseVoltage(self): + """The base voltage used for all equipment within the VoltageLevel. + """ + return self._BaseVoltage + + def setBaseVoltage(self, value): + if self._BaseVoltage is not None: + filtered = [x for x in self.BaseVoltage.VoltageLevel if x != self] + self._BaseVoltage._VoltageLevel = filtered + + self._BaseVoltage = value + if self._BaseVoltage is not None: + if self not in self._BaseVoltage._VoltageLevel: + self._BaseVoltage._VoltageLevel.append(self) + + BaseVoltage = property(getBaseVoltage, setBaseVoltage) + diff --git a/CIM16/IEC61970/Base/Core/__init__.py b/CIM16/IEC61970/Base/Core/__init__.py new file mode 100755 index 00000000..419adb8a --- /dev/null +++ b/CIM16/IEC61970/Base/Core/__init__.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +"""Contains the core PowerSystemResource and ConductingEquipment entities shared by all applications plus common collections of those entities. Not all applications require all the Core entities. This package does not depend on any other package except the Domain package, but most of the other packages have associations and generalizations that depend on it. +""" +""" Update: 30/08/2017 +author: Francis J. Gomez """ + +from CIM16.IEC61970.Base.Core.PowerSystemResource import PowerSystemResource +from CIM16.IEC61970.Base.Core.NameTypeAuthority import NameTypeAuthority +from CIM16.IEC61970.Base.Core.Equipment import Equipment +from CIM16.IEC61970.Base.Core.ConductingEquipment import ConductingEquipment +from CIM16.IEC61970.Base.Core.RegularTimePoint import RegularTimePoint +from CIM16.IEC61970.Base.Core.ConnectivityNode import ConnectivityNode +from CIM16.IEC61970.Base.Core.PSRType import PSRType +from CIM16.IEC61970.Base.Core.ConnectivityNodeContainer import ConnectivityNodeContainer +from CIM16.IEC61970.Base.Core.Bay import Bay +from CIM16.IEC61970.Base.Core.EquipmentContainer import EquipmentContainer +from CIM16.IEC61970.Base.Core.ReportingGroup import ReportingGroup +from CIM16.IEC61970.Base.Core.BasePower import BasePower +from CIM16.IEC61970.Base.Core.PsrList import PsrList +from CIM16.IEC61970.Base.Core.IdentifiedObject import IdentifiedObject +from CIM16.IEC61970.Base.Core.BasicIntervalSchedule import BasicIntervalSchedule +from CIM16.IEC61970.Base.Core.Curve import Curve +from CIM16.IEC61970.Base.Core.GeographicalRegion import GeographicalRegion +from CIM16.IEC61970.Base.Core.CurveData import CurveData +from CIM16.IEC61970.Base.Core.SubGeographicalRegion import SubGeographicalRegion +from CIM16.IEC61970.Base.Core.NameType import NameType +from CIM16.IEC61970.Base.Core.Substation import Substation +from CIM16.IEC61970.Base.Core.Name import Name +from CIM16.IEC61970.Base.Core.BaseVoltage import BaseVoltage +from CIM16.IEC61970.Base.Core.Terminal import Terminal +from CIM16.IEC61970.Base.Core.IrregularIntervalSchedule import IrregularIntervalSchedule +from CIM16.IEC61970.Base.Core.RegularIntervalSchedule import RegularIntervalSchedule +from CIM16.IEC61970.Base.Core.OperatingParticipant import OperatingParticipant +from CIM16.IEC61970.Base.Core.OperatingShare import OperatingShare +from CIM16.IEC61970.Base.Core.VoltageLevel import VoltageLevel +from CIM16.IEC61970.Base.Core.ReportingSuperGroup import ReportingSuperGroup +from CIM16.IEC61970.Base.Core.IrregularTimePoint import IrregularTimePoint + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Core" +nsPrefix = "cim" + + +class BreakerConfiguration(str): + """Values are: breakerAndAHalf, noBreaker, singleBreaker, doubleBreaker + """ + pass + +class CompanyType(str): + """Values are: municipal, isPrivate, pool + """ + pass + +class PhaseCode(str): + """Values are: s12N, BN, BC, ABN, s2N, N, ACN, BCN, ABCN, AC, s1N, AN, B, AB, C, A, CN, ABC + """ + pass + +class CurveStyle(str): + """Values are: formula, constantYValue, straightLineYValues, rampYValue + """ + pass + +class BusbarConfiguration(str): + """Values are: doubleBus, ringBus, singleBus, mainWithTransfer + """ + pass diff --git a/CIM16/IEC61970/Base/Meas/Analog.py b/CIM16/IEC61970/Base/Meas/Analog.py new file mode 100755 index 00000000..b8eb364a --- /dev/null +++ b/CIM16/IEC61970/Base/Meas/Analog.py @@ -0,0 +1,133 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Base.Meas.Measurement import Measurement + +class Analog(Measurement): + """Analog represents an analog Measurement.Analog represents an analog Measurement. + """ + + def __init__(self, maxValue=0.0, normalValue=0.0, positiveFlowIn=False, minValue=0.0, LimitSets=None, AnalogValues=None, SetPoint=None, *args, **kw_args): + """Initialises a new 'Analog' instance. + + @param maxValue: Normal value range maximum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values. + @param normalValue: Normal measurement value, e.g., used for percentage calculations. + @param positiveFlowIn: If true then this measurement is an active power, reactive power or current with the convention that a positive value measured at the Terminal means power is flowing into the related PowerSystemResource. + @param minValue: Normal value range minimum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values + @param LimitSets: A measurement may have zero or more limit ranges defined for it. + @param AnalogValues: The values connected to this measurement. + @param SetPoint: The Control variable associated with the Measurement + """ + #: Normal value range maximum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values. + self.maxValue = maxValue + + #: Normal measurement value, e.g., used for percentage calculations. + self.normalValue = normalValue + + #: If true then this measurement is an active power, reactive power or current with the convention that a positive value measured at the Terminal means power is flowing into the related PowerSystemResource. + self.positiveFlowIn = positiveFlowIn + + #: Normal value range minimum for any of the MeasurementValue.values. Used for scaling, e.g. in bar graphs or of telemetered raw values + self.minValue = minValue + + self._LimitSets = [] + self.LimitSets = [] if LimitSets is None else LimitSets + + self._AnalogValues = [] + self.AnalogValues = [] if AnalogValues is None else AnalogValues + + self._SetPoint = None + self.SetPoint = SetPoint + + super(Analog, self).__init__(*args, **kw_args) + + _attrs = ["maxValue", "normalValue", "positiveFlowIn", "minValue"] + _attr_types = {"maxValue": float, "normalValue": float, "positiveFlowIn": bool, "minValue": float} + _defaults = {"maxValue": 0.0, "normalValue": 0.0, "positiveFlowIn": False, "minValue": 0.0} + _enums = {} + _refs = ["LimitSets", "AnalogValues", "SetPoint"] + _many_refs = ["LimitSets", "AnalogValues"] + + def getLimitSets(self): + """A measurement may have zero or more limit ranges defined for it. + """ + return self._LimitSets + + def setLimitSets(self, value): + for p in self._LimitSets: + filtered = [q for q in p.Measurements if q != self] + self._LimitSets._Measurements = filtered + for r in value: + if self not in r._Measurements: + r._Measurements.append(self) + self._LimitSets = value + + LimitSets = property(getLimitSets, setLimitSets) + + def addLimitSets(self, *LimitSets): + for obj in LimitSets: + if self not in obj._Measurements: + obj._Measurements.append(self) + self._LimitSets.append(obj) + + def removeLimitSets(self, *LimitSets): + for obj in LimitSets: + if self in obj._Measurements: + obj._Measurements.remove(self) + self._LimitSets.remove(obj) + + def getAnalogValues(self): + """The values connected to this measurement. + """ + return self._AnalogValues + + def setAnalogValues(self, value): + for x in self._AnalogValues: + x.Analog = None + for y in value: + y._Analog = self + self._AnalogValues = value + + AnalogValues = property(getAnalogValues, setAnalogValues) + + def addAnalogValues(self, *AnalogValues): + for obj in AnalogValues: + obj.Analog = self + + def removeAnalogValues(self, *AnalogValues): + for obj in AnalogValues: + obj.Analog = None + + def getSetPoint(self): + """The Control variable associated with the Measurement + """ + return self._SetPoint + + def setSetPoint(self, value): + if self._SetPoint is not None: + self._SetPoint._Analog = None + + self._SetPoint = value + if self._SetPoint is not None: + self._SetPoint.Analog = None + self._SetPoint._Analog = self + + SetPoint = property(getSetPoint, setSetPoint) + diff --git a/CIM16/IEC61970/Base/Meas/AnalogLimit.py b/CIM16/IEC61970/Base/Meas/AnalogLimit.py new file mode 100755 index 00000000..8adbea44 --- /dev/null +++ b/CIM16/IEC61970/Base/Meas/AnalogLimit.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.Limit import Limit + +class AnalogLimit(Limit): + """Limit values for Analog measurementsLimit values for Analog measurements + """ + + def __init__(self, value=0.0, LimitSet=None, *args, **kw_args): + """Initialises a new 'AnalogLimit' instance. + + @param value: The value to supervise against. + @param LimitSet: The set of limits. + """ + #: The value to supervise against. + self.value = value + + self._LimitSet = None + self.LimitSet = LimitSet + + super(AnalogLimit, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": float} + _defaults = {"value": 0.0} + _enums = {} + _refs = ["LimitSet"] + _many_refs = [] + + def getLimitSet(self): + """The set of limits. + """ + return self._LimitSet + + def setLimitSet(self, value): + if self._LimitSet is not None: + filtered = [x for x in self.LimitSet.Limits if x != self] + self._LimitSet._Limits = filtered + + self._LimitSet = value + if self._LimitSet is not None: + if self not in self._LimitSet._Limits: + self._LimitSet._Limits.append(self) + + LimitSet = property(getLimitSet, setLimitSet) + diff --git a/CIM16/IEC61970/Base/Meas/AnalogLimitSet.py b/CIM16/IEC61970/Base/Meas/AnalogLimitSet.py new file mode 100755 index 00000000..58b5926e --- /dev/null +++ b/CIM16/IEC61970/Base/Meas/AnalogLimitSet.py @@ -0,0 +1,97 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Meas.LimitSet import LimitSet + +class AnalogLimitSet(LimitSet): + """An AnalogLimitSet specifies a set of Limits that are associated with an Analog measurement.An AnalogLimitSet specifies a set of Limits that are associated with an Analog measurement. + """ + + def __init__(self, Limits=None, Measurements=None, *args, **kw_args): + """Initialises a new 'AnalogLimitSet' instance. + + @param Limits: The limit values used for supervision of Measurements. + @param Measurements: The Measurements using the LimitSet. + """ + self._Limits = [] + self.Limits = [] if Limits is None else Limits + + self._Measurements = [] + self.Measurements = [] if Measurements is None else Measurements + + super(AnalogLimitSet, self).__init__(*args, **kw_args) + + _attrs = [] + _attr_types = {} + _defaults = {} + _enums = {} + _refs = ["Limits", "Measurements"] + _many_refs = ["Limits", "Measurements"] + + def getLimits(self): + """The limit values used for supervision of Measurements. + """ + return self._Limits + + def setLimits(self, value): + for x in self._Limits: + x.LimitSet = None + for y in value: + y._LimitSet = self + self._Limits = value + + Limits = property(getLimits, setLimits) + + def addLimits(self, *Limits): + for obj in Limits: + obj.LimitSet = self + + def removeLimits(self, *Limits): + for obj in Limits: + obj.LimitSet = None + + def getMeasurements(self): + """The Measurements using the LimitSet. + """ + return self._Measurements + + def setMeasurements(self, value): + for p in self._Measurements: + filtered = [q for q in p.LimitSets if q != self] + self._Measurements._LimitSets = filtered + for r in value: + if self not in r._LimitSets: + r._LimitSets.append(self) + self._Measurements = value + + Measurements = property(getMeasurements, setMeasurements) + + def addMeasurements(self, *Measurements): + for obj in Measurements: + if self not in obj._LimitSets: + obj._LimitSets.append(self) + self._Measurements.append(obj) + + def removeMeasurements(self, *Measurements): + for obj in Measurements: + if self in obj._LimitSets: + obj._LimitSets.remove(self) + self._Measurements.remove(obj) + diff --git a/CIM16/IEC61970/Base/Meas/AnalogValue.py b/CIM16/IEC61970/Base/Meas/AnalogValue.py new file mode 100755 index 00000000..026cdb61 --- /dev/null +++ b/CIM16/IEC61970/Base/Meas/AnalogValue.py @@ -0,0 +1,116 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Base.Meas.MeasurementValue import MeasurementValue + +class AnalogValue(MeasurementValue): + """AnalogValue represents an analog MeasurementValue.AnalogValue represents an analog MeasurementValue. + """ + + def __init__(self, value=0.0, AltTieMeas=None, Analog=None, AltGeneratingUnit=None, *args, **kw_args): + """Initialises a new 'AnalogValue' instance. + + @param value: The value to supervise. + @param AltTieMeas: The usage of the measurement within the control area specification. + @param Analog: Measurement to which this value is connected. + @param AltGeneratingUnit: The alternate generating unit for which this measurement value applies. + """ + #: The value to supervise. + self.value = value + + self._AltTieMeas = [] + self.AltTieMeas = [] if AltTieMeas is None else AltTieMeas + + self._Analog = None + self.Analog = Analog + + self._AltGeneratingUnit = [] + self.AltGeneratingUnit = [] if AltGeneratingUnit is None else AltGeneratingUnit + + super(AnalogValue, self).__init__(*args, **kw_args) + + _attrs = ["value"] + _attr_types = {"value": float} + _defaults = {"value": 0.0} + _enums = {} + _refs = ["AltTieMeas", "Analog", "AltGeneratingUnit"] + _many_refs = ["AltTieMeas", "AltGeneratingUnit"] + + def getAltTieMeas(self): + """The usage of the measurement within the control area specification. + """ + return self._AltTieMeas + + def setAltTieMeas(self, value): + for x in self._AltTieMeas: + x.AnalogValue = None + for y in value: + y._AnalogValue = self + self._AltTieMeas = value + + AltTieMeas = property(getAltTieMeas, setAltTieMeas) + + def addAltTieMeas(self, *AltTieMeas): + for obj in AltTieMeas: + obj.AnalogValue = self + + def removeAltTieMeas(self, *AltTieMeas): + for obj in AltTieMeas: + obj.AnalogValue = None + + def getAnalog(self): + """Measurement to which this value is connected. + """ + return self._Analog + + def setAnalog(self, value): + if self._Analog is not None: + filtered = [x for x in self.Analog.AnalogValues if x != self] + self._Analog._AnalogValues = filtered + + self._Analog = value + if self._Analog is not None: + if self not in self._Analog._AnalogValues: + self._Analog._AnalogValues.append(self) + + Analog = property(getAnalog, setAnalog) + + def getAltGeneratingUnit(self): + """The alternate generating unit for which this measurement value applies. + """ + return self._AltGeneratingUnit + + def setAltGeneratingUnit(self, value): + for x in self._AltGeneratingUnit: + x.AnalogValue = None + for y in value: + y._AnalogValue = self + self._AltGeneratingUnit = value + + AltGeneratingUnit = property(getAltGeneratingUnit, setAltGeneratingUnit) + + def addAltGeneratingUnit(self, *AltGeneratingUnit): + for obj in AltGeneratingUnit: + obj.AnalogValue = self + + def removeAltGeneratingUnit(self, *AltGeneratingUnit): + for obj in AltGeneratingUnit: + obj.AnalogValue = None + diff --git a/CIM16/IEC61970/Base/Meas/Measurement.py b/CIM16/IEC61970/Base/Meas/Measurement.py new file mode 100755 index 00000000..9194d702 --- /dev/null +++ b/CIM16/IEC61970/Base/Meas/Measurement.py @@ -0,0 +1,180 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Base.Core.IdentifiedObject import IdentifiedObject + +class Measurement(IdentifiedObject): + """A Measurement represents any measured, calculated or non-measured non-calculated quantity. Any piece of equipment may contain Measurements, e.g. a substation may have temperature measurements and door open indications, a transformer may have oil temperature and tank pressure measurements, a bay may contain a number of power flow measurements and a Breaker may contain a switch status measurement. The PSR - Measurement association is intended to capture this use of Measurement and is included in the naming hierarchy based on EquipmentContainer. The naming hierarchy typically has Measurements as leafs, e.g. Substation-VoltageLevel-Bay-Switch-Measurement. Some Measurements represent quantities related to a particular sensor location in the network, e.g. a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. The sensing position is not captured in the PSR - Measurement association. Instead it is captured by the Measurement - Terminal association that is used to define the sensing location in the network topology. The location is defined by the connection of the Terminal to ConductingEquipment. Two possible paths exist: 1) Measurement-Terminal- ConnectivityNode-Terminal-ConductingEquipment 2) Measurement-Terminal-ConductingEquipment Alternative 2 is the only allowed use. When the sensor location is needed both Measurement-PSR and Measurement-Terminal are used. The Measurement-Terminal association is never used alone.A Measurement represents any measured, calculated or non-measured non-calculated quantity. Any piece of equipment may contain Measurements, e.g. a substation may have temperature measurements and door open indications, a transformer may have oil temperature and tank pressure measurements, a bay may contain a number of power flow measurements and a Breaker may contain a switch status measurement. The PSR - Measurement association is intended to capture this use of Measurement and is included in the naming hierarchy based on EquipmentContainer. The naming hierarchy typically has Measurements as leafs, e.g. Substation-VoltageLevel-Bay-Switch-Measurement. Some Measurements represent quantities related to a particular sensor location in the network, e.g. a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. The sensing position is not captured in the PSR - Measurement association. Instead it is captured by the Measurement - Terminal association that is used to define the sensing location in the network topology. The location is defined by the connection of the Terminal to ConductingEquipment. Two possible paths exist: 1) Measurement-Terminal- ConnectivityNode-Terminal-ConductingEquipment 2) Measurement-Terminal-ConductingEquipment Alternative 2 is the only allowed use. When the sensor location is needed both Measurement-PSR and Measurement-Terminal are used. The Measurement-Terminal association is never used alone. + """ + + def __init__(self, phases="s12N", measurementType='', unitMultiplier="M", unitSymbol="N", Terminal=None, PowerSystemResource=None, Locations=None, Asset=None, Documents=None, *args, **kw_args): + """Initialises a new 'Measurement' instance. + + @param phases: Indicates to which phases the measurement applies and avoids the need to use 'measurementType' to also encode phase information (which would explode the types). Since Controls have associations with Measurements, they will have the capability to handle each phase. The phase information in Measurement, along with 'measurementType' and 'phaseConnection' uniquely defines a Measurement for a device, based on normal network phase. Their meaning will not change when the computed energizing phasing is changed due to jumpers or other reasons. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + @param measurementType: Specifies the type of Measurement, e.g. IndoorTemperature, OutDoorTemperature, BusVoltage, GeneratorVoltage, LineFlow etc. + @param unitMultiplier: The unit multiplier of the measured quantity. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + @param unitSymbol: The unit of measure of the measured quantity. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "degC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + @param Terminal: One or more measurements may be associated with a terminal in the network + @param PowerSystemResource: The PowerSystemResource that contains the Measurement in the naming hierarchy + @param Locations: + @param Asset: + @param Documents: Measurements are specified in types of documents, such as procedures. + """ + #: Indicates to which phases the measurement applies and avoids the need to use 'measurementType' to also encode phase information (which would explode the types). Since Controls have associations with Measurements, they will have the capability to handle each phase. The phase information in Measurement, along with 'measurementType' and 'phaseConnection' uniquely defines a Measurement for a device, based on normal network phase. Their meaning will not change when the computed energizing phasing is changed due to jumpers or other reasons. Values are: "s12N", "BN", "BC", "ABN", "s2N", "N", "ACN", "BCN", "ABCN", "AC", "s1N", "AN", "B", "AB", "C", "A", "CN", "ABC" + self.phases = phases + + #: Specifies the type of Measurement, e.g. IndoorTemperature, OutDoorTemperature, BusVoltage, GeneratorVoltage, LineFlow etc. + self.measurementType = measurementType + + #: The unit multiplier of the measured quantity. Values are: "M", "G", "d", "micro", "c", "p", "n", "T", "k", "m", "none" + self.unitMultiplier = unitMultiplier + + #: The unit of measure of the measured quantity. Values are: "N", "A", "rad", "VAh", "Pa", "J", "h", "Hz", "VArh", "ohm", "H", "m3", "deg", "V", "degC", "F", "Wh", "s", "g", "min", "S", "none", "W", "VAr", "m2", "m", "VA" + self.unitSymbol = unitSymbol + + self._Terminal = None + self.Terminal = Terminal + + self._PowerSystemResource = None + self.PowerSystemResource = PowerSystemResource + + self._Locations = [] + self.Locations = [] if Locations is None else Locations + + self._Asset = None + self.Asset = Asset + + self._Documents = [] + self.Documents = [] if Documents is None else Documents + + super(Measurement, self).__init__(*args, **kw_args) + + _attrs = ["phases", "measurementType", "unitMultiplier", "unitSymbol"] + _attr_types = {"phases": str, "measurementType": str, "unitMultiplier": str, "unitSymbol": str} + _defaults = {"phases": "s12N", "measurementType": '', "unitMultiplier": "M", "unitSymbol": "N"} + _enums = {"phases": "PhaseCode", "unitMultiplier": "UnitMultiplier", "unitSymbol": "UnitSymbol"} + _refs = ["Terminal", "PowerSystemResource", "Locations", "Asset", "Documents"] + _many_refs = ["Locations", "Documents"] + + def getTerminal(self): + """One or more measurements may be associated with a terminal in the network + """ + return self._Terminal + + def setTerminal(self, value): + if self._Terminal is not None: + filtered = [x for x in self.Terminal.Measurements if x != self] + self._Terminal._Measurements = filtered + + self._Terminal = value + if self._Terminal is not None: + if self not in self._Terminal._Measurements: + self._Terminal._Measurements.append(self) + + Terminal = property(getTerminal, setTerminal) + + def getPowerSystemResource(self): + """The PowerSystemResource that contains the Measurement in the naming hierarchy + """ + return self._PowerSystemResource + + def setPowerSystemResource(self, value): + if self._PowerSystemResource is not None: + filtered = [x for x in self.PowerSystemResource.Measurements if x != self] + self._PowerSystemResource._Measurements = filtered + + self._PowerSystemResource = value + if self._PowerSystemResource is not None: + if self not in self._PowerSystemResource._Measurements: + self._PowerSystemResource._Measurements.append(self) + + PowerSystemResource = property(getPowerSystemResource, setPowerSystemResource) + + def getLocations(self): + + return self._Locations + + def setLocations(self, value): + for p in self._Locations: + filtered = [q for q in p.Measurements if q != self] + self._Locations._Measurements = filtered + for r in value: + if self not in r._Measurements: + r._Measurements.append(self) + self._Locations = value + + Locations = property(getLocations, setLocations) + + def addLocations(self, *Locations): + for obj in Locations: + if self not in obj._Measurements: + obj._Measurements.append(self) + self._Locations.append(obj) + + def removeLocations(self, *Locations): + for obj in Locations: + if self in obj._Measurements: + obj._Measurements.remove(self) + self._Locations.remove(obj) + + def getAsset(self): + + return self._Asset + + def setAsset(self, value): + if self._Asset is not None: + filtered = [x for x in self.Asset.Measurements if x != self] + self._Asset._Measurements = filtered + + self._Asset = value + if self._Asset is not None: + if self not in self._Asset._Measurements: + self._Asset._Measurements.append(self) + + Asset = property(getAsset, setAsset) + + def getDocuments(self): + """Measurements are specified in types of documents, such as procedures. + """ + return self._Documents + + def setDocuments(self, value): + for p in self._Documents: + filtered = [q for q in p.Measurements if q != self] + self._Documents._Measurements = filtered + for r in value: + if self not in r._Measurements: + r._Measurements.append(self) + self._Documents = value + + Documents = property(getDocuments, setDocuments) + + def addDocuments(self, *Documents): + for obj in Documents: + if self not in obj._Measurements: + obj._Measurements.append(self) + self._Documents.append(obj) + + def removeDocuments(self, *Documents): + for obj in Documents: + if self in obj._Measurements: + obj._Measurements.remove(self) + self._Documents.remove(obj) + diff --git a/CIM16/IEC61970/Base/Meas/MeasurementValue.py b/CIM16/IEC61970/Base/Meas/MeasurementValue.py new file mode 100755 index 00000000..906db44b --- /dev/null +++ b/CIM16/IEC61970/Base/Meas/MeasurementValue.py @@ -0,0 +1,184 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +from CIM16.IEC61970.Base.Core.IdentifiedObject import IdentifiedObject + +class MeasurementValue(IdentifiedObject): + """The current state for a measurement. A state value is an instance of a measurement from a specific source. Measurements can be associated with many state values, each representing a different source for the measurement.The current state for a measurement. A state value is an instance of a measurement from a specific source. Measurements can be associated with many state values, each representing a different source for the measurement. + """ + + def __init__(self, sensorAccuracy=0.0, timeStamp='', GmlValues=None, MeasurementValueQuality=None, ProcedureDataSets=None, MeasurementValueSource=None, ErpPerson=None, RemoteSource=None, *args, **kw_args): + """Initialises a new 'MeasurementValue' instance. + + @param sensorAccuracy: The limit, expressed as a percentage of the sensor maximum, that errors will not exceed when the sensor is used under reference conditions. + @param timeStamp: The time when the value was last updated + @param GmlValues: + @param MeasurementValueQuality: A MeasurementValue has a MeasurementValueQuality associated with it. + @param ProcedureDataSets: + @param MeasurementValueSource: A reference to the type of source that updates the MeasurementValue, e.g. SCADA, CCLink, manual, etc. User conventions for the names of sources are contained in the introduction to IEC 61970-301. + @param ErpPerson: + @param RemoteSource: Link to the physical telemetered point associated with this measurement. + """ + #: The limit, expressed as a percentage of the sensor maximum, that errors will not exceed when the sensor is used under reference conditions. + self.sensorAccuracy = sensorAccuracy + + #: The time when the value was last updated + self.timeStamp = timeStamp + + self._GmlValues = [] + self.GmlValues = [] if GmlValues is None else GmlValues + + self._MeasurementValueQuality = None + self.MeasurementValueQuality = MeasurementValueQuality + + self._ProcedureDataSets = [] + self.ProcedureDataSets = [] if ProcedureDataSets is None else ProcedureDataSets + + self._MeasurementValueSource = None + self.MeasurementValueSource = MeasurementValueSource + + self._ErpPerson = None + self.ErpPerson = ErpPerson + + self._RemoteSource = None + self.RemoteSource = RemoteSource + + super(MeasurementValue, self).__init__(*args, **kw_args) + + _attrs = ["sensorAccuracy", "timeStamp"] + _attr_types = {"sensorAccuracy": float, "timeStamp": str} + _defaults = {"sensorAccuracy": 0.0, "timeStamp": ''} + _enums = {} + _refs = ["GmlValues", "MeasurementValueQuality", "ProcedureDataSets", "MeasurementValueSource", "ErpPerson", "RemoteSource"] + _many_refs = ["GmlValues", "ProcedureDataSets"] + + def getGmlValues(self): + + return self._GmlValues + + def setGmlValues(self, value): + for x in self._GmlValues: + x.MeasurementValue = None + for y in value: + y._MeasurementValue = self + self._GmlValues = value + + GmlValues = property(getGmlValues, setGmlValues) + + def addGmlValues(self, *GmlValues): + for obj in GmlValues: + obj.MeasurementValue = self + + def removeGmlValues(self, *GmlValues): + for obj in GmlValues: + obj.MeasurementValue = None + + def getMeasurementValueQuality(self): + """A MeasurementValue has a MeasurementValueQuality associated with it. + """ + return self._MeasurementValueQuality + + def setMeasurementValueQuality(self, value): + if self._MeasurementValueQuality is not None: + self._MeasurementValueQuality._MeasurementValue = None + + self._MeasurementValueQuality = value + if self._MeasurementValueQuality is not None: + self._MeasurementValueQuality.MeasurementValue = None + self._MeasurementValueQuality._MeasurementValue = self + + MeasurementValueQuality = property(getMeasurementValueQuality, setMeasurementValueQuality) + + def getProcedureDataSets(self): + + return self._ProcedureDataSets + + def setProcedureDataSets(self, value): + for p in self._ProcedureDataSets: + filtered = [q for q in p.MeasurementValues if q != self] + self._ProcedureDataSets._MeasurementValues = filtered + for r in value: + if self not in r._MeasurementValues: + r._MeasurementValues.append(self) + self._ProcedureDataSets = value + + ProcedureDataSets = property(getProcedureDataSets, setProcedureDataSets) + + def addProcedureDataSets(self, *ProcedureDataSets): + for obj in ProcedureDataSets: + if self not in obj._MeasurementValues: + obj._MeasurementValues.append(self) + self._ProcedureDataSets.append(obj) + + def removeProcedureDataSets(self, *ProcedureDataSets): + for obj in ProcedureDataSets: + if self in obj._MeasurementValues: + obj._MeasurementValues.remove(self) + self._ProcedureDataSets.remove(obj) + + def getMeasurementValueSource(self): + """A reference to the type of source that updates the MeasurementValue, e.g. SCADA, CCLink, manual, etc. User conventions for the names of sources are contained in the introduction to IEC 61970-301. + """ + return self._MeasurementValueSource + + def setMeasurementValueSource(self, value): + if self._MeasurementValueSource is not None: + filtered = [x for x in self.MeasurementValueSource.MeasurementValues if x != self] + self._MeasurementValueSource._MeasurementValues = filtered + + self._MeasurementValueSource = value + if self._MeasurementValueSource is not None: + if self not in self._MeasurementValueSource._MeasurementValues: + self._MeasurementValueSource._MeasurementValues.append(self) + + MeasurementValueSource = property(getMeasurementValueSource, setMeasurementValueSource) + + def getErpPerson(self): + + return self._ErpPerson + + def setErpPerson(self, value): + if self._ErpPerson is not None: + filtered = [x for x in self.ErpPerson.MeasurementValues if x != self] + self._ErpPerson._MeasurementValues = filtered + + self._ErpPerson = value + if self._ErpPerson is not None: + if self not in self._ErpPerson._MeasurementValues: + self._ErpPerson._MeasurementValues.append(self) + + ErpPerson = property(getErpPerson, setErpPerson) + + def getRemoteSource(self): + """Link to the physical telemetered point associated with this measurement. + """ + return self._RemoteSource + + def setRemoteSource(self, value): + if self._RemoteSource is not None: + self._RemoteSource._MeasurementValue = None + + self._RemoteSource = value + if self._RemoteSource is not None: + self._RemoteSource.MeasurementValue = None + self._RemoteSource._MeasurementValue = self + + RemoteSource = property(getRemoteSource, setRemoteSource) + diff --git a/CIM16/IEC61970/Base/Meas/__init__.py b/CIM16/IEC61970/Base/Meas/__init__.py new file mode 100644 index 00000000..26f4d9ea --- /dev/null +++ b/CIM16/IEC61970/Base/Meas/__init__.py @@ -0,0 +1,33 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + + +""" Update: 24/08/2017 +author: Francis J. Gomez """ + +from CIM16.IEC61970.Base.Meas.Analog import Analog +from CIM16.IEC61970.Base.Meas.AnalogLimit import AnalogLimit +from CIM16.IEC61970.Base.Meas.AnalogLimitSet import AnalogLimitSet +from CIM16.IEC61970.Base.Meas.AnalogValue import AnalogValue +from CIM16.IEC61970.Base.Meas.Measurement import Measurement +from CIM16.IEC61970.Base.Meas.MeasurementValue import MeasurementValue + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Meas" +nsPrefix = "cim" diff --git a/CIM16/IEC61970/Base/__init__.py b/CIM16/IEC61970/Base/__init__.py new file mode 100644 index 00000000..3b3a2690 --- /dev/null +++ b/CIM16/IEC61970/Base/__init__.py @@ -0,0 +1,28 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gomez (fragom@kth.se) +# Modified date: 05/06/2017 + +""" Update: 24/08/2017 +author: Francis J. Gomez """ + +nsURI = "http://iec.ch/TC57/2013/CIM-schema-cim16#Base" +nsPrefix = "cim" \ No newline at end of file diff --git a/CIM16/IEC61970/Dynamics/DynamicsFunctionBlock.py b/CIM16/IEC61970/Dynamics/DynamicsFunctionBlock.py index 1e9d34dd..b5980ec3 100755 --- a/CIM16/IEC61970/Dynamics/DynamicsFunctionBlock.py +++ b/CIM16/IEC61970/Dynamics/DynamicsFunctionBlock.py @@ -18,7 +18,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gomez (fragom@kth.se) # Modified date: 05/06/2017 from CIM16.IEC61970.Core.IdentifiedObject import IdentifiedObject diff --git a/CIM16/IEC61970/Dynamics/RotatingMachineDynamics.py b/CIM16/IEC61970/Dynamics/RotatingMachineDynamics.py index c866ee7a..80508248 100755 --- a/CIM16/IEC61970/Dynamics/RotatingMachineDynamics.py +++ b/CIM16/IEC61970/Dynamics/RotatingMachineDynamics.py @@ -18,7 +18,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gomez (fragom@kth.se) # Modified date: 05/06/2017 from CIM16.IEC61970.Dynamics.DynamicsFunctionBlock import DynamicsFunctionBlock diff --git a/CIM16/IEC61970/Dynamics/SynchronousMachineDetailed.py b/CIM16/IEC61970/Dynamics/SynchronousMachineDetailed.py index 3f86ad0f..b6bfca9a 100755 --- a/CIM16/IEC61970/Dynamics/SynchronousMachineDetailed.py +++ b/CIM16/IEC61970/Dynamics/SynchronousMachineDetailed.py @@ -18,7 +18,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gomez (fragom@kth.se) # Modified date: 05/06/2017 from CIM16.IEC61970.Dynamics.SynchronousMachineDynamics import SynchronousMachineDynamics diff --git a/CIM16/IEC61970/Dynamics/SynchronousMachineDynamics.py b/CIM16/IEC61970/Dynamics/SynchronousMachineDynamics.py index f1ca827c..f731d8ca 100755 --- a/CIM16/IEC61970/Dynamics/SynchronousMachineDynamics.py +++ b/CIM16/IEC61970/Dynamics/SynchronousMachineDynamics.py @@ -18,7 +18,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gomez (fragom@kth.se) # Modified date: 05/06/2017 from CIM16.IEC61970.Dynamics.RotatingMachineDynamics import RotatingMachineDynamics diff --git a/CIM16/IEC61970/Dynamics/SynchronousMachineEquivalentCircuit.py b/CIM16/IEC61970/Dynamics/SynchronousMachineEquivalentCircuit.py index 81d4d83d..67e7dfc9 100755 --- a/CIM16/IEC61970/Dynamics/SynchronousMachineEquivalentCircuit.py +++ b/CIM16/IEC61970/Dynamics/SynchronousMachineEquivalentCircuit.py @@ -18,7 +18,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gomez (fragom@kth.se) # Modified date: 05/06/2017 from CIM16.IEC61970.Dynamics.SynchronousMachineDetailed import SynchronousMachineDetailed diff --git a/CIM16/IEC61970/Dynamics/SynchronousMachineSimplified.py b/CIM16/IEC61970/Dynamics/SynchronousMachineSimplified.py index 448a4f01..482cfad9 100755 --- a/CIM16/IEC61970/Dynamics/SynchronousMachineSimplified.py +++ b/CIM16/IEC61970/Dynamics/SynchronousMachineSimplified.py @@ -18,7 +18,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gomez (fragom@kth.se) # Modified date: 05/06/2017 from CIM16.IEC61970.Dynamics.SynchronousMachineDynamics import SynchronousMachineDynamics diff --git a/CIM16/IEC61970/Dynamics/SynchronousMachineTimeConstantReactance.py b/CIM16/IEC61970/Dynamics/SynchronousMachineTimeConstantReactance.py index 0061b812..28878c2c 100755 --- a/CIM16/IEC61970/Dynamics/SynchronousMachineTimeConstantReactance.py +++ b/CIM16/IEC61970/Dynamics/SynchronousMachineTimeConstantReactance.py @@ -18,7 +18,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gomez (fragom@kth.se) # Modified date: 05/06/2017 from CIM16.IEC61970.Dynamics.SynchronousMachineDetailed import SynchronousMachineDetailed diff --git a/CIM16/IEC61970/Dynamics/SynchronousMachineUserDefined.py b/CIM16/IEC61970/Dynamics/SynchronousMachineUserDefined.py index 6733013f..deda5acc 100755 --- a/CIM16/IEC61970/Dynamics/SynchronousMachineUserDefined.py +++ b/CIM16/IEC61970/Dynamics/SynchronousMachineUserDefined.py @@ -18,7 +18,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gomez (fragom@kth.se) # Modified date: 05/06/2017 from CIM16.IEC61970.Dynamics.SynchronousMachineDynamics import SynchronousMachineDynamics diff --git a/CIM16/IEC61970/Dynamics/__init__.py b/CIM16/IEC61970/Dynamics/__init__.py index 83e849ac..55832ce3 100755 --- a/CIM16/IEC61970/Dynamics/__init__.py +++ b/CIM16/IEC61970/Dynamics/__init__.py @@ -18,7 +18,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gomez (fragom@kth.se) # Modified date: 05/06/2017 from CIM16.IEC61970.Dynamics.DynamicsFunctionBlock import DynamicsFunctionBlock diff --git a/CIM16/IEC61970/IEC61970CIMVersion.py b/CIM16/IEC61970/IEC61970CIMVersion.py index 1d0e53ad..b594d85b 100755 --- a/CIM16/IEC61970/IEC61970CIMVersion.py +++ b/CIM16/IEC61970/IEC61970CIMVersion.py @@ -18,7 +18,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gomez (fragom@kth.se) # Modified date: 05/06/2017 from CIM16.Element import Element diff --git a/CIM16/IEC61970/__init__.py b/CIM16/IEC61970/__init__.py index 2080a8b9..1dab4e7a 100755 --- a/CIM16/IEC61970/__init__.py +++ b/CIM16/IEC61970/__init__.py @@ -18,7 +18,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gomez (fragom@kth.se) # Modified date: 05/06/2017 from CIM16.IEC61970.IEC61970CIMVersion import IEC61970CIMVersion diff --git a/CIM16/__init__.py b/CIM16/__init__.py index 3223265e..f335524a 100755 --- a/CIM16/__init__.py +++ b/CIM16/__init__.py @@ -20,7 +20,7 @@ """This package shows all the root level subpackage dependencies of the combined CIM model. """ -# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gomez (fragom@kth.se) # Modified date: 05/06/2017 from CIM16.CombinedVersion import CombinedVersion @@ -404,13 +404,13 @@ "AccumulatorLimit": "CIM16.IEC61970.Meas", "ValueToAlias": "CIM16.IEC61970.Meas", "MeasurementValueSource": "CIM16.IEC61970.Meas", - "Analog": "CIM16.IEC61970.Meas", - "AnalogValue": "CIM16.IEC61970.Meas", - "Measurement": "CIM16.IEC61970.Meas", + "Analog": "CIM16.IEC61970.Base.Meas", + "AnalogValue": "CIM16.IEC61970.Base.Meas", + "Measurement": "CIM16.IEC61970.Base.Meas", "ControlType": "CIM16.IEC61970.Meas", "StringMeasurementValue": "CIM16.IEC61970.Meas", "StringMeasurement": "CIM16.IEC61970.Meas", - "AnalogLimit": "CIM16.IEC61970.Meas", + "AnalogLimit": "CIM16.IEC61970.Base.Meas", "SetPoint": "CIM16.IEC61970.Meas", "Limit": "CIM16.IEC61970.Meas", "Discrete": "CIM16.IEC61970.Meas", @@ -420,7 +420,7 @@ "Command": "CIM16.IEC61970.Meas", "Accumulator": "CIM16.IEC61970.Meas", "MeasurementValueQuality": "CIM16.IEC61970.Meas", - "MeasurementValue": "CIM16.IEC61970.Meas", + "MeasurementValue": "CIM16.IEC61970.Base.Meas", "DiscreteValue": "CIM16.IEC61970.Meas", "AnalogLimitSet": "CIM16.IEC61970.Meas", "LimitSet": "CIM16.IEC61970.Meas", @@ -457,37 +457,37 @@ "SurgeProtector": "CIM16.IEC61970.AuxiliaryEquipment", "FaultIndicator": "CIM16.IEC61970.AuxiliaryEquipment", "DateTimeInterval": "CIM16.IEC61970.Domain", - "PowerSystemResource": "CIM16.IEC61970.Core", - "NameTypeAuthority": "CIM16.IEC61970.Core", - "Equipment": "CIM16.IEC61970.Core", - "ConductingEquipment": "CIM16.IEC61970.Core", - "RegularTimePoint": "CIM16.IEC61970.Core", - "ConnectivityNode": "CIM16.IEC61970.Core", - "PSRType": "CIM16.IEC61970.Core", - "ConnectivityNodeContainer": "CIM16.IEC61970.Core", - "Bay": "CIM16.IEC61970.Core", - "EquipmentContainer": "CIM16.IEC61970.Core", - "ReportingGroup": "CIM16.IEC61970.Core", - "BasePower": "CIM16.IEC61970.Core", - "PsrList": "CIM16.IEC61970.Core", - "IdentifiedObject": "CIM16.IEC61970.Core", - "BasicIntervalSchedule": "CIM16.IEC61970.Core", - "Curve": "CIM16.IEC61970.Core", - "GeographicalRegion": "CIM16.IEC61970.Core", - "CurveData": "CIM16.IEC61970.Core", - "SubGeographicalRegion": "CIM16.IEC61970.Core", - "NameType": "CIM16.IEC61970.Core", - "Substation": "CIM16.IEC61970.Core", - "Name": "CIM16.IEC61970.Core", - "BaseVoltage": "CIM16.IEC61970.Core", - "Terminal": "CIM16.IEC61970.Core", - "IrregularIntervalSchedule": "CIM16.IEC61970.Core", - "RegularIntervalSchedule": "CIM16.IEC61970.Core", - "OperatingParticipant": "CIM16.IEC61970.Core", - "OperatingShare": "CIM16.IEC61970.Core", - "VoltageLevel": "CIM16.IEC61970.Core", - "ReportingSuperGroup": "CIM16.IEC61970.Core", - "IrregularTimePoint": "CIM16.IEC61970.Core", + "PowerSystemResource": "CIM16.IEC61970.Base.Core", + "NameTypeAuthority": "CIM16.IEC61970.Base.Core", + "Equipment": "CIM16.IEC61970.Base.Core", + "ConductingEquipment": "CIM16.IEC61970.Base.Core", + "RegularTimePoint": "CIM16.IEC61970.Base.Core", + "ConnectivityNode": "CIM16.IEC61970.Base.Core", + "PSRType": "CIM16.IEC61970.Base.Core", + "ConnectivityNodeContainer": "CIM16.IEC61970.Base.Core", + "Bay": "CIM16.IEC61970.Base.Core", + "EquipmentContainer": "CIM16.IEC61970.Base.Core", + "ReportingGroup": "CIM16.IEC61970.Base.Core", + "BasePower": "CIM16.IEC61970.Base.Core", + "PsrList": "CIM16.IEC61970.Base.Core", + "IdentifiedObject": "CIM16.IEC61970.Base.Core", + "BasicIntervalSchedule": "CIM16.IEC61970.Base.Core", + "Curve": "CIM16.IEC61970.Base.Core", + "GeographicalRegion": "CIM16.IEC61970.Base.Core", + "CurveData": "CIM16.IEC61970.Base.Core", + "SubGeographicalRegion": "CIM16.IEC61970.Base.Core", + "NameType": "CIM16.IEC61970.Base.Core", + "Substation": "CIM16.IEC61970.Base.Core", + "Name": "CIM16.IEC61970.Base.Core", + "BaseVoltage": "CIM16.IEC61970.Base.Core", + "Terminal": "CIM16.IEC61970.Base.Core", + "IrregularIntervalSchedule": "CIM16.IEC61970.Base.Core", + "RegularIntervalSchedule": "CIM16.IEC61970.Base.Core", + "OperatingParticipant": "CIM16.IEC61970.Base.Core", + "OperatingShare": "CIM16.IEC61970.Base.Core", + "VoltageLevel": "CIM16.IEC61970.Base.Core", + "ReportingSuperGroup": "CIM16.IEC61970.Base.Core", + "IrregularTimePoint": "CIM16.IEC61970.Base.Core", "TextDiagramObject": "CIM16.IEC61970.Graphics", "DiagramObjectGluePoint": "CIM16.IEC61970.Graphics", "DiagramObject": "CIM16.IEC61970.Graphics", diff --git a/PyCIM/RDFXMLReader.py b/PyCIM/RDFXMLReader.py index 02da384d..ebd7f0b8 100644 --- a/PyCIM/RDFXMLReader.py +++ b/PyCIM/RDFXMLReader.py @@ -21,7 +21,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gómez (fragom@kth.se) +# Modified by Gustav Holm (guholm@kth.se) & Francis J. Gomez (fragom@kth.se) # Modified date: 05/06/2017 from xml.etree.cElementTree import iterparse @@ -257,6 +257,18 @@ def get_rdf_ns(namespaces): return ns +def get_pti_ns(namespaces): + ''' Support for pti namespace. CIM file generated from PSS/E ODMS. + To be extended for newer version of pti, support for CIM 15 / CIM 16''' + ''' author: Francis J. Gomez ''' + ''' date: 18/09/2017 ''' + try: + ns = namespaces['pti'] + except KeyError: + ns = "http://www.pti-us.com/PTI_CIM-schema-cim14#" + logger.warn('No pti namespace found. Using %s' % ns) + + return ns def get_cim_ns(namespaces): """ diff --git a/PyCIM/RDFXMLWriter.py b/PyCIM/RDFXMLWriter.py index e5a3c4e9..406f4ad1 100644 --- a/PyCIM/RDFXMLWriter.py +++ b/PyCIM/RDFXMLWriter.py @@ -22,8 +22,8 @@ from time import time -from CIM15 import nsURI, nsPrefix - +#from CIM15 import nsPrefix, nsURI +from CIM16 import nsPrefix, nsURI from PyCIM.SimpleXMLWriter import XMLWriter nsPrefixRDF = "rdf" @@ -53,8 +53,14 @@ def cimwrite(d, source, encoding="utf-8"): # Write the XML declaration. w.declaration() + # TODO print the econding in the header tag + # TODO add carry return into the XMLWriter # Add a '#' suffix to the CIM namespace URI if not present. nsCIM = nsURI if nsURI[-1] == "#" else nsURI + "#" + # TODO Add ns for + # xmlns:entsoe="http://entsoe.eu/CIM/SchemaExtension/3/1#" + # xmlns:cim="http://iec.ch/TC57/2013/CIM-schema-cim16#" + # xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" # Start the root RDF element and declare namespaces. xmlns = {u"xmlns:%s" % nsPrefixRDF: nsRDF, u"xmlns:%s" % nsPrefix: nsCIM} @@ -115,9 +121,9 @@ def cimwrite(d, source, encoding="utf-8"): logging.basicConfig(level=logging.INFO) - d = cimread("Test/Data/EDF_AIGUE_v9.xml") + d = cimread("/Users/fran_jo/Desktop/PhD_CODE/cim2modelica/res/network/ieee_9bus_cim16_basic.xml") # d = cimread("Test/Data/ENTSOE_16_BE_EQ.xml") - tmp = "/tmp/cimwrite.xml" + tmp = "/Users/fran_jo/Desktop/PhD_CODE/cim2modelica/res/network/ieee_9bus_cim16_after.xml" cimwrite(d, tmp) print(xmlpp(tmp)) diff --git a/PyCIM/SimpleXMLWriter.py b/PyCIM/SimpleXMLWriter.py index 2da9f279..bc9308ca 100644 --- a/PyCIM/SimpleXMLWriter.py +++ b/PyCIM/SimpleXMLWriter.py @@ -198,6 +198,7 @@ def start(self, tag, attrib={}, **extra): tag = escape_cdata(tag, self.__encoding) self.__data = [] self.__tags.append(tag) + self.__write("\n") self.__write("<%s" % tag) if attrib or extra: combined_attrib = attrib.copy() @@ -246,6 +247,7 @@ def end(self, tag=None): elif self.__open: self.__open = 0 self.__write(" />") + self.__write("\n") return self.__write("" % tag) diff --git a/PyCIM/Test/CIM16Test.py b/PyCIM/Test/CIM16Test.py new file mode 100644 index 00000000..df014258 --- /dev/null +++ b/PyCIM/Test/CIM16Test.py @@ -0,0 +1,290 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +import unittest + +import pytest + +from CIM16.IEC61970.Core import \ + ConnectivityNode, Terminal, BaseVoltage + +from CIM16.IEC61970.LoadModel import \ + ConformLoad, ConformLoadGroup, LoadArea, ConformLoadSchedule + +from CIM16.IEC61970.Base.Meas import \ + AnalogLimit, AnalogValue, Analog + +from CIM16.IEC61970.Protection import \ + CurrentRelay, ProtectionEquipment + +from CIM16.IEC61970.Topology import \ + TopologicalNode + +from CIM16.IEC61970.Wires import \ + Breaker, SynchronousMachine, BusbarSection, ACLineSegment, \ + PowerTransformer, PowerTransformerEnd, ReactiveCapabilityCurve, \ + EnergyConsumer, PerLengthPhaseImpedance, PerLengthSequenceImpedance, \ + TransformerEnd + +from CIM16.IEC61970.Generation.Production import \ + ThermalGeneratingUnit, GenUnitOpCostCurve, GenUnitOpSchedule, StartupModel + + +from CIM16.IEC61970.WiresPhaseModel import \ + EnergyConsumerPhase, ACLineSegmentPhase + + +class CIMTestCase(unittest.TestCase): + """Test the full CIM package. + """ + + def setUp(self): + """The test runner will execute this method prior to each test. + """ + pass + + def test_energy_consumer_phase_sets_attributes(self): + energy_consumer = EnergyConsumer() + energy_consumer_phase = EnergyConsumerPhase( + 'A', energy_consumer, pfixed=100, qfixed=30) + assert energy_consumer_phase.phase == 'A' + assert energy_consumer_phase.EnergyConsumer == energy_consumer + assert energy_consumer_phase.pfixed == 100 + assert energy_consumer_phase.qfixed == 30 + + def test_xfmr_end_sets_base_voltage(self): + base_voltage = BaseVoltage(nominalVoltage=4160) + xfmr_end_1 = TransformerEnd(BaseVoltage=base_voltage) + xfmr_end_2 = TransformerEnd(BaseVoltage=base_voltage) + assert xfmr_end_1.BaseVoltage == base_voltage + assert xfmr_end_2.BaseVoltage == base_voltage + assert set(base_voltage.TransformerEnd) == set( + [xfmr_end_1, xfmr_end_2]) + + def test_base_voltage_add_xfmr_ends(self): + xfmr_end_1 = TransformerEnd() + xfmr_end_2 = TransformerEnd() + base_voltage = BaseVoltage(TransformerEnd=[xfmr_end_1]) + base_voltage.addTransformerEnd(xfmr_end_2) + assert set(base_voltage.TransformerEnd) == set( + [xfmr_end_1, xfmr_end_2]) + assert xfmr_end_1.BaseVoltage == base_voltage + assert xfmr_end_2.BaseVoltage == base_voltage + + def test_base_voltage_set_xfmr_ends(self): + xfmr_end_1 = TransformerEnd() + xfmr_end_2 = TransformerEnd() + xfmr_end_3 = TransformerEnd() + xfmr_end_4 = TransformerEnd() + base_voltage = BaseVoltage(TransformerEnd=[xfmr_end_1, xfmr_end_2]) + assert set(base_voltage.TransformerEnd) == set( + [xfmr_end_1, xfmr_end_2]) + assert xfmr_end_1.BaseVoltage == base_voltage + assert xfmr_end_2.BaseVoltage == base_voltage + base_voltage.setTransformerEnd([xfmr_end_3, xfmr_end_4]) + assert set(base_voltage.TransformerEnd) == set( + [xfmr_end_3, xfmr_end_4]) + assert xfmr_end_1.BaseVoltage == None + assert xfmr_end_2.BaseVoltage == None + assert xfmr_end_3.BaseVoltage == base_voltage + assert xfmr_end_4.BaseVoltage == base_voltage + + def test_base_voltage_remove_xfmr_end(self): + xfmr_end_1 = TransformerEnd() + xfmr_end_2 = TransformerEnd() + base_voltage = BaseVoltage(TransformerEnd=[xfmr_end_1, xfmr_end_2]) + base_voltage.removeTransformerEnd(xfmr_end_2) + assert base_voltage.TransformerEnd == [xfmr_end_1] + assert xfmr_end_2.BaseVoltage == None + assert xfmr_end_1.BaseVoltage == base_voltage + + def testInstantiation(self): + """Test element instantiation. + """ + ThermalGeneratingUnit(oMCost=6.0, variableCost=10.0) + GenUnitOpCostCurve(name="curve1", isNetGrossP=True) + GenUnitOpSchedule(timeStep=1.0) + StartupModel(name="model1", startupCost=20.0) + + ConformLoad(aggregate=True, pfixed=30.0) + clg = ConformLoadGroup(aliasName="group1") + LoadArea(name="area1") + cls = ConformLoadSchedule(ConformLoadGroup=clg) + self.assertEqual(cls.ConformLoadGroup, clg) + + AnalogLimit(value=100.0) + AnalogValue(value=6.0) + Analog(maxValue=100.0) + ProtectionEquipment(normallyInService=True) + CurrentRelay(inverseTimeFlag=True) + + tn = TopologicalNode(name="tn1") + cn = ConnectivityNode(TopologicalNode=tn) + self.assertTrue(cn.TopologicalNode, tn) + Terminal(connected=True) + + Breaker(ratedCurrent=20.0) + SynchronousMachine(coolantType="water") + BusbarSection(normallyInService=True) + ACLineSegment(r=0.1, length=10.0) + ReactiveCapabilityCurve(coolantTemperature=20.0) + te = PowerTransformerEnd(x0=0.1) + pt = PowerTransformer(PowerTransformerEnd=[te]) + self.assertTrue(te in pt.PowerTransformerEnd) + + + def testOneToOne(self): + """Test one-to-one bidirectional references. + """ + sm1 = StartupModel() + tgu1 = ThermalGeneratingUnit(StartupModel=sm1) + + self.assertEqual(tgu1.StartupModel, sm1) + self.assertEqual(sm1.ThermalGeneratingUnit, tgu1) + + tgu2 = ThermalGeneratingUnit() + tgu2.setStartupModel(sm1) + + self.assertEqual(tgu1.StartupModel, None) + self.assertEqual(tgu2.StartupModel, sm1) + self.assertNotEqual(sm1.ThermalGeneratingUnit, tgu1) + self.assertTrue(sm1.ThermalGeneratingUnit, tgu2) + + + def testOneToMany(self): + """Test one-to-many bidirectional references. + """ + lg1 = ConformLoadGroup(name="CLG1") + lg2 = ConformLoadGroup(name="CLG2") + cl = ConformLoad(name="Load 1", LoadGroup=lg1) + + self.assertEqual(cl.LoadGroup, lg1) + self.assertTrue(cl in lg1.EnergyConsumers) + + cl.setLoadGroup(lg2) + + self.assertNotEqual(cl.LoadGroup, lg1) + self.assertEqual(cl.LoadGroup, lg2) + self.assertFalse(cl in lg1.EnergyConsumers) + self.assertTrue(cl in lg2.EnergyConsumers) + + + def testManyToOne(self): + """Test many-to-one bidirectional references. + """ + te1 = PowerTransformerEnd() + te2 = PowerTransformerEnd() + pt1 = PowerTransformer(PowerTransformerEnd=[te1]) + pt1.addPowerTransformerEnd(te2) + + self.assertTrue(te1 in pt1.PowerTransformerEnd) + self.assertTrue(te2 in pt1.PowerTransformerEnd) + self.assertEqual(te1.PowerTransformer, pt1) + self.assertEqual(te2.PowerTransformer, pt1) + + pt2 = PowerTransformer() + pt2.addPowerTransformerEnd(te2) + + self.assertTrue(te1 in pt1.PowerTransformerEnd) + self.assertTrue(te2 in pt2.PowerTransformerEnd) + self.assertFalse(te2 in pt1.PowerTransformerEnd) + self.assertNotEqual(te2.PowerTransformer, pt1) + self.assertEqual(te2.PowerTransformer, pt2) + + te3 = PowerTransformerEnd() + pt1.setPowerTransformerEnd([te3]) + + self.assertFalse(te1 in pt1.PowerTransformerEnd) + self.assertTrue(te3 in pt1.PowerTransformerEnd) + self.assertEqual(te1.PowerTransformer, None) + self.assertEqual(te3.PowerTransformer, pt1) + + pt1.removePowerTransformerEnd(te3) + + self.assertFalse(te3 in pt1.PowerTransformerEnd) + self.assertEqual(te3.PowerTransformer, None) + + +# def testManyToMany(self): +# """Test many-to-many bidirectional references. +# """ +# sm1 = SynchronousMachine() +# sm2 = SynchronousMachine() +# rcc1 = ReactiveCapabilityCurve() +# sm1.add_reactive_capability_curves(rcc1) +# rcc2 = ReactiveCapabilityCurve(synchronous_machines=[sm2]) +# +# self.assertTrue(sm1 in rcc1.synchronous_machines) +# self.assertTrue(rcc2 in sm2.reactive_capability_curves) + + +class ACLineSegmentTests(unittest.TestCase): + + def test_ac_line_segment_phases_sets_attributes(self): + ac_line_segment = ACLineSegment() + ac_line_segment_phase = ACLineSegmentPhase('A', ac_line_segment) + assert ac_line_segment_phase.phase == 'A' + assert ac_line_segment_phase.ACLineSegment == ac_line_segment + + def test_sets_per_length_impedance_given_phase(self): + per_length_phase_impedance = PerLengthPhaseImpedance() + ac_line_segment = ACLineSegment( + PhaseImpedance=per_length_phase_impedance) + assert ac_line_segment.PerLengthImpedance == per_length_phase_impedance + assert ac_line_segment.PhaseImpedance == per_length_phase_impedance + assert ac_line_segment.SequenceImpedance is None + + def test_sets_per_length_impedance_given_sequence(self): + per_length_sequence_impedance = PerLengthSequenceImpedance() + ac_line_segment = ACLineSegment( + SequenceImpedance=per_length_sequence_impedance) + assert ac_line_segment.PerLengthImpedance == \ + per_length_sequence_impedance + assert ac_line_segment.SequenceImpedance == \ + per_length_sequence_impedance + assert ac_line_segment.PhaseImpedance is None + + def test_sets_per_length_impedance_given_phase_via_generic(self): + per_length_phase_impedance = PerLengthPhaseImpedance() + ac_line_segment = ACLineSegment( + PerLengthImpedance=per_length_phase_impedance) + assert ac_line_segment.PerLengthImpedance == per_length_phase_impedance + assert ac_line_segment.PhaseImpedance == per_length_phase_impedance + assert ac_line_segment.SequenceImpedance is None + + def test_sets_per_length_impedance_given_sequence_via_generic(self): + per_length_sequence_impedance = PerLengthSequenceImpedance() + ac_line_segment = ACLineSegment( + PerLengthImpedance=per_length_sequence_impedance) + assert ac_line_segment.PerLengthImpedance == per_length_sequence_impedance + assert ac_line_segment.SequenceImpedance == per_length_sequence_impedance + assert ac_line_segment.PhaseImpedance is None + + def test_more_than_one_impedance_returns_error(self): + per_length_sequence_impedance = PerLengthSequenceImpedance() + per_length_phase_impedance = PerLengthPhaseImpedance() + with pytest.raises(ValueError): + ac_line_segment = ACLineSegment( + PhaseImpedance=per_length_phase_impedance, + SequenceImpedance=per_length_sequence_impedance) + + +if __name__ == "__main__": + unittest.main() diff --git a/PyCIM/Test/RedREE_RDFXMLReader_TestCIM14.py b/PyCIM/Test/RedREE_RDFXMLReader_TestCIM14.py new file mode 100644 index 00000000..ac8ff951 --- /dev/null +++ b/PyCIM/Test/RedREE_RDFXMLReader_TestCIM14.py @@ -0,0 +1,96 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# Copyright (C) 2011 Stefan Scherfke +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +import io +import unittest + +from os.path import dirname, join + +from PyCIM import cimread, RDFXMLReader + +from CIM14 import nsURI as nsURICIM14, packageMap as packageMapCIM14 +from CIM14.CDPSM.Asset import packageMap as assetMap +from CIM14.CDPSM.Connectivity import packageMap as connMap +from CIM14.CDPSM.Balanced import packageMap as equipMap +#from CIM14.CDPSM.Geographical import packageMap as geoMap + +RDFXML_FILE = join(dirname(__file__), "Data", "EDF_AIGUE_v9_COMBINED.xml") + +EQUIP_FILE = join(dirname(__file__), "Case6_CSWRG_ES", "Case6_CSWRG_ES_EQ.xml") +TOPO_FIlE= join(dirname(__file__), "Case6_CSWRG_ES", "Case6_CSWRG_ES_TP.xml") +STATEV_FILE= join(dirname(__file__),"Case6_CSWRG_ES", "Case6_CSWRG_ES_SV.xml") + +EMPTY_CIM = u''' +''' + + +class RDFXMLReaderTestCase(unittest.TestCase): + """Test CIM RDF/XML parsing. + """ + + def testCombined(self): + """Test CIM RDF/XML parsing. + """ + d = cimread(RDFXML_FILE) + + self.assertEqual(len(d), 5894) + + def test_cim_reads_are_independent(self): +# cimread(ASSET_FILE, assetMap, nsURICIM15) +# sio = io.StringIO(EMPTY_CIM) +# empty_cim_dict = cimread(sio) +# self.assertEqual(empty_cim_dict, {}) + pass + + def testProfile(self): + ''' This test needs to be documented + What is the comparison with 5893? ''' + d = {} + + d.update(cimread(EQUIP_FILE, assetMap, nsURICIM14)) + d.update(cimread(TOPO_FIlE, connMap, nsURICIM14)) + d.update(cimread(STATEV_FILE, equipMap, nsURICIM14)) + + self.assertEqual(len(d), 2303) + + def testGetNamespaces(self): + ns = RDFXMLReader.xmlns(EQUIP_FILE) + self.assertEqual(ns, { + 'cim': 'http://iec.ch/TC57/2009/CIM-schema-cim14#', + 'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', + 'pti': 'http://www.pti-us.com/PTI_CIM-schema-cim14#' + }) + + self.assertEqual(RDFXMLReader.get_rdf_ns(ns), + 'http://www.w3.org/1999/02/22-rdf-syntax-ns#') + + self.assertEqual(RDFXMLReader.get_pti_ns(ns), + 'http://www.pti-us.com/PTI_CIM-schema-cim14#') + + self.assertEqual(RDFXMLReader.get_cim_ns(ns), + (nsURICIM14, packageMapCIM14)) + + +if __name__ == "__main__": + import logging + logging.basicConfig(level=logging.INFO) + unittest.main() diff --git a/PyCIM/Test/RedREE_RDFXMLReader_TestCIM16.py b/PyCIM/Test/RedREE_RDFXMLReader_TestCIM16.py new file mode 100644 index 00000000..efab3844 --- /dev/null +++ b/PyCIM/Test/RedREE_RDFXMLReader_TestCIM16.py @@ -0,0 +1,90 @@ +# Copyright (C) 2010-2011 Richard Lincoln +# Copyright (C) 2011 Stefan Scherfke +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +import io +import unittest + +from os.path import dirname, join + +from PyCIM import cimread, RDFXMLReader + +from CIM16 import nsURI as nsURICIM16, packageMap as packageMapCIM16 +from CIM16.CDPSM.Asset import packageMap as assetMap +from CIM16.CDPSM.Connectivity import packageMap as connMap +from CIM16.CDPSM.Balanced import packageMap as equipMap +from CIM16.CDPSM.Geographical import packageMap as geoMap + +RDFXML_FILE = join(dirname(__file__), "Data", "EDF_AIGUE_v9_COMBINED.xml") + +EQUIP_FILE = join(dirname(__file__), "Case6_CSWRG_ES", "Case6_CSWRG_ES_EQ.xml") +TOPO_FIlE= join(dirname(__file__), "Case6_CSWRG_ES", "Case6_CSWRG_ES_TP.xml") +STATEV_FILE= join(dirname(__file__),"Case6_CSWRG_ES", "Case6_CSWRG_ES_SV.xml") + +EMPTY_CIM = u''' +''' + + +class RDFXMLReaderTestCase(unittest.TestCase): + """Test CIM RDF/XML parsing. + """ + + def testCombined(self): + """Test CIM RDF/XML parsing. + """ + d = cimread(RDFXML_FILE) + + self.assertEqual(len(d), 5894) + + def test_cim_reads_are_independent(self): +# cimread(ASSET_FILE, assetMap, nsURICIM15) +# sio = io.StringIO(EMPTY_CIM) +# empty_cim_dict = cimread(sio) +# self.assertEqual(empty_cim_dict, {}) + pass + + def testProfile(self): + d = {} + + d.update(cimread(EQUIP_FILE, assetMap, nsURICIM16)) + d.update(cimread(TOPO_FIlE, connMap, nsURICIM16)) + d.update(cimread(STATEV_FILE, equipMap, nsURICIM16)) + + self.assertEqual(len(d), 5893) + + def testGetNamespaces(self): + ns = RDFXMLReader.xmlns(EQUIP_FILE) + self.assertEqual(ns, { + 'cim': 'http://iec.ch/TC57/2013/CIM-schema-cim16#', + 'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', + }) + + self.assertEqual(RDFXMLReader.get_rdf_ns(ns), + 'http://www.w3.org/1999/02/22-rdf-syntax-ns#') + + self.assertEqual(RDFXMLReader.get_cim_ns(ns), + (nsURICIM16, packageMapCIM16)) + + +if __name__ == "__main__": + import logging + logging.basicConfig(level=logging.INFO) + unittest.main() diff --git a/setup.py b/setup.py index 5b0fe18a..210e3d09 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ def find_packages(): f.close() setup(name="PyCIM", - version="15.15.0", + version="16.1.0", author="Richard Lincoln", author_email="r.w.lincoln@gmail.com", description="Python implementation of the Common Information Model.", diff --git a/setup15.py b/setup15.py new file mode 100644 index 00000000..5b0fe18a --- /dev/null +++ b/setup15.py @@ -0,0 +1,64 @@ +import os + +kwds = {} + +if int(os.getenv('USE_DISTUTILS', 0)) != 0: + from distutils.core import setup + def find_packages(): + packages = [] + basedir = os.getcwd() + for root, dirnames, filenames in os.walk(basedir): + for dirname in dirnames: + initfile = os.path.join(root, dirname, "__init__.py") + if os.path.exists(initfile): + # python 2.4+ + packages.append(os.path.relpath(initfile, basedir)) + packages = [ os.path.dirname(p).replace(os.path.sep, ".") for p in packages ] + return sorted(packages) + + # To add the test data to the final package + if int(os.getenv('INCLUDE_PACKAGE_DATA', 0)) != 0: + kwds['package_data'] = { 'PyCIM.Test' : [ 'Data/*'], } +else: + from setuptools import setup, find_packages + kwds['include_package_data'] = False + kwds['test_suite'] = "PyCIM.Test" + kwds['zip_safe'] = True + + +# Read the long description from the README. +thisdir = os.path.abspath(os.path.dirname(__file__)) +f = open(os.path.join(thisdir, "README.rst")) +kwds["long_description"] = f.read() +f.close() + +setup(name="PyCIM", + version="15.15.0", + author="Richard Lincoln", + author_email="r.w.lincoln@gmail.com", + description="Python implementation of the Common Information Model.", + license="MIT", + url="https://github.com/rwl/PyCIM", + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'Intended Audience :: Science/Research', + 'Topic :: Scientific/Engineering', + 'Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + ], + packages=find_packages(), + extras_require={ + 'test': ['pytest'], + 'build': ['twine'], + }, + **kwds) + +# python setup.py sdist bdist_egg bdist_wininst bdist_msi upload From de942633d966bdf2bd76d680ecb20517fc873281 Mon Sep 17 00:00:00 2001 From: fran_jo Date: Tue, 19 Sep 2017 16:15:33 +0200 Subject: [PATCH 3/3] Change name to test file --- ...IM14.py => ODMS_RDFXMLReader_TestCIM14.py} | 6 +- PyCIM/Test/RedREE_RDFXMLReader_TestCIM16.py | 90 ------------------- 2 files changed, 3 insertions(+), 93 deletions(-) rename PyCIM/Test/{RedREE_RDFXMLReader_TestCIM14.py => ODMS_RDFXMLReader_TestCIM14.py} (93%) delete mode 100644 PyCIM/Test/RedREE_RDFXMLReader_TestCIM16.py diff --git a/PyCIM/Test/RedREE_RDFXMLReader_TestCIM14.py b/PyCIM/Test/ODMS_RDFXMLReader_TestCIM14.py similarity index 93% rename from PyCIM/Test/RedREE_RDFXMLReader_TestCIM14.py rename to PyCIM/Test/ODMS_RDFXMLReader_TestCIM14.py index ac8ff951..6410d915 100644 --- a/PyCIM/Test/RedREE_RDFXMLReader_TestCIM14.py +++ b/PyCIM/Test/ODMS_RDFXMLReader_TestCIM14.py @@ -34,9 +34,9 @@ RDFXML_FILE = join(dirname(__file__), "Data", "EDF_AIGUE_v9_COMBINED.xml") -EQUIP_FILE = join(dirname(__file__), "Case6_CSWRG_ES", "Case6_CSWRG_ES_EQ.xml") -TOPO_FIlE= join(dirname(__file__), "Case6_CSWRG_ES", "Case6_CSWRG_ES_TP.xml") -STATEV_FILE= join(dirname(__file__),"Case6_CSWRG_ES", "Case6_CSWRG_ES_SV.xml") +EQUIP_FILE = join(dirname(__file__), "Case6_ODMS", "Case6_ODMS_EQ.xml") +TOPO_FIlE= join(dirname(__file__), "Case6_ODMS", "Case6_ODMS_TP.xml") +STATEV_FILE= join(dirname(__file__),"Case6_ODMS", "Case6_ODMS_SV.xml") EMPTY_CIM = u''' -''' - - -class RDFXMLReaderTestCase(unittest.TestCase): - """Test CIM RDF/XML parsing. - """ - - def testCombined(self): - """Test CIM RDF/XML parsing. - """ - d = cimread(RDFXML_FILE) - - self.assertEqual(len(d), 5894) - - def test_cim_reads_are_independent(self): -# cimread(ASSET_FILE, assetMap, nsURICIM15) -# sio = io.StringIO(EMPTY_CIM) -# empty_cim_dict = cimread(sio) -# self.assertEqual(empty_cim_dict, {}) - pass - - def testProfile(self): - d = {} - - d.update(cimread(EQUIP_FILE, assetMap, nsURICIM16)) - d.update(cimread(TOPO_FIlE, connMap, nsURICIM16)) - d.update(cimread(STATEV_FILE, equipMap, nsURICIM16)) - - self.assertEqual(len(d), 5893) - - def testGetNamespaces(self): - ns = RDFXMLReader.xmlns(EQUIP_FILE) - self.assertEqual(ns, { - 'cim': 'http://iec.ch/TC57/2013/CIM-schema-cim16#', - 'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', - }) - - self.assertEqual(RDFXMLReader.get_rdf_ns(ns), - 'http://www.w3.org/1999/02/22-rdf-syntax-ns#') - - self.assertEqual(RDFXMLReader.get_cim_ns(ns), - (nsURICIM16, packageMapCIM16)) - - -if __name__ == "__main__": - import logging - logging.basicConfig(level=logging.INFO) - unittest.main()