poe-svelte-ui-lib 3.13.0 → 3.13.1
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/dist/WidgetFOC/WidgetFOC.svelte +186 -150
- package/dist/gui.d.ts +3 -0
- package/dist/gui.js +10 -7
- package/package.json +1 -1
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
const hints = $derived(hintsSetting("WidgetFOC", persistKey))
|
|
34
34
|
const rootStyle = $derived(accentStyle(accent))
|
|
35
35
|
|
|
36
|
-
/* Свёрнутость: выбор пользователя переживает перезагрузку (persistKey) */
|
|
37
36
|
const guiCollapsed = untrack(() => collapsed)
|
|
38
37
|
collapsed = readPersistedCollapsed(
|
|
39
38
|
untrack(() => persistKey),
|
|
@@ -41,7 +40,6 @@
|
|
|
41
40
|
)
|
|
42
41
|
$effect(() => writePersistedCollapsed(persistKey, collapsed, guiCollapsed))
|
|
43
42
|
|
|
44
|
-
/* Живое состояние: пока виджет раскрыт, раз в refreshMs он просит перечитать группу */
|
|
45
43
|
$effect(() => {
|
|
46
44
|
if (collapsed || !refreshMs || !onRefresh) return
|
|
47
45
|
const timer = setInterval(() => onRefresh?.(), refreshMs)
|
|
@@ -50,7 +48,6 @@
|
|
|
50
48
|
|
|
51
49
|
const finite = (v: unknown) => (v === undefined || v === null || v === "" || !Number.isFinite(Number(v)) ? undefined : Number(v))
|
|
52
50
|
|
|
53
|
-
/* Флаги оси (Flg): 0x01 включён, 0x02 выход в угол, 0x04 калибровка нуля, 0x08 поток уставок прервался, 0x10 ноль известен, 0x20 занят процедурой */
|
|
54
51
|
const flags = $derived(finite(value.Flg))
|
|
55
52
|
const flag = (bit: number) => flags !== undefined && (flags & bit) !== 0
|
|
56
53
|
const enabled = $derived(flag(0x01))
|
|
@@ -67,85 +64,77 @@
|
|
|
67
64
|
],
|
|
68
65
|
)
|
|
69
66
|
|
|
70
|
-
/* Настройки по разделам: ключ, единица (ключ перевода widget.foc.unit.*), выбор - варианты 0..n-1, только чтение */
|
|
71
67
|
type Field = { key: string; unit?: string; options?: string[]; readonly?: boolean; step?: number; torqueModes?: number[] }
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
{ key: "A_Lim", unit: "dps", step: 1 },
|
|
112
|
-
],
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
key: "sensor",
|
|
116
|
-
fields: [
|
|
117
|
-
{ key: "S_Gain", unit: "vpa", step: 0.001 },
|
|
118
|
-
{ key: "S_OffA", unit: "volt", readonly: true },
|
|
119
|
-
{ key: "S_OffB", unit: "volt", readonly: true },
|
|
120
|
-
{ key: "S_OffC", unit: "volt", readonly: true },
|
|
121
|
-
{ key: "S_VTf", unit: "sec", step: 0.001 },
|
|
122
|
-
{ key: "S_CTf", unit: "sec", step: 0.0001 },
|
|
123
|
-
],
|
|
124
|
-
},
|
|
68
|
+
|
|
69
|
+
const motorFields: Field[] = [
|
|
70
|
+
{ key: "M_Type", options: ["bldc", "stepper"] },
|
|
71
|
+
{ key: "M_PP", step: 1 },
|
|
72
|
+
{ key: "M_R", unit: "ohm", step: 0.01 },
|
|
73
|
+
{ key: "M_L", unit: "h", step: 0.0001 },
|
|
74
|
+
{ key: "M_KV", unit: "kv", step: 1 },
|
|
75
|
+
{ key: "M_Dir", readonly: true },
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
const limitsFields: Field[] = [
|
|
79
|
+
{ key: "M_VL", unit: "volt", step: 0.1 },
|
|
80
|
+
{ key: "M_CL", unit: "amp", step: 0.01, torqueModes: [1, 2, 3] },
|
|
81
|
+
{ key: "M_VLL", unit: "dps", step: 1 },
|
|
82
|
+
{ key: "M_CTO", unit: "ms", step: 10 },
|
|
83
|
+
{ key: "M_Torq", options: ["voltage", "estCurrent", "dcCurrent", "focCurrent"] },
|
|
84
|
+
{ key: "M_Mod", options: ["spwm", "svm", "trap120", "trap150"] },
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
const currentFields: Field[] = [
|
|
88
|
+
{ key: "C_Kp", step: 0.001, torqueModes: [2, 3] },
|
|
89
|
+
{ key: "C_Ki", step: 0.001, torqueModes: [2, 3] },
|
|
90
|
+
{ key: "C_Kd", step: 0.001, torqueModes: [2, 3] },
|
|
91
|
+
{ key: "C_Lim", unit: "volt", step: 0.1, torqueModes: [2, 3] },
|
|
92
|
+
{ key: "C_Ramp", unit: "vps", step: 0.001, torqueModes: [2, 3] },
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
const velocityFields: Field[] = [
|
|
96
|
+
{ key: "V_Kp", step: 0.0001 },
|
|
97
|
+
{ key: "V_Ki", step: 0.0001 },
|
|
98
|
+
{ key: "V_Kd", step: 0.0001 },
|
|
99
|
+
{ key: "V_Lim", readonly: true },
|
|
100
|
+
{ key: "V_Ramp", step: 0.0001 },
|
|
101
|
+
]
|
|
102
|
+
|
|
103
|
+
const angleFields: Field[] = [
|
|
104
|
+
{ key: "A_Kp", step: 0.1 },
|
|
105
|
+
{ key: "A_Lim", unit: "dps", step: 1 },
|
|
106
|
+
{ key: "A_Ramp", unit: "dps2", step: 1 },
|
|
125
107
|
]
|
|
108
|
+
|
|
109
|
+
const sensorFields: Field[] = [
|
|
110
|
+
{ key: "S_Gain", unit: "vpa", step: 0.001 },
|
|
111
|
+
{ key: "S_OffA", unit: "volt", readonly: true },
|
|
112
|
+
{ key: "S_OffB", unit: "volt", readonly: true },
|
|
113
|
+
{ key: "S_OffC", unit: "volt", readonly: true },
|
|
114
|
+
{ key: "S_VTf", unit: "sec", step: 0.001 },
|
|
115
|
+
{ key: "S_CTf", unit: "sec", step: 0.0001 },
|
|
116
|
+
]
|
|
117
|
+
|
|
118
|
+
const allFields = [...motorFields, ...limitsFields, ...currentFields, ...velocityFields, ...angleFields, ...sensorFields]
|
|
119
|
+
|
|
126
120
|
let open = $state<Record<string, boolean>>({})
|
|
127
121
|
let edits = $state<Record<string, number>>({})
|
|
128
122
|
const read = (key: string) => finite(value[key as keyof typeof value])
|
|
123
|
+
|
|
129
124
|
const polePairs = $derived(read("M_PP") ?? 0)
|
|
130
125
|
const zeroTravel = $derived(
|
|
131
126
|
Number.isInteger(polePairs) && polePairs > 0
|
|
132
127
|
? $T("widget.foc.zero.travel", { degrees: (270 / polePairs).toLocaleString($Language, { maximumFractionDigits: 1 }) })
|
|
133
128
|
: $T("widget.foc.zero.travel.unknown"),
|
|
134
129
|
)
|
|
130
|
+
|
|
135
131
|
const torqueMode = $derived(edits.M_Torq ?? read("M_Torq"))
|
|
136
132
|
const motorType = $derived(edits.M_Type ?? read("M_Type"))
|
|
137
133
|
const usesCurrentLoop = $derived(torqueMode === undefined || torqueMode === 2 || torqueMode === 3)
|
|
134
|
+
|
|
138
135
|
const available = (f: Field) => (f.key === "M_Mod" ? motorType !== 1 : !f.torqueModes || torqueMode === undefined || f.torqueModes.includes(torqueMode))
|
|
139
136
|
const shown = (f: Field) => (available(f) ? edits[f.key] : undefined) ?? read(f.key)
|
|
140
|
-
|
|
141
|
-
SECTIONS.flatMap(({ fields }) => fields).filter((f) => !f.readonly && available(f) && edits[f.key] !== undefined && edits[f.key] !== read(f.key)),
|
|
142
|
-
)
|
|
143
|
-
const dirty = $derived(Object.keys(edits).some((key) => edits[key] !== read(key)))
|
|
144
|
-
const save = () => {
|
|
145
|
-
if (!onSave || busy || !changedFields.length) return
|
|
146
|
-
onSave(Object.fromEntries(changedFields.map(({ key }) => [key, edits[key]])))
|
|
147
|
-
edits = {}
|
|
148
|
-
}
|
|
137
|
+
|
|
149
138
|
const fieldName = (f: Field) => {
|
|
150
139
|
const reportedMode = read("M_Torq")
|
|
151
140
|
const unit =
|
|
@@ -161,14 +150,29 @@
|
|
|
161
150
|
return `${$T(`widget.foc.field.${f.key}`)}${unit ? `, ${$T(`widget.foc.unit.${unit}`)}` : ""}`
|
|
162
151
|
}
|
|
163
152
|
const optionText = (f: Field, v: number | undefined) => (v === undefined ? "-" : f.options ? $T(`widget.foc.opt.${f.options[v] ?? v}`) : String(v))
|
|
164
|
-
|
|
165
|
-
|
|
153
|
+
|
|
154
|
+
const summaryOf = (fields: Field[]) =>
|
|
155
|
+
fields
|
|
166
156
|
.filter(available)
|
|
167
157
|
.slice(0, 4)
|
|
168
158
|
.map((f) => `${f.key} ${optionText(f, shown(f))}`)
|
|
169
159
|
.join(" · ")
|
|
170
160
|
|
|
171
|
-
|
|
161
|
+
const dirty = $derived(Object.keys(edits).some((key) => edits[key] !== read(key)))
|
|
162
|
+
const changedEntries = $derived(
|
|
163
|
+
Object.entries(edits)
|
|
164
|
+
.filter(([k, v]) => v !== read(k))
|
|
165
|
+
.filter(([k]) => {
|
|
166
|
+
const f = allFields.find((x) => x.key === k)
|
|
167
|
+
return !!f && !f.readonly && available(f)
|
|
168
|
+
}),
|
|
169
|
+
)
|
|
170
|
+
const save = () => {
|
|
171
|
+
if (!onSave || busy || !changedEntries.length) return
|
|
172
|
+
onSave(Object.fromEntries(changedEntries))
|
|
173
|
+
edits = {}
|
|
174
|
+
}
|
|
175
|
+
|
|
172
176
|
let tuneHz = $state<number | undefined>(undefined)
|
|
173
177
|
const tuneShown = $derived(tuneHz ?? read("TuneHz") ?? 40)
|
|
174
178
|
let tuneWait = $state(false)
|
|
@@ -184,18 +188,19 @@
|
|
|
184
188
|
onRefresh?.()
|
|
185
189
|
}, 2500)
|
|
186
190
|
}
|
|
191
|
+
|
|
192
|
+
const hasCurrentSensor = $derived(value.IA !== undefined && value.IB !== undefined && value.IC !== undefined)
|
|
187
193
|
</script>
|
|
188
194
|
|
|
189
195
|
{#snippet fieldCell(title: string, samples: string[], inset: string, content: Snippet)}
|
|
190
196
|
<div class="max-w-full min-w-0 flex-[1_1_max-content]">
|
|
191
|
-
<!-- Ширина строки зависит от подписи и текста поля, без стандартной ширины input браузера -->
|
|
192
197
|
<div class="pointer-events-none invisible h-0 overflow-hidden whitespace-nowrap" aria-hidden="true">
|
|
193
198
|
<div class="text-[12px] font-semibold">{title}</div>
|
|
194
199
|
{#each samples as sample (sample)}
|
|
195
200
|
<div class="text-[14px]" style:padding-inline={inset}>{sample}</div>
|
|
196
201
|
{/each}
|
|
197
202
|
</div>
|
|
198
|
-
<div class="[
|
|
203
|
+
<div class="contain-[inline-size]">
|
|
199
204
|
{@render content()}
|
|
200
205
|
</div>
|
|
201
206
|
</div>
|
|
@@ -216,6 +221,59 @@
|
|
|
216
221
|
{/snippet}
|
|
217
222
|
{/snippet}
|
|
218
223
|
|
|
224
|
+
{#snippet selectField(f: Field)}
|
|
225
|
+
{@const options = f.options!.map((o, i) => ({ id: `${f.key}-${o}`, name: $T(`widget.foc.opt.${o}`), value: i }))}
|
|
226
|
+
{@render fieldCell(
|
|
227
|
+
fieldName(f),
|
|
228
|
+
options.map(({ name }) => name),
|
|
229
|
+
"1.5rem",
|
|
230
|
+
select,
|
|
231
|
+
)}
|
|
232
|
+
{#snippet select()}
|
|
233
|
+
<UI.Select
|
|
234
|
+
type="buttons"
|
|
235
|
+
label={{ name: fieldName(f) }}
|
|
236
|
+
{options}
|
|
237
|
+
value={shown(f)}
|
|
238
|
+
disabled={!onSave || busy}
|
|
239
|
+
onUpdate={(v) => (edits = { ...edits, [f.key]: Number(v) })}
|
|
240
|
+
/>
|
|
241
|
+
{/snippet}
|
|
242
|
+
{/snippet}
|
|
243
|
+
|
|
244
|
+
{#snippet field(f: Field)}
|
|
245
|
+
{#if available(f)}
|
|
246
|
+
{#if f.options}
|
|
247
|
+
{@render selectField(f)}
|
|
248
|
+
{:else}
|
|
249
|
+
{@render numberField(f)}
|
|
250
|
+
{/if}
|
|
251
|
+
{/if}
|
|
252
|
+
{/snippet}
|
|
253
|
+
|
|
254
|
+
{#snippet section(key: string, fields: Field[], children?: Snippet)}
|
|
255
|
+
<div class="flex flex-col rounded-[10px] border border-(--hairline-color) bg-(--back-color)">
|
|
256
|
+
<div class="px-3 py-2" use:hint={{ text: $T(`widget.foc.hint.${key}`), enabled: $hints }}>
|
|
257
|
+
<SectionHead
|
|
258
|
+
title={$T(`widget.foc.section.${key}`)}
|
|
259
|
+
summary={summaryOf(fields)}
|
|
260
|
+
open={!!open[key]}
|
|
261
|
+
onToggle={() => (open = { ...open, [key]: !open[key] })}
|
|
262
|
+
/>
|
|
263
|
+
</div>
|
|
264
|
+
{#if open[key]}
|
|
265
|
+
<div class="flex flex-wrap items-end gap-x-3 gap-y-2 border-t border-(--hairline-color) p-3">
|
|
266
|
+
{#each fields as f (f.key)}
|
|
267
|
+
{@render field(f)}
|
|
268
|
+
{/each}
|
|
269
|
+
{#if children}
|
|
270
|
+
{@render children()}
|
|
271
|
+
{/if}
|
|
272
|
+
</div>
|
|
273
|
+
{/if}
|
|
274
|
+
</div>
|
|
275
|
+
{/snippet}
|
|
276
|
+
|
|
219
277
|
<div
|
|
220
278
|
class={twMerge("@container relative flex w-full flex-col gap-4 rounded-2xl border border-(--hairline-color) bg-(--container-color) p-4", wrapperClass)}
|
|
221
279
|
style={rootStyle}
|
|
@@ -236,6 +294,33 @@
|
|
|
236
294
|
</span>
|
|
237
295
|
{/each}
|
|
238
296
|
</div>
|
|
297
|
+
{#if onTune}
|
|
298
|
+
{@const tuneLabel = `${$T("widget.foc.field.TuneHz")}, ${$T("widget.foc.unit.hz")}`}
|
|
299
|
+
<div class="flex flex-wrap items-center gap-2" use:hint={{ text: $T("widget.foc.hint.tune"), enabled: $hints }}>
|
|
300
|
+
<div class="flex-shrink-0">
|
|
301
|
+
{@render fieldCell(tuneLabel, [String(tuneShown)], "1.5rem", bandwidth)}
|
|
302
|
+
</div>
|
|
303
|
+
{#snippet bandwidth()}
|
|
304
|
+
<UI.Input
|
|
305
|
+
wrapperClass="w-24"
|
|
306
|
+
type="number"
|
|
307
|
+
label={{ name: tuneLabel }}
|
|
308
|
+
value={tuneShown}
|
|
309
|
+
number={{ minNum: 5, maxNum: 60, step: 1 }}
|
|
310
|
+
disabled={busy || tuneWait}
|
|
311
|
+
onUpdate={(v) => (tuneHz = Number(v))}
|
|
312
|
+
/>
|
|
313
|
+
{/snippet}
|
|
314
|
+
<UI.Button
|
|
315
|
+
wrapperClass="w-40"
|
|
316
|
+
variant="primary"
|
|
317
|
+
content={{ name: $T("widget.foc.tune") }}
|
|
318
|
+
disabled={!enabled || busy || tuneWait}
|
|
319
|
+
confirm={$T("widget.foc.tune.confirm")}
|
|
320
|
+
onClick={tune}
|
|
321
|
+
/>
|
|
322
|
+
</div>
|
|
323
|
+
{/if}
|
|
239
324
|
{#if onEnable}
|
|
240
325
|
<div use:hint={{ text: $T("widget.foc.hint.enable"), enabled: $hints }}>
|
|
241
326
|
<UI.Button
|
|
@@ -256,90 +341,41 @@
|
|
|
256
341
|
<SensorReadout label="Uq" value={value.Uq} digits={2} unit={$T("widget.foc.unit.volt")} />
|
|
257
342
|
</div>
|
|
258
343
|
|
|
259
|
-
{#if
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
<
|
|
263
|
-
|
|
264
|
-
{#snippet bandwidth()}
|
|
265
|
-
<UI.Input
|
|
266
|
-
type="number"
|
|
267
|
-
label={{ name: tuneLabel }}
|
|
268
|
-
value={tuneShown}
|
|
269
|
-
number={{ minNum: 5, maxNum: 60, step: 1 }}
|
|
270
|
-
disabled={busy || tuneWait}
|
|
271
|
-
onUpdate={(v) => (tuneHz = Number(v))}
|
|
272
|
-
/>
|
|
273
|
-
{/snippet}
|
|
274
|
-
<UI.Button
|
|
275
|
-
wrapperClass="w-44"
|
|
276
|
-
variant="primary"
|
|
277
|
-
content={{ name: $T("widget.foc.tune") }}
|
|
278
|
-
disabled={!enabled || busy || tuneWait}
|
|
279
|
-
confirm={$T("widget.foc.tune.confirm")}
|
|
280
|
-
onClick={tune}
|
|
281
|
-
/>
|
|
282
|
-
</div>
|
|
344
|
+
{#if hasCurrentSensor}
|
|
345
|
+
<div class="grid grid-cols-3 gap-1.5" use:hint={{ text: $T("widget.foc.hint.phaseCurrents"), enabled: $hints }}>
|
|
346
|
+
<SensorReadout label="IA" value={value.IA} digits={3} unit={$T("widget.foc.unit.amp")} />
|
|
347
|
+
<SensorReadout label="IB" value={value.IB} digits={3} unit={$T("widget.foc.unit.amp")} />
|
|
348
|
+
<SensorReadout label="IC" value={value.IC} digits={3} unit={$T("widget.foc.unit.amp")} />
|
|
283
349
|
</div>
|
|
284
350
|
{/if}
|
|
285
351
|
|
|
286
|
-
{#
|
|
287
|
-
<div class="flex
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
{@const options = f.options.map((o, i) => ({ id: `${f.key}-${o}`, name: $T(`widget.foc.opt.${o}`), value: i }))}
|
|
301
|
-
{@render fieldCell(
|
|
302
|
-
fieldName(f),
|
|
303
|
-
options.map(({ name }) => name),
|
|
304
|
-
"1.5rem",
|
|
305
|
-
select,
|
|
306
|
-
)}
|
|
307
|
-
{#snippet select()}
|
|
308
|
-
<UI.Select
|
|
309
|
-
type="buttons"
|
|
310
|
-
label={{ name: fieldName(f) }}
|
|
311
|
-
{options}
|
|
312
|
-
value={shown(f)}
|
|
313
|
-
disabled={!onSave || busy}
|
|
314
|
-
onUpdate={(v) => (edits = { ...edits, [f.key]: Number(v) })}
|
|
315
|
-
/>
|
|
316
|
-
{/snippet}
|
|
317
|
-
{:else}
|
|
318
|
-
{@render numberField(f)}
|
|
319
|
-
{/if}
|
|
320
|
-
{/each}
|
|
321
|
-
{#if section.key === "motor"}
|
|
322
|
-
<div class="flex max-w-full min-w-0 flex-[0_1_max-content] flex-wrap items-end gap-x-3 gap-y-2">
|
|
323
|
-
{@render numberField({ key: "ZEA", unit: "edeg", readonly: true })}
|
|
324
|
-
{#if onZero}
|
|
325
|
-
<div use:hint={{ text: $T("widget.foc.hint.zero"), enabled: $hints }}>
|
|
326
|
-
<UI.Button
|
|
327
|
-
wrapperClass="w-auto"
|
|
328
|
-
componentClass="px-3 whitespace-nowrap"
|
|
329
|
-
variant="primary"
|
|
330
|
-
content={{ name: $T("widget.foc.zero") }}
|
|
331
|
-
disabled={!enabled || busy}
|
|
332
|
-
confirm={`${$T("widget.foc.zero.confirm")}\n\n${zeroTravel}`}
|
|
333
|
-
onClick={onZero}
|
|
334
|
-
/>
|
|
335
|
-
</div>
|
|
336
|
-
{/if}
|
|
337
|
-
</div>
|
|
338
|
-
{/if}
|
|
352
|
+
{#snippet motorExtra()}
|
|
353
|
+
<div class="flex max-w-full min-w-0 flex-[0_1_max-content] flex-wrap items-end gap-x-3 gap-y-2">
|
|
354
|
+
{@render numberField({ key: "ZEA", unit: "edeg", readonly: true })}
|
|
355
|
+
{#if onZero}
|
|
356
|
+
<div use:hint={{ text: $T("widget.foc.hint.zero"), enabled: $hints }}>
|
|
357
|
+
<UI.Button
|
|
358
|
+
wrapperClass="w-auto"
|
|
359
|
+
componentClass="px-3 whitespace-nowrap"
|
|
360
|
+
variant="primary"
|
|
361
|
+
content={{ name: $T("widget.foc.zero") }}
|
|
362
|
+
disabled={!enabled || busy}
|
|
363
|
+
confirm={`${$T("widget.foc.zero.confirm")}\n\n${zeroTravel}`}
|
|
364
|
+
onClick={onZero}
|
|
365
|
+
/>
|
|
339
366
|
</div>
|
|
340
367
|
{/if}
|
|
341
368
|
</div>
|
|
342
|
-
{/
|
|
369
|
+
{/snippet}
|
|
370
|
+
|
|
371
|
+
{@render section("motor", motorFields, motorExtra)}
|
|
372
|
+
{@render section("limits", limitsFields)}
|
|
373
|
+
{#if usesCurrentLoop}
|
|
374
|
+
{@render section("current", currentFields)}
|
|
375
|
+
{/if}
|
|
376
|
+
{@render section("velocity", velocityFields)}
|
|
377
|
+
{@render section("angle", angleFields)}
|
|
378
|
+
{@render section("sensor", sensorFields)}
|
|
343
379
|
|
|
344
380
|
{#if onSave}
|
|
345
381
|
<div class="flex flex-col items-center gap-2">
|
|
@@ -372,7 +408,7 @@
|
|
|
372
408
|
componentClass="px-2 whitespace-nowrap"
|
|
373
409
|
variant="primary"
|
|
374
410
|
content={{ name: $T("widget.common.save") }}
|
|
375
|
-
disabled={!
|
|
411
|
+
disabled={!changedEntries.length || busy}
|
|
376
412
|
onClick={save}
|
|
377
413
|
/>
|
|
378
414
|
</div>
|
package/dist/gui.d.ts
CHANGED
package/dist/gui.js
CHANGED
|
@@ -171,13 +171,16 @@ export const WIDGET_FIELDS = {
|
|
|
171
171
|
Iq: num,
|
|
172
172
|
Uq: num,
|
|
173
173
|
Flg: num,
|
|
174
|
+
IA: num /* токи фаз, только при наличии датчика тока */,
|
|
175
|
+
IB: num,
|
|
176
|
+
IC: num,
|
|
174
177
|
M_Type: num,
|
|
175
178
|
M_PP: num,
|
|
176
179
|
M_R: num,
|
|
177
180
|
M_L: num,
|
|
178
181
|
M_KV: num,
|
|
179
|
-
M_Dir: num
|
|
180
|
-
ZEA: num
|
|
182
|
+
M_Dir: num /* readonly в прошивке */,
|
|
183
|
+
ZEA: num /* readonly в прошивке */,
|
|
181
184
|
M_VL: num,
|
|
182
185
|
M_CL: num,
|
|
183
186
|
M_VLL: num,
|
|
@@ -198,13 +201,13 @@ export const WIDGET_FIELDS = {
|
|
|
198
201
|
A_Lim: num,
|
|
199
202
|
A_Ramp: num,
|
|
200
203
|
S_Gain: num,
|
|
201
|
-
S_OffA: num
|
|
202
|
-
S_OffB: num
|
|
203
|
-
S_OffC: num
|
|
204
|
+
S_OffA: num /* readonly в прошивке */,
|
|
205
|
+
S_OffB: num /* readonly в прошивке */,
|
|
206
|
+
S_OffC: num /* readonly в прошивке */,
|
|
204
207
|
S_VTf: num,
|
|
205
208
|
S_CTf: num,
|
|
206
|
-
TuneHz: num
|
|
207
|
-
Run: num,
|
|
209
|
+
TuneHz: num /* range 5..100 */,
|
|
210
|
+
Run: num /* 0/1, триггер автонастройки */,
|
|
208
211
|
},
|
|
209
212
|
/* База оси любого привода (группа HOME, компонент homing прошивки): способ, состояние и края - только чтение; Off, Speed, Marg и ключи способа сохраняются */
|
|
210
213
|
WidgetHoming: {
|