poe-svelte-ui-lib 3.13.1 → 3.13.2

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.
@@ -88,7 +88,7 @@
88
88
  { key: "C_Kp", step: 0.001, torqueModes: [2, 3] },
89
89
  { key: "C_Ki", step: 0.001, torqueModes: [2, 3] },
90
90
  { key: "C_Kd", step: 0.001, torqueModes: [2, 3] },
91
- { key: "C_Lim", unit: "volt", step: 0.1, torqueModes: [2, 3] },
91
+ { key: "C_Lim", unit: "volt", readonly: true },
92
92
  { key: "C_Ramp", unit: "vps", step: 0.001, torqueModes: [2, 3] },
93
93
  ]
94
94
 
@@ -158,7 +158,6 @@
158
158
  .map((f) => `${f.key} ${optionText(f, shown(f))}`)
159
159
  .join(" · ")
160
160
 
161
- const dirty = $derived(Object.keys(edits).some((key) => edits[key] !== read(key)))
162
161
  const changedEntries = $derived(
163
162
  Object.entries(edits)
164
163
  .filter(([k, v]) => v !== read(k))
@@ -167,6 +166,7 @@
167
166
  return !!f && !f.readonly && available(f)
168
167
  }),
169
168
  )
169
+ const dirty = $derived(changedEntries.length > 0)
170
170
  const save = () => {
171
171
  if (!onSave || busy || !changedEntries.length) return
172
172
  onSave(Object.fromEntries(changedEntries))
@@ -176,12 +176,30 @@
176
176
  let tuneHz = $state<number | undefined>(undefined)
177
177
  const tuneShown = $derived(tuneHz ?? read("TuneHz") ?? 40)
178
178
  let tuneWait = $state(false)
179
+ let tuneSeen = false
179
180
  let tuneTimer: ReturnType<typeof setTimeout> | undefined
180
181
  onDestroy(() => clearTimeout(tuneTimer))
182
+ /* Пока BUSY стоит - замер идёт, страховка перезапускается; снялся - результат готов */
183
+ $effect(() => {
184
+ if (!tuneWait) return
185
+ if (busy) {
186
+ tuneSeen = true
187
+ clearTimeout(tuneTimer)
188
+ tuneTimer = setTimeout(() => (tuneWait = false), 2500)
189
+ return
190
+ }
191
+ if (tuneSeen) {
192
+ tuneWait = false
193
+ tuneSeen = false
194
+ clearTimeout(tuneTimer)
195
+ onRefresh?.()
196
+ }
197
+ })
181
198
  const tune = () => {
182
199
  if (!onTune) return
183
200
  onTune(tuneShown)
184
201
  tuneWait = true
202
+ tuneSeen = false
185
203
  clearTimeout(tuneTimer)
186
204
  tuneTimer = setTimeout(() => {
187
205
  tuneWait = false
@@ -194,6 +212,7 @@
194
212
 
195
213
  {#snippet fieldCell(title: string, samples: string[], inset: string, content: Snippet)}
196
214
  <div class="max-w-full min-w-0 flex-[1_1_max-content]">
215
+ <!-- Ширина строки зависит от подписи и текста поля, без стандартной ширины input браузера -->
197
216
  <div class="pointer-events-none invisible h-0 overflow-hidden whitespace-nowrap" aria-hidden="true">
198
217
  <div class="text-[12px] font-semibold">{title}</div>
199
218
  {#each samples as sample (sample)}
@@ -297,7 +316,7 @@
297
316
  {#if onTune}
298
317
  {@const tuneLabel = `${$T("widget.foc.field.TuneHz")}, ${$T("widget.foc.unit.hz")}`}
299
318
  <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">
319
+ <div class="w-24 shrink-0">
301
320
  {@render fieldCell(tuneLabel, [String(tuneShown)], "1.5rem", bandwidth)}
302
321
  </div>
303
322
  {#snippet bandwidth()}
@@ -1804,6 +1804,11 @@ declare const translations: {
1804
1804
  en: string;
1805
1805
  zh: string;
1806
1806
  };
1807
+ "widget.foc.field.A_Ramp": {
1808
+ ru: string;
1809
+ en: string;
1810
+ zh: string;
1811
+ };
1807
1812
  "widget.foc.field.M_Type": {
1808
1813
  ru: string;
1809
1814
  en: string;
@@ -2014,6 +2019,11 @@ declare const translations: {
2014
2019
  en: string;
2015
2020
  zh: string;
2016
2021
  };
2022
+ "widget.foc.unit.dps2": {
2023
+ ru: string;
2024
+ en: string;
2025
+ zh: string;
2026
+ };
2017
2027
  "widget.foc.unit.ohm": {
2018
2028
  ru: string;
2019
2029
  en: string;
@@ -2119,6 +2129,11 @@ declare const translations: {
2119
2129
  en: string;
2120
2130
  zh: string;
2121
2131
  };
2132
+ "widget.foc.hint.phaseCurrents": {
2133
+ ru: string;
2134
+ en: string;
2135
+ zh: string;
2136
+ };
2122
2137
  "widget.foc.hint.zero": {
2123
2138
  ru: string;
2124
2139
  en: string;
@@ -801,6 +801,7 @@ const translations = {
801
801
  "widget.foc.section.velocity": { ru: "Контур скорости", en: "Velocity loop", zh: "速度环" },
802
802
  "widget.foc.section.angle": { ru: "Контур угла", en: "Angle loop", zh: "角度环" },
803
803
  "widget.foc.section.sensor": { ru: "Датчик тока и фильтры", en: "Current sensor and filters", zh: "电流传感器与滤波" },
804
+ "widget.foc.field.A_Ramp": { ru: "Нарастание", en: "Ramp", zh: "斜坡" },
804
805
  "widget.foc.field.M_Type": { ru: "Тип", en: "Type", zh: "类型" },
805
806
  "widget.foc.field.M_PP": { ru: "Пары полюсов", en: "Pole pairs", zh: "极对数" },
806
807
  "widget.foc.field.M_R": { ru: "R фазы", en: "Phase R", zh: "相电阻" },
@@ -843,6 +844,7 @@ const translations = {
843
844
  "widget.foc.opt.svm": { ru: "SVM", en: "SVM", zh: "SVM" },
844
845
  "widget.foc.opt.trap120": { ru: "Trap 120", en: "Trap 120", zh: "Trap 120" },
845
846
  "widget.foc.opt.trap150": { ru: "Trap 150", en: "Trap 150", zh: "Trap 150" },
847
+ "widget.foc.unit.dps2": { ru: "°/с²", en: "°/s²", zh: "°/s²" },
846
848
  "widget.foc.unit.ohm": { ru: "Ом", en: "Ω", zh: "Ω" },
847
849
  "widget.foc.unit.h": { ru: "Гн", en: "H", zh: "H" },
848
850
  "widget.foc.unit.kv": { ru: "об/мин/В", en: "rpm/V", zh: "rpm/V" },
@@ -896,6 +898,7 @@ const translations = {
896
898
  en: "**Angle** - shaft angle, 0-360°\n**Speed** - shaft speed, °/s\n**Iq** - torque current, A\n**Uq** - q-axis voltage, V\n**Update** - once a second while the widget is open",
897
899
  zh: "**角度** - 轴角度,0-360°\n**速度** - 轴速度,°/s\n**Iq** - 力矩电流,A\n**Uq** - q 轴电压,V\n**更新** - 组件展开时每秒一次",
898
900
  },
901
+ "widget.foc.hint.phaseCurrents": { ru: "Токи фаз, А. Плюс — ток в мотор.", en: "Phase currents, A. Positive — current into the motor.", zh: "相电流,A。正值为流入电机的电流。" },
899
902
  "widget.foc.hint.zero": {
900
903
  ru: "**Поиск электрического нуля** совмещает ротор с полем, затем поворачивает поле на 90 эл. ° для определения направления датчика. После успеха сохраняет `ZEA` и `M_Dir`.\nПовторите поиск после замены мотора, энкодера или магнита. Ось должна свободно поворачиваться в обе стороны.",
901
904
  en: "**Electrical zero search** aligns the rotor with the electrical field, then rotates the field by 90 electrical degrees to determine sensor direction. On success it saves `ZEA` and `M_Dir`.\nRepeat after replacing the motor, encoder, or magnet. The axis needs free travel in both directions.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poe-svelte-ui-lib",
3
- "version": "3.13.1",
3
+ "version": "3.13.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Oleg-Perevyshin/ElementsUI.git"