geomui 0.5.52 → 0.5.56
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/Drawing.svelte +275 -262
- package/dist/Drawing.svelte.d.ts +8 -24
- package/dist/DrawingList.svelte +38 -33
- package/dist/DrawingList.svelte.d.ts +5 -18
- package/dist/InputParams.svelte +338 -283
- package/dist/InputParams.svelte.d.ts +7 -25
- package/dist/LabelCheckbox.svelte +12 -11
- package/dist/LabelCheckbox.svelte.d.ts +16 -14
- package/dist/LocStorRead.svelte +29 -17
- package/dist/LocStorRead.svelte.d.ts +6 -19
- package/dist/LocStorTable.svelte +88 -68
- package/dist/LocStorTable.svelte.d.ts +7 -20
- package/dist/LocStorWrite.svelte +28 -22
- package/dist/LocStorWrite.svelte.d.ts +6 -19
- package/dist/ModalDiag.svelte +33 -15
- package/dist/ModalDiag.svelte.d.ts +10 -22
- package/dist/ModalImg.svelte +11 -6
- package/dist/ModalImg.svelte.d.ts +6 -19
- package/dist/OneDesign.svelte +15 -6
- package/dist/OneDesign.svelte.d.ts +6 -19
- package/dist/ParamDrawExport.svelte +220 -134
- package/dist/ParamDrawExport.svelte.d.ts +7 -20
- package/dist/SimpleDrawing.svelte +82 -49
- package/dist/SimpleDrawing.svelte.d.ts +7 -23
- package/dist/SubDesign.svelte +64 -45
- package/dist/SubDesign.svelte.d.ts +8 -21
- package/dist/TimeControl.svelte +84 -69
- package/dist/TimeControl.svelte.d.ts +8 -21
- package/dist/ZoomControl.svelte +21 -14
- package/dist/ZoomControl.svelte.d.ts +5 -18
- package/dist/initStore.js +12 -11
- package/dist/stateDrawing.svelte.d.ts +8 -0
- package/dist/stateDrawing.svelte.js +8 -0
- package/dist/stateParams.svelte.d.ts +5 -0
- package/dist/stateParams.svelte.js +3 -0
- package/package.json +21 -21
- package/dist/drawingLayers.d.ts +0 -2
- package/dist/drawingLayers.js +0 -6
- package/dist/storePVal.d.ts +0 -5
- package/dist/storePVal.js +0 -4
package/dist/InputParams.svelte
CHANGED
|
@@ -1,247 +1,272 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
function
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
function
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
//import type { tOkFunc } from './ModalDiag.svelte';
|
|
3
|
+
import ModalDiag from './ModalDiag.svelte';
|
|
4
|
+
import ModalImg from './ModalImg.svelte';
|
|
5
|
+
import LocStorWrite from './LocStorWrite.svelte';
|
|
6
|
+
import LocStorRead from './LocStorRead.svelte';
|
|
7
|
+
import SimpleDrawing from './SimpleDrawing.svelte';
|
|
8
|
+
import type { tParam, tParamDef, tParamVal, Figure } from 'geometrix';
|
|
9
|
+
import { PType, parseParamFile, createParamFile } from 'geometrix';
|
|
10
|
+
import { sParams } from './stateParams.svelte';
|
|
11
|
+
import { downloadParams, generateUrl } from './downloadParams';
|
|
12
|
+
import { browser } from '$app/environment';
|
|
13
|
+
import { page } from '$app/stores';
|
|
14
|
+
import { base } from '$app/paths';
|
|
15
|
+
|
|
16
|
+
// props
|
|
17
|
+
interface Props {
|
|
18
|
+
pDef: tParamDef;
|
|
19
|
+
pFig: Figure;
|
|
20
|
+
}
|
|
21
|
+
let { pDef, pFig }: Props = $props();
|
|
22
|
+
|
|
23
|
+
// type
|
|
24
|
+
type tHTableVis = Record<string, boolean>;
|
|
25
|
+
|
|
26
|
+
// state
|
|
27
|
+
let inputComment: string = $state('');
|
|
28
|
+
let hideColumn: boolean = $state(false);
|
|
29
|
+
let loadMsg: string = $state('');
|
|
30
|
+
let applyWarn: boolean = $state(false);
|
|
31
|
+
let modalLoadDefault: boolean = $state(false);
|
|
32
|
+
let modalLoadLocal: boolean = $state(false);
|
|
33
|
+
let modalSaveUrl: boolean = $state(false);
|
|
34
|
+
let modalSaveLocal: boolean = $state(false);
|
|
35
|
+
let locStorRname: string = $state('');
|
|
36
|
+
let locStorWname: string = $state('');
|
|
37
|
+
let pUrl: string = $state('');
|
|
38
|
+
let paramSvg: string = $state(checkPict(pDef.params[0].name));
|
|
39
|
+
let modalImg: boolean = $state(false);
|
|
40
|
+
let htableVis: tHTableVis = $state(makeHTableVis(makeHTable(pDef.params)));
|
|
41
|
+
|
|
42
|
+
// initialization
|
|
43
|
+
// tolerant applyParamVal
|
|
44
|
+
function tolerantApply(iPartName: string, ipVal: tParamVal): [string, boolean] {
|
|
45
|
+
let rMsg = '';
|
|
46
|
+
// partName
|
|
47
|
+
let applyWarn1 = false;
|
|
48
|
+
if (iPartName !== pDef.partName) {
|
|
49
|
+
rMsg += `warn361: read partName: '${iPartName}' expected partName: '${pDef.partName}'\n`;
|
|
50
|
+
applyWarn1 = true;
|
|
51
|
+
}
|
|
52
|
+
// forward
|
|
53
|
+
let cover = 0;
|
|
54
|
+
let uncover = 0;
|
|
55
|
+
let equal = 0;
|
|
56
|
+
const pNameList: string[] = [];
|
|
57
|
+
for (const p of pDef.params) {
|
|
58
|
+
pNameList.push(p.name);
|
|
59
|
+
if (Object.hasOwn(ipVal, p.name)) {
|
|
60
|
+
cover += 1;
|
|
61
|
+
if (sParams[pDef.partName][p.name] === ipVal[p.name]) {
|
|
62
|
+
equal += 1;
|
|
63
|
+
} else {
|
|
64
|
+
sParams[pDef.partName][p.name] = ipVal[p.name];
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
uncover += 1;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// backward
|
|
71
|
+
let notInScope = 0;
|
|
72
|
+
for (const pa of Object.keys(ipVal)) {
|
|
73
|
+
if (!pNameList.includes(pa)) {
|
|
74
|
+
notInScope += 1;
|
|
75
|
+
rMsg += `warn363: parameter ${pa} not in the scope of the design (${notInScope})\n`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const applyWarn2 = notInScope > 0 ? true : false;
|
|
79
|
+
const loadDate = new Date().toLocaleTimeString();
|
|
80
|
+
rMsg += `Params loaded at ${loadDate} :`;
|
|
81
|
+
rMsg += ` def-nb: ${Object.keys(pDef.params).length}`;
|
|
82
|
+
rMsg += `, cover-nb: ${cover}, uncover-nb: ${uncover}\n`;
|
|
83
|
+
rMsg += ` load-nb: ${Object.keys(ipVal).length}`;
|
|
84
|
+
rMsg += `, equal-nb: ${equal}, changed-nb: ${cover - equal}`;
|
|
85
|
+
rMsg += `, out-of-scope: ${notInScope}`;
|
|
86
|
+
const rApplyWarn = applyWarn1 || applyWarn2;
|
|
87
|
+
return [rMsg, rApplyWarn];
|
|
88
|
+
}
|
|
89
|
+
function initParams2() {
|
|
90
|
+
if (browser) {
|
|
91
|
+
const searchParams = new URLSearchParams($page.url.search);
|
|
92
|
+
const pVal2: tParamVal = {};
|
|
93
|
+
for (const [kk, vv] of searchParams) {
|
|
94
|
+
//console.log(`dbg638: ${kk} ${vv}`);
|
|
95
|
+
const vvn = Number(vv);
|
|
96
|
+
if (!isNaN(vvn)) {
|
|
97
|
+
pVal2[kk] = vvn;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//console.log(`dbg072: pVal2.length ${Object.keys(pVal2).length}`);
|
|
101
|
+
if (Object.keys(pVal2).length > 0) {
|
|
102
|
+
[loadMsg, applyWarn] = tolerantApply(pDef.partName, pVal2);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// initiatlization
|
|
107
|
+
initParams2();
|
|
108
|
+
|
|
109
|
+
// actions
|
|
110
|
+
function loadParams(iStr: string) {
|
|
111
|
+
try {
|
|
112
|
+
const [paramJson] = parseParamFile(iStr);
|
|
113
|
+
[loadMsg, applyWarn] = tolerantApply(paramJson.partName, paramJson.pVal);
|
|
114
|
+
inputComment = paramJson.comment;
|
|
115
|
+
} catch (emsg) {
|
|
116
|
+
let errMsg = 'err723: error by parsing parameter file\n';
|
|
117
|
+
errMsg += emsg as string;
|
|
118
|
+
loadMsg = errMsg;
|
|
119
|
+
applyWarn = true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// load from file
|
|
123
|
+
async function loadFile(fileP: File) {
|
|
124
|
+
const fText = await fileP.text();
|
|
125
|
+
loadParams(fText);
|
|
126
|
+
}
|
|
127
|
+
function loadParamFromFile(eve: Event) {
|
|
128
|
+
if (eve.target) {
|
|
129
|
+
type tEveFileList = FileList | null;
|
|
130
|
+
const paramFiles: tEveFileList = (eve.target as HTMLInputElement).files;
|
|
131
|
+
if (paramFiles) {
|
|
132
|
+
loadFile(paramFiles[0]);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// download parameters
|
|
137
|
+
function downloadParams2() {
|
|
138
|
+
downloadParams(pDef.partName, sParams[pDef.partName], inputComment);
|
|
139
|
+
}
|
|
140
|
+
// modal
|
|
141
|
+
function loadDefaults() {
|
|
142
|
+
const pInit: tParamVal = {};
|
|
143
|
+
for (const p of pDef.params) {
|
|
144
|
+
pInit[p.name] = p.init;
|
|
145
|
+
}
|
|
146
|
+
[loadMsg, applyWarn] = tolerantApply(pDef.partName, pInit);
|
|
147
|
+
}
|
|
148
|
+
// load parameters from localStorage
|
|
149
|
+
function loadLocStor() {
|
|
150
|
+
if (locStorRname !== undefined && locStorRname !== '') {
|
|
151
|
+
const storeKey = `${pDef.partName}_${locStorRname}`;
|
|
152
|
+
//console.log(`load from localStorage ${storeKey}`);
|
|
153
|
+
if (browser) {
|
|
154
|
+
const storeStr = window.localStorage.getItem(storeKey);
|
|
155
|
+
if (storeStr === null) {
|
|
156
|
+
loadMsg = `Warn157: localStorage key ${storeKey} is null`;
|
|
157
|
+
applyWarn = true;
|
|
158
|
+
} else {
|
|
159
|
+
loadParams(storeStr);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
} else {
|
|
163
|
+
loadMsg = 'Warn239: No valid name for loading from localStorage!';
|
|
164
|
+
applyWarn = true;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
// save parameters into localStorage
|
|
168
|
+
//$: console.log(`dbg888: ${locStorWname}`);
|
|
169
|
+
function saveInLocStor() {
|
|
170
|
+
if (locStorWname !== undefined && locStorWname !== '') {
|
|
171
|
+
const storeKey = `${pDef.partName}_${locStorWname}`;
|
|
172
|
+
const re2 = /\..*$/;
|
|
173
|
+
const lastModif = new Date().toISOString().replace(re2, '');
|
|
174
|
+
const storeAllStr = createParamFile(
|
|
175
|
+
lastModif,
|
|
176
|
+
pDef.partName,
|
|
177
|
+
sParams[pDef.partName],
|
|
178
|
+
inputComment
|
|
179
|
+
);
|
|
180
|
+
//console.log(`save in localStorage ${storeKey}`);
|
|
181
|
+
if (browser) {
|
|
182
|
+
window.localStorage.setItem(storeKey, storeAllStr);
|
|
183
|
+
}
|
|
184
|
+
} else {
|
|
185
|
+
console.log('Warn639: No valid name for writing to localStorage!');
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// Save as URL
|
|
189
|
+
function generateUrl2(): string {
|
|
190
|
+
const url1 = generateUrl($page.url.href, sParams[pDef.partName], false);
|
|
191
|
+
return url1.toString();
|
|
192
|
+
}
|
|
193
|
+
function openModalUrl() {
|
|
194
|
+
pUrl = generateUrl2();
|
|
195
|
+
modalSaveUrl = true;
|
|
196
|
+
}
|
|
197
|
+
function saveAsUrl() {
|
|
198
|
+
//console.log(`dbg244: voila`);
|
|
199
|
+
}
|
|
200
|
+
// parameter picture
|
|
201
|
+
function checkPict(keyName: string): string {
|
|
202
|
+
let rSvgPath = `${base}/pgdsvg/default_param_blank.svg`;
|
|
203
|
+
// convention for the file-names of the parameter description
|
|
204
|
+
//paramSvg = `${base}/pgdsvg/${pDef.partName}_${keyName}.svg`;
|
|
205
|
+
if (Object.keys(pDef.paramSvg).includes(keyName)) {
|
|
206
|
+
rSvgPath = `${base}/pgdsvg/${pDef.paramSvg[keyName]}`;
|
|
207
|
+
}
|
|
208
|
+
return rSvgPath;
|
|
209
|
+
}
|
|
210
|
+
function paramPict(keyName: string) {
|
|
211
|
+
paramSvg = checkPict(keyName);
|
|
212
|
+
}
|
|
213
|
+
function showSvg() {
|
|
214
|
+
//console.log(`dbg231: svgPath: ${svgPath}`);
|
|
215
|
+
modalImg = true;
|
|
216
|
+
}
|
|
217
|
+
// hierarchical table
|
|
218
|
+
interface tHTableSection {
|
|
219
|
+
sectionName: string;
|
|
220
|
+
sectionID: string;
|
|
221
|
+
sectionVisible: boolean;
|
|
222
|
+
params: tParam[];
|
|
223
|
+
}
|
|
224
|
+
function makeHTable(iParams: tParam[]): tHTableSection[] {
|
|
225
|
+
const rHTable: tHTableSection[] = [];
|
|
226
|
+
const sectionMain: tHTableSection = {
|
|
227
|
+
sectionName: 'main',
|
|
228
|
+
sectionID: 'g0main',
|
|
229
|
+
sectionVisible: false,
|
|
230
|
+
params: []
|
|
231
|
+
};
|
|
232
|
+
let section = sectionMain;
|
|
233
|
+
let sectionID = 0;
|
|
234
|
+
for (const param of iParams) {
|
|
235
|
+
if (param.pType === PType.eSectionSeparator) {
|
|
236
|
+
rHTable.push(section);
|
|
237
|
+
sectionID += 1;
|
|
238
|
+
const sectionNew: tHTableSection = {
|
|
239
|
+
sectionName: param.name,
|
|
240
|
+
sectionID: `g${sectionID}${param.name}`,
|
|
241
|
+
sectionVisible: true,
|
|
242
|
+
params: []
|
|
243
|
+
};
|
|
244
|
+
section = sectionNew;
|
|
245
|
+
} else {
|
|
246
|
+
section.params.push(param);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
rHTable.push(section);
|
|
250
|
+
return rHTable;
|
|
251
|
+
}
|
|
252
|
+
function makeHTableVis(iHTable: tHTableSection[]): tHTableVis {
|
|
253
|
+
const rVis: tHTableVis = {};
|
|
254
|
+
for (const section of iHTable) {
|
|
255
|
+
rVis[section.sectionID] = section.sectionVisible;
|
|
256
|
+
}
|
|
257
|
+
return rVis;
|
|
258
|
+
}
|
|
259
|
+
let htable: tHTableSection[] = $derived(makeHTable(pDef.params));
|
|
260
|
+
// actions
|
|
261
|
+
function sizeSmall() {
|
|
262
|
+
hideColumn = true;
|
|
263
|
+
}
|
|
264
|
+
function sizeBig() {
|
|
265
|
+
hideColumn = false;
|
|
266
|
+
}
|
|
267
|
+
let dColspanHide1: number = $derived(hideColumn ? 2 : 4);
|
|
268
|
+
let dColspanHide2: number = $derived(hideColumn ? 2 : 3);
|
|
269
|
+
let dCommentSize: number = $derived(hideColumn ? 50 : 70);
|
|
245
270
|
</script>
|
|
246
271
|
|
|
247
272
|
<section>
|
|
@@ -252,15 +277,15 @@ $: {
|
|
|
252
277
|
id="loadFParams"
|
|
253
278
|
type="file"
|
|
254
279
|
accept="text/plain, application/json"
|
|
255
|
-
|
|
280
|
+
onchange={loadParamFromFile}
|
|
256
281
|
/>
|
|
257
282
|
<button
|
|
258
|
-
|
|
283
|
+
onclick={() => {
|
|
259
284
|
modalLoadDefault = true;
|
|
260
285
|
}}>Set Params Default</button
|
|
261
286
|
>
|
|
262
287
|
<button
|
|
263
|
-
|
|
288
|
+
onclick={() => {
|
|
264
289
|
modalLoadLocal = true;
|
|
265
290
|
}}>Load Params from localStorage</button
|
|
266
291
|
>
|
|
@@ -276,69 +301,75 @@ $: {
|
|
|
276
301
|
rows="3"
|
|
277
302
|
cols="80"
|
|
278
303
|
readonly
|
|
279
|
-
wrap="
|
|
304
|
+
wrap="soft"
|
|
280
305
|
value={loadMsg}
|
|
281
306
|
class:colorWarn={applyWarn}
|
|
282
|
-
|
|
307
|
+
></textarea>
|
|
283
308
|
<table>
|
|
284
309
|
<thead>
|
|
285
310
|
<tr>
|
|
286
311
|
<td>#</td>
|
|
287
312
|
<td>Parameter name</td>
|
|
288
|
-
<td
|
|
289
|
-
|
|
290
|
-
|
|
313
|
+
<td
|
|
314
|
+
>Value<span
|
|
315
|
+
><button onclick={sizeSmall}>−</button><button onclick={sizeBig}
|
|
316
|
+
>+</button
|
|
317
|
+
></span
|
|
318
|
+
></td
|
|
319
|
+
>
|
|
320
|
+
<td class:hideColumn>Unit</td>
|
|
321
|
+
<td class:hideColumn>Default</td>
|
|
291
322
|
<td>Min</td>
|
|
292
323
|
<td>Max</td>
|
|
293
|
-
<td>Step</td>
|
|
324
|
+
<td class:hideColumn>Step</td>
|
|
294
325
|
</tr>
|
|
295
326
|
</thead>
|
|
296
327
|
{#each htable as sect, sidx}
|
|
297
|
-
<
|
|
298
|
-
<
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
<
|
|
302
|
-
<
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
328
|
+
<tbody>
|
|
329
|
+
<tr class="separator">
|
|
330
|
+
<td>{sidx + 1}</td>
|
|
331
|
+
<td colspan={dColspanHide1}>{sect.sectionName}</td>
|
|
332
|
+
<td colspan={dColspanHide2}>
|
|
333
|
+
<label>
|
|
334
|
+
<input type="checkbox" bind:checked={htableVis[sect.sectionID]} />
|
|
335
|
+
<span> </span></label
|
|
336
|
+
>
|
|
337
|
+
</td>
|
|
338
|
+
</tr>
|
|
339
|
+
</tbody>
|
|
307
340
|
<tbody class:collaps={htableVis[sect.sectionID]}>
|
|
308
341
|
{#each sect.params as param, pidx}
|
|
309
|
-
<tr class:changed={
|
|
342
|
+
<tr class:changed={sParams[pDef.partName][param.name] !== param.init}>
|
|
310
343
|
<td>{sidx + 1}.{pidx + 1}</td>
|
|
311
344
|
<td
|
|
312
|
-
><button
|
|
345
|
+
><button onclick={() => paramPict(param.name)}>{param.name}</button
|
|
313
346
|
></td
|
|
314
347
|
>
|
|
315
348
|
<td>
|
|
316
349
|
{#if param.pType === PType.eNumber}
|
|
317
350
|
<input
|
|
318
351
|
type="number"
|
|
319
|
-
bind:value={
|
|
352
|
+
bind:value={sParams[pDef.partName][param.name]}
|
|
320
353
|
min={param.min}
|
|
321
354
|
max={param.max}
|
|
322
355
|
step={param.step}
|
|
323
|
-
on:change={paramChange}
|
|
324
356
|
class="input-number"
|
|
325
357
|
/>
|
|
326
358
|
<input
|
|
327
359
|
type="range"
|
|
328
|
-
bind:value={
|
|
360
|
+
bind:value={sParams[pDef.partName][param.name]}
|
|
329
361
|
min={param.min}
|
|
330
362
|
max={param.max}
|
|
331
363
|
step={param.step}
|
|
332
|
-
on:change={paramChange}
|
|
333
364
|
/>
|
|
334
365
|
{:else if param.pType === PType.eCheckbox}
|
|
335
|
-
<select bind:value={
|
|
366
|
+
<select bind:value={sParams[pDef.partName][param.name]}>
|
|
336
367
|
{#each ['Off', 'On'] as one, idx}
|
|
337
368
|
<option value={idx}>{one}</option>
|
|
338
369
|
{/each}
|
|
339
370
|
</select>
|
|
340
371
|
{:else if param.pType === PType.eDropdown}
|
|
341
|
-
<select bind:value={
|
|
372
|
+
<select bind:value={sParams[pDef.partName][param.name]}>
|
|
342
373
|
{#each param.dropdown as one, idx}
|
|
343
374
|
<option value={idx}>{one}</option>
|
|
344
375
|
{/each}
|
|
@@ -347,11 +378,11 @@ $: {
|
|
|
347
378
|
unknown
|
|
348
379
|
{/if}
|
|
349
380
|
</td>
|
|
350
|
-
<td>{param.unit}</td>
|
|
351
|
-
<td>{param.init}</td>
|
|
381
|
+
<td class:hideColumn>{param.unit}</td>
|
|
382
|
+
<td class:hideColumn>{param.init}</td>
|
|
352
383
|
<td>{param.min}</td>
|
|
353
384
|
<td>{param.max}</td>
|
|
354
|
-
<td>{param.step}</td>
|
|
385
|
+
<td class:hideColumn>{param.step}</td>
|
|
355
386
|
</tr>
|
|
356
387
|
{/each}
|
|
357
388
|
</tbody>
|
|
@@ -359,12 +390,18 @@ $: {
|
|
|
359
390
|
</table>
|
|
360
391
|
<div class="comment">
|
|
361
392
|
<label for="inComment">Comment:</label>
|
|
362
|
-
<input
|
|
393
|
+
<input
|
|
394
|
+
type="text"
|
|
395
|
+
id="inComment"
|
|
396
|
+
bind:value={inputComment}
|
|
397
|
+
maxlength="150"
|
|
398
|
+
size={dCommentSize}
|
|
399
|
+
/>
|
|
363
400
|
</div>
|
|
364
|
-
<button
|
|
365
|
-
<button
|
|
401
|
+
<button onclick={downloadParams2}>Save Parameters to File</button>
|
|
402
|
+
<button onclick={openModalUrl}>Save Parameters as URL</button>
|
|
366
403
|
<button
|
|
367
|
-
|
|
404
|
+
onclick={() => {
|
|
368
405
|
modalSaveLocal = true;
|
|
369
406
|
}}>Save Parameters to localStorage</button
|
|
370
407
|
>
|
|
@@ -380,14 +417,14 @@ $: {
|
|
|
380
417
|
>
|
|
381
418
|
</main>
|
|
382
419
|
<ModalImg bind:modalOpen={modalImg} svgPath={paramSvg} />
|
|
383
|
-
<button
|
|
420
|
+
<button onclick={showSvg} class="side-img">
|
|
384
421
|
<img src={paramSvg} alt={paramSvg} />
|
|
385
422
|
</button>
|
|
386
423
|
<div class="mini-canvas">
|
|
387
|
-
<SimpleDrawing
|
|
424
|
+
<SimpleDrawing {pFig} full={true} />
|
|
388
425
|
</div>
|
|
389
426
|
<div class="mini-canvas">
|
|
390
|
-
<SimpleDrawing
|
|
427
|
+
<SimpleDrawing {pFig} full={false} />
|
|
391
428
|
</div>
|
|
392
429
|
</section>
|
|
393
430
|
|
|
@@ -451,6 +488,20 @@ section > main > table > thead {
|
|
|
451
488
|
background-color: #ddd;
|
|
452
489
|
}
|
|
453
490
|
|
|
491
|
+
section > main > table > thead > tr > td > span {
|
|
492
|
+
margin-left: 5rem;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
section > main > table > thead > tr > td > span > button {
|
|
496
|
+
border: 0;
|
|
497
|
+
padding-left: 1rem;
|
|
498
|
+
padding-right: 1rem;
|
|
499
|
+
border-radius: 30%;
|
|
500
|
+
font-weight: 700;
|
|
501
|
+
color: Blue;
|
|
502
|
+
background-color: LightBlue;
|
|
503
|
+
}
|
|
504
|
+
|
|
454
505
|
section > main > table > tbody {
|
|
455
506
|
background-color: #eee;
|
|
456
507
|
}
|
|
@@ -463,7 +514,7 @@ section > main > table > tbody > tr.changed {
|
|
|
463
514
|
background-color: #ded;
|
|
464
515
|
}
|
|
465
516
|
|
|
466
|
-
section > main > table > tr.separator {
|
|
517
|
+
section > main > table > tbody > tr.separator {
|
|
467
518
|
font-weight: 700;
|
|
468
519
|
background-color: Tan;
|
|
469
520
|
}
|
|
@@ -507,7 +558,6 @@ tr.separator > td > label > input[type=checkbox]:checked + span::after {
|
|
|
507
558
|
}
|
|
508
559
|
|
|
509
560
|
section > main > table > thead > tr > td,
|
|
510
|
-
section > main > table > tr > td,
|
|
511
561
|
section > main > table > tbody > tr > td {
|
|
512
562
|
padding-left: 0.4rem;
|
|
513
563
|
padding-right: 0.4rem;
|
|
@@ -527,6 +577,11 @@ section > main > table > tbody > tr > td > input.input-number {
|
|
|
527
577
|
width: 5rem;
|
|
528
578
|
}
|
|
529
579
|
|
|
580
|
+
section > main > table > thead > tr > td.hideColumn,
|
|
581
|
+
section > main > table > tbody > tr > td.hideColumn {
|
|
582
|
+
display: none;
|
|
583
|
+
}
|
|
584
|
+
|
|
530
585
|
section > main > div.comment {
|
|
531
586
|
font-size: 0.8rem;
|
|
532
587
|
margin-left: 0.5rem;
|