Skip to content

Commit e603734

Browse files
committed
Fixed half the wizards
1 parent 61a2e48 commit e603734

File tree

14 files changed

+1147
-774
lines changed

14 files changed

+1147
-774
lines changed

src/assets/js/libMKF.wasm.wasm

99.7 KB
Binary file not shown.

src/components/Wizards/BuckBoostWizard.vue

Lines changed: 432 additions & 394 deletions
Large diffs are not rendered by default.

src/components/Wizards/CllcWizard.vue

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ export default {
112112
},
113113
114114
buildMagneticWaveformsFromInputs(operatingPoints) {
115-
// WASM returns only 1 period, so we need to repeat for display
116115
const magneticWaveforms = [];
117116
118117
for (let opIdx = 0; opIdx < operatingPoints.length; opIdx++) {
@@ -129,33 +128,23 @@ export default {
129128
const excitation = excitations[windingIdx];
130129
const windingLabel = windingIdx === 0 ? 'Primary' : `Secondary ${windingIdx}`;
131130
132-
// Voltage waveform - repeat for display
131+
// Voltage waveform
133132
if (excitation.voltage?.waveform?.time && excitation.voltage?.waveform?.data) {
134-
const { time, data } = this.repeatWaveformForPeriods(
135-
excitation.voltage.waveform.time,
136-
excitation.voltage.waveform.data,
137-
this.numberOfPeriods
138-
);
139133
opWaveforms.waveforms.push({
140134
label: `${windingLabel} Voltage`,
141-
x: time,
142-
y: data,
135+
x: excitation.voltage.waveform.time,
136+
y: excitation.voltage.waveform.data,
143137
type: 'voltage',
144138
unit: 'V'
145139
});
146140
}
147141
148-
// Current waveform - repeat for display
142+
// Current waveform
149143
if (excitation.current?.waveform?.time && excitation.current?.waveform?.data) {
150-
const { time, data } = this.repeatWaveformForPeriods(
151-
excitation.current.waveform.time,
152-
excitation.current.waveform.data,
153-
this.numberOfPeriods
154-
);
155144
opWaveforms.waveforms.push({
156145
label: `${windingLabel} Current`,
157-
x: time,
158-
y: data,
146+
x: excitation.current.waveform.time,
147+
y: excitation.current.waveform.data,
159148
type: 'current',
160149
unit: 'A'
161150
});
@@ -168,6 +157,54 @@ export default {
168157
return magneticWaveforms;
169158
},
170159
160+
convertConverterWaveforms(converterWaveforms) {
161+
return converterWaveforms.map((cw, idx) => {
162+
const opWaveforms = {
163+
frequency: cw.switchingFrequency || this.localData.switchingFrequency,
164+
operatingPointName: cw.operatingPointName || `Operating Point ${idx + 1}`,
165+
waveforms: []
166+
};
167+
168+
if (cw.inputVoltage?.time && cw.inputVoltage?.data) {
169+
opWaveforms.waveforms.push({
170+
label: 'Input Voltage', x: cw.inputVoltage.time, y: cw.inputVoltage.data,
171+
type: 'voltage', unit: 'V'
172+
});
173+
}
174+
175+
if (cw.inputCurrent?.time && cw.inputCurrent?.data) {
176+
opWaveforms.waveforms.push({
177+
label: 'Input Current', x: cw.inputCurrent.time, y: cw.inputCurrent.data,
178+
type: 'current', unit: 'A'
179+
});
180+
}
181+
182+
if (cw.outputVoltages) {
183+
cw.outputVoltages.forEach((outV, outIdx) => {
184+
if (outV.time && outV.data) {
185+
opWaveforms.waveforms.push({
186+
label: `Output ${outIdx + 1} Voltage`, x: outV.time, y: outV.data,
187+
type: 'voltage', unit: 'V'
188+
});
189+
}
190+
});
191+
}
192+
193+
if (cw.outputCurrents) {
194+
cw.outputCurrents.forEach((outI, outIdx) => {
195+
if (outI.time && outI.data) {
196+
opWaveforms.waveforms.push({
197+
label: `Output ${outIdx + 1} Current`, x: outI.time, y: outI.data,
198+
type: 'current', unit: 'A'
199+
});
200+
}
201+
});
202+
}
203+
204+
return opWaveforms;
205+
});
206+
},
207+
171208
repeatWaveformForPeriods(time, data, numberOfPeriods) {
172209
// Repeat a single-period waveform for the specified number of periods
173210
if (!time || !data || time.length === 0 || numberOfPeriods <= 1) {

src/components/Wizards/ConverterWizardBase.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export default {
285285
<!-- Outputs -->
286286
<div class="compact-card">
287287
<div class="compact-header"><i class="fa-solid fa-arrow-right-from-bracket me-1"></i>Outputs</div>
288-
<div class="compact-body pe-3">
288+
<div class="compact-body ps-4 pe-3">
289289
<slot name="outputs">
290290
</slot>
291291
</div>

src/components/Wizards/DabWizard.vue

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ export default {
132132
},
133133
134134
buildMagneticWaveformsFromInputs(operatingPoints) {
135-
// WASM returns only 1 period, so we need to repeat for display
136135
const magneticWaveforms = [];
137136
138137
for (let opIdx = 0; opIdx < operatingPoints.length; opIdx++) {
@@ -149,33 +148,23 @@ export default {
149148
const excitation = excitations[windingIdx];
150149
const windingLabel = windingIdx === 0 ? 'Primary' : `Secondary ${windingIdx}`;
151150
152-
// Voltage waveform - repeat for display
151+
// Voltage waveform
153152
if (excitation.voltage?.waveform?.time && excitation.voltage?.waveform?.data) {
154-
const { time, data } = this.repeatWaveformForPeriods(
155-
excitation.voltage.waveform.time,
156-
excitation.voltage.waveform.data,
157-
this.numberOfPeriods
158-
);
159153
opWaveforms.waveforms.push({
160154
label: `${windingLabel} Voltage`,
161-
x: time,
162-
y: data,
155+
x: excitation.voltage.waveform.time,
156+
y: excitation.voltage.waveform.data,
163157
type: 'voltage',
164158
unit: 'V'
165159
});
166160
}
167161
168-
// Current waveform - repeat for display
162+
// Current waveform
169163
if (excitation.current?.waveform?.time && excitation.current?.waveform?.data) {
170-
const { time, data } = this.repeatWaveformForPeriods(
171-
excitation.current.waveform.time,
172-
excitation.current.waveform.data,
173-
this.numberOfPeriods
174-
);
175164
opWaveforms.waveforms.push({
176165
label: `${windingLabel} Current`,
177-
x: time,
178-
y: data,
166+
x: excitation.current.waveform.time,
167+
y: excitation.current.waveform.data,
179168
type: 'current',
180169
unit: 'A'
181170
});
@@ -188,6 +177,54 @@ export default {
188177
return magneticWaveforms;
189178
},
190179
180+
convertConverterWaveforms(converterWaveforms) {
181+
return converterWaveforms.map((cw, idx) => {
182+
const opWaveforms = {
183+
frequency: cw.switchingFrequency || this.localData.switchingFrequency,
184+
operatingPointName: cw.operatingPointName || `Operating Point ${idx + 1}`,
185+
waveforms: []
186+
};
187+
188+
if (cw.inputVoltage?.time && cw.inputVoltage?.data) {
189+
opWaveforms.waveforms.push({
190+
label: 'Input Voltage', x: cw.inputVoltage.time, y: cw.inputVoltage.data,
191+
type: 'voltage', unit: 'V'
192+
});
193+
}
194+
195+
if (cw.inputCurrent?.time && cw.inputCurrent?.data) {
196+
opWaveforms.waveforms.push({
197+
label: 'Input Current', x: cw.inputCurrent.time, y: cw.inputCurrent.data,
198+
type: 'current', unit: 'A'
199+
});
200+
}
201+
202+
if (cw.outputVoltages) {
203+
cw.outputVoltages.forEach((outV, outIdx) => {
204+
if (outV.time && outV.data) {
205+
opWaveforms.waveforms.push({
206+
label: `Output ${outIdx + 1} Voltage`, x: outV.time, y: outV.data,
207+
type: 'voltage', unit: 'V'
208+
});
209+
}
210+
});
211+
}
212+
213+
if (cw.outputCurrents) {
214+
cw.outputCurrents.forEach((outI, outIdx) => {
215+
if (outI.time && outI.data) {
216+
opWaveforms.waveforms.push({
217+
label: `Output ${outIdx + 1} Current`, x: outI.time, y: outI.data,
218+
type: 'current', unit: 'A'
219+
});
220+
}
221+
});
222+
}
223+
224+
return opWaveforms;
225+
});
226+
},
227+
191228
repeatWaveformForPeriods(time, data, numberOfPeriods) {
192229
// Repeat a single-period waveform for the specified number of periods
193230
if (!time || !data || time.length === 0 || numberOfPeriods <= 1) {

0 commit comments

Comments
 (0)