Skip to content

Commit a1fdaf2

Browse files
committed
Improve the schema definition of components
1 parent 2bfc2de commit a1fdaf2

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

Examples/05 - VerySimpleFixedPVC2_with_electrical_layout_v3.pvc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,21 @@
113113
<pv:input_count>3</pv:input_count>
114114
</pv:combiner_ac>
115115
</pv:combiners_ac>
116+
<!-- List of transformers -->
117+
<pv:transformers>
118+
<!-- transformer tag -->
119+
<pv:transformer id="TransformerModel1">
120+
<pv:manufacturer>Generic</pv:manufacturer>
121+
<pv:name>Generic transformer</pv:name>
122+
<pv:nom_power>6000</pv:nom_power>
123+
<pv:v_in>230</pv:v_in>
124+
<pv:v_out>1100</pv:v_out>
125+
<pv:efficiency>95.0</pv:efficiency>
126+
<pv:iron_loss>10</pv:iron_loss>
127+
<pv:copper_loss>15</pv:copper_loss>
128+
<pv:night_disconnect>false</pv:night_disconnect>
129+
</pv:transformer>
130+
</pv:transformers>
116131
<!-- List of cables -->
117132
<pv:cables>
118133
<!-- cable tag -->
@@ -138,21 +153,6 @@
138153
<pv:impedance>25</pv:impedance>
139154
</pv:cable>
140155
</pv:cables>
141-
<!-- List of transformers -->
142-
<pv:transformers>
143-
<!-- transformer tag -->
144-
<pv:transformer id="TransformerModel1">
145-
<pv:manufacturer>Generic</pv:manufacturer>
146-
<pv:name>Generic transformer</pv:name>
147-
<pv:nom_power>6000</pv:nom_power>
148-
<pv:v_in>230</pv:v_in>
149-
<pv:v_out>1100</pv:v_out>
150-
<pv:efficiency>95.0</pv:efficiency>
151-
<pv:iron_loss>10</pv:iron_loss>
152-
<pv:copper_loss>15</pv:copper_loss>
153-
<pv:night_disconnect>false</pv:night_disconnect>
154-
</pv:transformer>
155-
</pv:transformers>
156156
</pv:components>
157157
<!-- circuit tag (tree) -->
158158
<pv:circuit>

schema/pvcollada_schema_0.1.xsd

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
503503
</xs:complexType>
504504
<!-- Inputs container for instance_transformer; each input must be either transformer, AC combiner or inverter -->
505505
<xs:complexType name="transformer_inputs_type">
506-
<xs:choice minOccurs="1" maxOccurs="unbounded">
506+
<xs:choice maxOccurs="unbounded">
507507
<xs:element name="instance_transformer" type="instance_transformer_type" />
508508
<xs:element name="instance_combiner_ac" type="instance_combiner_ac_type" />
509509
<xs:element name="instance_inverter" type="instance_inverter_type" />
@@ -521,7 +521,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
521521
</xs:complexType>
522522
<!-- Inputs container for instance_combiner_ac; each input must must be either transformer, AC combiner or inverter) -->
523523
<xs:complexType name="combiner_ac_inputs_type">
524-
<xs:choice minOccurs="1" maxOccurs="unbounded">
524+
<xs:choice maxOccurs="unbounded">
525525
<xs:element name="instance_transformer" type="instance_transformer_type" />
526526
<xs:element name="instance_combiner_ac" type="instance_combiner_ac_type" />
527527
<xs:element name="instance_inverter" type="instance_inverter_type" />
@@ -540,12 +540,12 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
540540
<!-- mppts container: must have one or more mppt elements -->
541541
<xs:complexType name="mppts_type">
542542
<xs:sequence>
543-
<xs:element name="mppt" type="mppt_type" minOccurs="1" maxOccurs="unbounded" />
543+
<xs:element name="mppt" type="mppt_type" maxOccurs="unbounded" />
544544
</xs:sequence>
545545
</xs:complexType>
546546
<!-- mppt element: contains one or more "string" and "instance_combiner_dc" elements -->
547547
<xs:complexType name="mppt_type">
548-
<xs:choice minOccurs="1" maxOccurs="unbounded">
548+
<xs:choice maxOccurs="unbounded">
549549
<xs:element name="string" type="string_type" />
550550
<xs:element name="instance_combiner_dc" type="instance_combiner_dc_type" />
551551
</xs:choice>
@@ -562,7 +562,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
562562
</xs:complexType>
563563
<!-- Inputs container for instance_combiner_Dc; each input must be either DC combiner or string) -->
564564
<xs:complexType name="combiner_dc_inputs_type">
565-
<xs:choice minOccurs="1" maxOccurs="unbounded">
565+
<xs:choice maxOccurs="unbounded">
566566
<xs:element name="instance_combiner_dc" type="instance_combiner_dc_type" />
567567
<xs:element name="string" type="string_type" />
568568
</xs:choice>
@@ -571,7 +571,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
571571
and exactly one inputs child that contains one or more input children (each wrapping a module_layout) -->
572572
<xs:complexType name="instance_optimizer_type">
573573
<xs:sequence>
574-
<xs:choice minOccurs="1" maxOccurs="2">
574+
<xs:choice maxOccurs="2">
575575
<xs:element name="cable_to_parent" type="cable_to_type" />
576576
<xs:element name="cable_to_neighbor" type="cable_to_type" />
577577
</xs:choice>
@@ -591,7 +591,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
591591
<!-- Inputs container for instance_optimizer elements: It must appear exactly once and contain one or more 'module_layout' children -->
592592
<xs:complexType name="optimizer_inputs_type">
593593
<xs:sequence>
594-
<xs:element name="module_layout" type="module_layout_type" minOccurs="1" maxOccurs="unbounded" />
594+
<xs:element name="module_layout" type="module_layout_type" maxOccurs="unbounded" />
595595
</xs:sequence>
596596
</xs:complexType>
597597
<!-- The "string" element must contain exactly one child which is either a module_array or an optimizer_array -->
@@ -605,19 +605,19 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
605605
<!-- optimizer_array: contains one or more instance_optimizer elements -->
606606
<xs:complexType name="optimizer_array_type">
607607
<xs:sequence>
608-
<xs:element name="instance_optimizer" type="instance_optimizer_type" minOccurs="1" maxOccurs="unbounded" />
608+
<xs:element name="instance_optimizer" type="instance_optimizer_type" maxOccurs="unbounded" />
609609
</xs:sequence>
610610
</xs:complexType>
611611
<!-- module_array: contains one or more module_layout elements -->
612612
<xs:complexType name="module_array_type">
613613
<xs:sequence>
614-
<xs:element name="module_layout" type="module_layout_type" minOccurs="1" maxOccurs="unbounded" />
614+
<xs:element name="module_layout" type="module_layout_type" maxOccurs="unbounded" />
615615
</xs:sequence>
616616
</xs:complexType>
617617
<!-- module_layout: must have at least one cable (either cable_to_parent or cable_to_neighbor) plus one row and one column -->
618618
<xs:complexType name="module_layout_type">
619619
<xs:sequence>
620-
<xs:choice minOccurs="1" maxOccurs="2">
620+
<xs:choice maxOccurs="2">
621621
<xs:element name="cable_to_parent" type="cable_to_type" />
622622
<xs:element name="cable_to_neighbor" type="cable_to_type" />
623623
</xs:choice>
@@ -757,50 +757,50 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
757757
</xs:element>
758758
<xs:element name="components">
759759
<xs:complexType>
760-
<xs:sequence>
761-
<xs:element name="modules">
760+
<xs:all>
761+
<xs:element name="modules" minOccurs="0">
762762
<xs:complexType>
763763
<xs:sequence>
764-
<xs:element name="module" type="module_type_object" minOccurs="1" maxOccurs="unbounded" />
764+
<xs:element name="module" type="module_type_object" maxOccurs="unbounded" />
765765
</xs:sequence>
766766
</xs:complexType>
767767
</xs:element>
768-
<xs:element name="inverters">
768+
<xs:element name="inverters" minOccurs="0">
769769
<xs:complexType>
770770
<xs:sequence>
771-
<xs:element name="inverter" type="inverter_type_object" minOccurs="1" maxOccurs="unbounded" />
771+
<xs:element name="inverter" type="inverter_type_object" maxOccurs="unbounded" />
772772
</xs:sequence>
773773
</xs:complexType>
774774
</xs:element>
775775
<xs:element name="combiners_dc" minOccurs="0">
776776
<xs:complexType>
777777
<xs:sequence>
778-
<xs:element name="combiner_dc" type="combiner_dc_type_object" minOccurs="0" maxOccurs="unbounded" />
778+
<xs:element name="combiner_dc" type="combiner_dc_type_object" maxOccurs="unbounded" />
779779
</xs:sequence>
780780
</xs:complexType>
781781
</xs:element>
782782
<xs:element name="combiners_ac" minOccurs="0">
783783
<xs:complexType>
784784
<xs:sequence>
785-
<xs:element name="combiner_ac" type="combiner_ac_type_object" minOccurs="0" maxOccurs="unbounded" />
785+
<xs:element name="combiner_ac" type="combiner_ac_type_object" maxOccurs="unbounded" />
786786
</xs:sequence>
787787
</xs:complexType>
788788
</xs:element>
789789
<xs:element name="cables" minOccurs="0">
790790
<xs:complexType>
791791
<xs:sequence>
792-
<xs:element name="cable" type="cable_type_object" minOccurs="0" maxOccurs="unbounded" />
792+
<xs:element name="cable" type="cable_type_object" maxOccurs="unbounded" />
793793
</xs:sequence>
794794
</xs:complexType>
795795
</xs:element>
796796
<xs:element name="transformers" minOccurs="0">
797797
<xs:complexType>
798798
<xs:sequence>
799-
<xs:element name="transformer" type="transformer_type_object" minOccurs="0" maxOccurs="unbounded" />
799+
<xs:element name="transformer" type="transformer_type_object" maxOccurs="unbounded" />
800800
</xs:sequence>
801801
</xs:complexType>
802802
</xs:element>
803-
</xs:sequence>
803+
</xs:all>
804804
</xs:complexType>
805805
</xs:element>
806806
<xs:element name="rack">
@@ -919,7 +919,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
919919
</xs:annotation>
920920
<xs:complexType>
921921
<xs:sequence>
922-
<xs:element name="instance_rack_ref" minOccurs="1" maxOccurs="unbounded">
922+
<xs:element name="instance_rack_ref" maxOccurs="unbounded">
923923
<xs:complexType>
924924
<xs:attribute name="id" type="xs:ID">
925925
<xs:annotation>

0 commit comments

Comments
 (0)