@eturnity/eturnity_maths 6.48.0 → 6.48.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/objects/Polygon.js +29 -18
package/package.json
CHANGED
package/src/objects/Polygon.js
CHANGED
|
@@ -121,9 +121,9 @@ export class Polygon {
|
|
|
121
121
|
name: this.name,
|
|
122
122
|
type: this.type,
|
|
123
123
|
outline: this.outline.map(p=>{return {
|
|
124
|
-
x:
|
|
125
|
-
y:
|
|
126
|
-
z:
|
|
124
|
+
x: p.x,
|
|
125
|
+
y: p.y,
|
|
126
|
+
z: p.z,
|
|
127
127
|
}}),
|
|
128
128
|
holes: this.holes.map((p) => p.id),
|
|
129
129
|
layer: this.layer,
|
|
@@ -149,21 +149,24 @@ export class Polygon {
|
|
|
149
149
|
return { id: roof.id }
|
|
150
150
|
})
|
|
151
151
|
} else if (this.layer == 'moduleField') {
|
|
152
|
-
|
|
152
|
+
const modules=[]
|
|
153
|
+
if(this.panels){
|
|
154
|
+
this.panels.forEach((p) => {
|
|
155
|
+
modules.push({ id: p.id, index: p.index, outline: p.outline, status: p.status || "active" })
|
|
156
|
+
})
|
|
157
|
+
}
|
|
158
|
+
if(this.userDeactivatedPanels){
|
|
159
|
+
this.userDeactivatedPanels.forEach((p) => {
|
|
160
|
+
modules.push({ id: p.id, index: p.index, outline: p.outline, status: p.status || "user_deactivated" })
|
|
161
|
+
})
|
|
162
|
+
}
|
|
163
|
+
extraSerialization.data = {...this.data,modules:[...this.data.modules]}
|
|
153
164
|
extraSerialization.roof = { id: this.roof.id }
|
|
154
165
|
extraSerialization.pvData = this.pvData?{...this.pvData}:null
|
|
155
166
|
extraSerialization.mountingData = this.mountingData?{...this.mountingData}:null
|
|
156
|
-
extraSerialization.
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
// return { id: p.id, index: p.index, outline: p.outline }
|
|
160
|
-
// })
|
|
161
|
-
// : []
|
|
162
|
-
extraSerialization.userDeactivatedPanels = this.userDeactivatedPanels
|
|
163
|
-
? this.userDeactivatedPanels.map((p) => {
|
|
164
|
-
return { id: p.id, index: p.index, outline: p.outline }
|
|
165
|
-
})
|
|
166
|
-
: []
|
|
167
|
+
extraSerialization.modules = modules
|
|
168
|
+
extraSerialization.needsOptimisation = this.needsOptimisation
|
|
169
|
+
|
|
167
170
|
} else if (this.layer == 'panel') {
|
|
168
171
|
extraSerialization.index = this.index
|
|
169
172
|
extraSerialization.moduleField = { id: this.moduleField.id }
|
|
@@ -209,15 +212,24 @@ export class Polygon {
|
|
|
209
212
|
const modules = this.panels.map((p) => {
|
|
210
213
|
return {
|
|
211
214
|
index: p.index,
|
|
212
|
-
outline: p.outline.map((v) => [v.x, v.y, v.z])
|
|
215
|
+
outline: p.outline.map((v) => [v.x, v.y, v.z]),
|
|
216
|
+
status: p.status || "active",
|
|
217
|
+
clipped: p.clipped === undefined ? false : p.clipped
|
|
213
218
|
}
|
|
214
219
|
})
|
|
215
220
|
const user_deactivated_modules = this.userDeactivatedPanels.map((p) => {
|
|
216
221
|
return {
|
|
217
222
|
index: p.index,
|
|
218
|
-
outline: p.outline.map((v) => [v.x, v.y, v.z])
|
|
223
|
+
outline: p.outline.map((v) => [v.x, v.y, v.z]),
|
|
219
224
|
}
|
|
220
225
|
})
|
|
226
|
+
user_deactivated_modules.forEach(p=>{
|
|
227
|
+
modules.push({
|
|
228
|
+
...p,
|
|
229
|
+
status: p.status || "user_deactivated",
|
|
230
|
+
clipped: p.clipped === undefined ? false : p.clipped
|
|
231
|
+
})
|
|
232
|
+
})
|
|
221
233
|
return {
|
|
222
234
|
module_field_uuid: this.id,
|
|
223
235
|
roof_uuid: this.roof.id,
|
|
@@ -232,7 +244,6 @@ export class Polygon {
|
|
|
232
244
|
component_id_mounting_system: this.data.component_id_mounting_system,
|
|
233
245
|
modules: modules,
|
|
234
246
|
module_tilt_degrees: this.data.module_tilt_degrees,
|
|
235
|
-
user_deactivated_modules: user_deactivated_modules,
|
|
236
247
|
base_line_index: this.data.base_line_index,
|
|
237
248
|
justify_percent: this.data.justify_percent,
|
|
238
249
|
|