Skip to content

Commit 984b5ef

Browse files
committed
v0.11.09h 2023/09/05
* Added: - LIB: Support for 2 custom list of values of different tolerances - LIB: Can use lower tolerance list, keeping best final tolerance: when lists=2 and valTolBest=1 use baseR2 as 1/10 tolerance than baseR when lists=2 and valTolBest=1 use baseR2 & baseR2 too - LIB: use mem=1 computations with lists=2 to reduce memory requirements - CLI: Support for 2 custom list of values of different tolerances - CLI: new output formatting to show tolerance of each component - CLI: use 80 columns for output formatting - GUI: enlarged to 722 pixels to accomodate 80 cols output formatting - GUI: new widgets to support lists=2, as now partially inactive - LIB: extended support to 8 decades, GUI too - GUI: working Stop button - LIB: reduced memory allocation/compute time for input descriptions: baseR[3+2],mem=0,lists2=2,valTolBest=0: 1.7 kB => 840 B , 0.000704 s => 0.000905 s E1,decades=7,mem=0,lists2=1 : 1.5 kB => 1.5 kB , 0.002569 s => 0.001241 s E12,decades=7,mem=0,lists2=1 : 346.8 kB => 173.4 kB, 42.715295 s => 20.320254 s - LIB: refactored compute functions for mem=1 - LIB: refactored showHelp(), showConf() - GUI: changed radio buttom standardEserie/custom values callbacks: done - GUI: disabled "standard Series" & "Decades" selection when "custom values" - LIB: reSolveConf.txt renamed 'desired=' to 'target=' 'algo=' to 'mem=' 'baseR=' to 'userR=' 'baseRdesc=' to 'userRdesc=' - LIB: reSolveConf.txt added 'userRtol=' 'lists=' 'userR2=' 'userR2tol=' 'userR2desc=' 'valTolBest=' - LIB: reSolveConf.txt ignore/removed 'listNumber=' 'maxRc=' * Fix: - LIB: fix conversion to eng notation in case: -1000E-09 instead of -1E-06 - LIB: parsing of reSolveConf.txt more robust for duplicates and comments - GUI: target and decades are not updated on direct type
1 parent 352b422 commit 984b5ef

File tree

13 files changed

+1335
-732
lines changed

13 files changed

+1335
-732
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,17 +365,20 @@ v0.10.09h 2023/05/30
365365
- GUI: add some hints popup
366366
- GUI: working About button, thanks @lb90
367367

368-
v0.11.09h 2023/08/29
368+
v0.11.09h 2023/09/05
369369
* Added:
370370
- LIB: Support for 2 custom list of values of different tolerances
371371
- LIB: Can use lower tolerance list, keeping best final tolerance:
372372
when lists=2 and valTolBest=1 use baseR2 as 1/10 tolerance than baseR
373373
when lists=2 and valTolBest=1 use baseR2 & baseR2 too
374374
- LIB: use mem=1 computations with lists=2 to reduce memory requirements
375+
- CLI: Support for 2 custom list of values of different tolerances
375376
- CLI: new output formatting to show tolerance of each component
376377
- CLI: use 80 columns for output formatting
377378
- GUI: enlarged to 722 pixels to accomodate 80 cols output formatting
379+
- GUI: new widgets to support lists=2, as now partially inactive
378380
- LIB: extended support to 8 decades, GUI too
381+
- GUI: working Stop button
379382
- LIB: reduced memory allocation/compute time for input descriptions:
380383
baseR[3+2],mem=0,lists2=2,valTolBest=0: 1.7 kB => 840 B , 0.000704 s => 0.000905 s
381384
E1,decades=7,mem=0,lists2=1 : 1.5 kB => 1.5 kB , 0.002569 s => 0.001241 s
@@ -399,6 +402,7 @@ v0.11.09h 2023/08/29
399402
* Fix:
400403
- LIB: fix conversion to eng notation in case: -1000E-09 instead of -1E-06
401404
- LIB: parsing of reSolveConf.txt more robust for duplicates and comments
405+
- GUI: target and decades are not updated on direct type
402406

403407
ToDo:
404408
-----
@@ -428,7 +432,6 @@ ToDo:
428432
- LIB: show only one qs=0%,100% when algo=1 and Rp=2
429433
- CLI: add parameters to set Eseries and decades
430434
- GUI: better parameters checking: custom formula
431-
- GUI: working Stop button
432435
- GUI: better circuit images
433436
- GUI: show best results value in circuit
434437

reSolve.glade

Lines changed: 316 additions & 58 deletions
Large diffs are not rendered by default.

reSolveConf.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Eserie=96 ; Exx: Serie E1, E3, E6, E12, E24, E48, E96 or E192
2323
; 48 @2% tolerance
2424
; 96 @1% tolerance
2525
; 192 @0.5% (and 0.1%) tolerance
26-
decades=7 ; number of decades of interest, normally 6 or 7
26+
decades=8 ; number of decades of interest, normally 6 or 7
2727
; not used when Eserie=0
2828
userR={ 10, 11, 12.1, 13.3, 14.7, 16.2, 17.8, 19.6, 21.5, 23.7, 26.1, 28.7, 31.6, 34.8, 38.3, 42.2, 46.4, 51.1, 56.2, 61.9, 68.1, 75, 82.5, 90.9, 100, 110, 121, 133, 147, 162, 178, 196, 215, 237, 261, 287, 316, 348, 383, 422, 464, 511, 562, 619, 681, 750, 825, 909, 1000, 1100, 1210, 1330, 1470, 1620, 1780, 1960, 2150, 2370, 2610, 2870, 3160, 3480, 3830, 4220, 4640, 5110, 5620, 6190, 6810, 7500, 8250, 9090, 10000, 11000, 12100, 13300, 14700, 16200, 17800, 19600, 21500, 23700, 26100, 28700, 31600, 34800, 38300, 42200, 46400, 51100, 56200, 61900, 68100, 75000, 82500, 90900, 100000, 110000, 121000, 133000, 147000, 162000, 178000, 196000, 215000, 237000, 261000, 287000, 316000, 348000, 383000, 422000, 464000, 511000, 562000, 619000, 681000, 750000, 825000, 909000, 1000000, 1100000, 1210000, 1330000, 1470000, 1620000, 1780000, 1960000, 2150000, 2370000, 2610000, 2870000, 3160000, 3480000, 3830000, 4220000, 4640000, 5110000, 5620000, 6190000, 6810000, 7500000, 8250000, 9090000, 10000000, 11000000, 12100000, 13300000, 14700000, 16200000, 17800000, 19600000, 21500000 } ; user list of 153 E48/2 values @1%, 10-22M Ohm
2929
userRtol=1 ; baseR percent tolerance: use 1 for 1% tolerance

reSolveReadme.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,17 +365,20 @@ v0.10.09h 2023/05/30
365365
- GUI: add some hints popup
366366
- GUI: working About button, thanks @lb90
367367

368-
v0.11.09h 2023/08/29
368+
v0.11.09h 2023/09/05
369369
* Added:
370370
- LIB: Support for 2 custom list of values of different tolerances
371371
- LIB: Can use lower tolerance list, keeping best final tolerance:
372372
when lists=2 and valTolBest=1 use baseR2 as 1/10 tolerance than baseR
373373
when lists=2 and valTolBest=1 use baseR2 & baseR2 too
374374
- LIB: use mem=1 computations with lists=2 to reduce memory requirements
375+
- CLI: Support for 2 custom list of values of different tolerances
375376
- CLI: new output formatting to show tolerance of each component
376377
- CLI: use 80 columns for output formatting
377378
- GUI: enlarged to 722 pixels to accomodate 80 cols output formatting
379+
- GUI: new widgets to support lists=2, as now partially inactive
378380
- LIB: extended support to 8 decades, GUI too
381+
- GUI: working Stop button
379382
- LIB: reduced memory allocation/compute time for input descriptions:
380383
baseR[3+2],mem=0,lists2=2,valTolBest=0: 1.7 kB => 840 B , 0.000704 s => 0.000905 s
381384
E1,decades=7,mem=0,lists2=1 : 1.5 kB => 1.5 kB , 0.002569 s => 0.001241 s
@@ -399,6 +402,7 @@ v0.11.09h 2023/08/29
399402
* Fix:
400403
- LIB: fix conversion to eng notation in case: -1000E-09 instead of -1E-06
401404
- LIB: parsing of reSolveConf.txt more robust for duplicates and comments
405+
- GUI: target and decades are not updated on direct type
402406

403407
ToDo:
404408
-----
@@ -428,7 +432,6 @@ ToDo:
428432
- LIB: show only one qs=0%,100% when algo=1 and Rp=2
429433
- CLI: add parameters to set Eseries and decades
430434
- GUI: better parameters checking: custom formula
431-
- GUI: working Stop button
432435
- GUI: better circuit images
433436
- GUI: show best results value in circuit
434437

src/comType.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* ReSolve v0.11.09h 2023/08/29 solve math expressions using discrete values*/
1+
/* ReSolve v0.11.09h 2023/09/05 solve math expressions using discrete values*/
22
/* Copyright 2005-2023 Valerio Messina http://users.iol.it/efa */
33
/* comType.h is part of ReSolve
44
ReSolve is free software: you can redistribute it and/or modify

src/exprParser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* ReSolve v0.11.09h 2023/08/29 solve math expressions using discrete values*/
1+
/* ReSolve v0.11.09h 2023/09/05 solve math expressions using discrete values*/
22
/* Copyright 2005-2023 Valerio Messina http://users.iol.it/efa */
33
/* exprParser.c is part of ReSolve
44
ReSolve is free software: you can redistribute it and/or modify

src/exprParser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* ReSolve v0.11.09h 2023/08/29 solve math expressions using discrete values*/
1+
/* ReSolve v0.11.09h 2023/09/05 solve math expressions using discrete values*/
22
/* Copyright 2005-2023 Valerio Messina http://users.iol.it/efa */
33
/* exprParser.h is part of ReSolve
44
ReSolve is free software: you can redistribute it and/or modify

src/fileIo.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* ReSolve v0.11.09h 2023/08/29 solve math expressions using discrete values*/
1+
/* ReSolve v0.11.09h 2023/09/05 solve math expressions using discrete values*/
22
/* Copyright 2005-2023 Valerio Messina http://users.iol.it/efa */
33
/* fileIo.c is part of ReSolve
44
ReSolve is free software: you can redistribute it and/or modify
@@ -246,7 +246,7 @@ errOk parseConf(char* bufPtr, char* paramPtr, char paramValue[LineLen]) {
246246
//printNchar(bufPtr, 5); printf("\n");
247247
//printNchar(paramPtr, 5); printf("\n");
248248
if (dbgLev>=PRINTDEBUG) printf("%s: look for '%s' len:%u\n", __FUNCTION__, paramPtr, len);
249-
chPtr=bufPtr+1; // the parameter name must not be on first char
249+
chPtr = bufPtr+1; // the parameter name must not be on first char
250250
//printNchar(chPtr, 5); printf("\n");
251251
do {
252252
if (dbgLev>=PRINTDEBUG) if (chPtr!=(bufPtr+1)) printf("%s: search next occurrence of param:'%s'\n", __FUNCTION__, paramPtr);
@@ -257,7 +257,7 @@ errOk parseConf(char* bufPtr, char* paramPtr, char paramValue[LineLen]) {
257257
if (dbgLev>=PRINTERROR) printf("ERROR %s: param:'%s' not found\n", __FUNCTION__, paramPtr);
258258
return ERROR;
259259
}
260-
chPtr=chPos;
260+
chPtr = chPos;
261261
} while (*(chPtr+len)!='=' || *(chPtr-1)!='\n'); // pretend "\nPARAMETER="
262262
//printNchar(chPtr, 10); printf("\n");
263263
chPtr = strstr(chPtr, "="); // find equal of "\nPARAMETER="
@@ -273,13 +273,13 @@ errOk parseConf(char* bufPtr, char* paramPtr, char paramValue[LineLen]) {
273273
if (*(chPtr)=='{') chPtr++;
274274
//if (dbgLev>=PRINTDEBUG) printNchar(chPtr, 7);
275275
chPos = strstr(chPtr, "}");
276-
u32 sizeChr=chPos-chPtr;
276+
u32 sizeChr = chPos-chPtr;
277277
char* vectorChr = malloc(sizeChr+1);
278278
strncpy(vectorChr, chPtr, sizeChr);
279279
*(vectorChr+sizeChr)='\0';
280280
//if (dbgLev>=PRINTDEBUG) printf("vector:'%s'\n", vectorChr);
281281
chPtr = strchr(vectorChr, ',');
282-
u16 size=0; // count how many commas
282+
u16 size = 0; // count how many commas
283283
for (; chPtr; chPtr++) {
284284
size++;
285285
//if (dbgLev>=PRINTDEBUG) printf("size:%u\n", size);
@@ -298,7 +298,7 @@ errOk parseConf(char* bufPtr, char* paramPtr, char paramValue[LineLen]) {
298298
if (chPos==NULL)
299299
strcpy(val, chPtr);
300300
else {
301-
sizeChr=chPos-chPtr;
301+
sizeChr = chPos-chPtr;
302302
strncpy(val, chPtr, sizeChr);
303303
val[sizeChr]='\0';
304304
}
@@ -308,7 +308,7 @@ errOk parseConf(char* bufPtr, char* paramPtr, char paramValue[LineLen]) {
308308
if (dbgLev>=PRINTERROR) printf("ERROR %s: cannot find digits in val='%s'\n", __FUNCTION__, val);
309309
return ERROR;
310310
}
311-
chPtr=chPtr+sizeChr+1;
311+
chPtr = chPtr+sizeChr+1;
312312
}
313313
free(vectorChr);
314314
for (p=0; p<size; p++) {
@@ -349,7 +349,7 @@ errOk parseConf(char* bufPtr, char* paramPtr, char paramValue[LineLen]) {
349349
if (dbgLev>=PRINTDEBUG) printNchar(chPtr, 5); // printf("\n");
350350
chPtr++; // skip =
351351
if (dbgLev>=PRINTDEBUG) printNchar(chPtr, 5); // printf("\n");
352-
for (chPos=chPtr; chPos-chPtr<LineLen; chPos++) {
352+
for (chPos = chPtr; chPos-chPtr<LineLen; chPos++) {
353353
paramValue[chPos-chPtr]=*chPos;
354354
if (*chPos==';' || *chPos==ch || *chPos=='\0') {
355355
paramValue[chPos-chPtr]='\0';

src/fileIo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* ReSolve v0.11.09h 2023/08/29 solve math expressions using discrete values*/
1+
/* ReSolve v0.11.09h 2023/09/05 solve math expressions using discrete values*/
22
/* Copyright 2005-2023 Valerio Messina http://users.iol.it/efa */
33
/* fileIo.h is part of ReSolve
44
ReSolve is free software: you can redistribute it and/or modify

src/reSolveCli.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* ReSolve v0.11.09h 2023/08/29 solve math expressions using discrete values*/
1+
/* ReSolve v0.11.09h 2023/09/05 solve math expressions using discrete values*/
22
/* Copyright 2005-2023 Valerio Messina http://users.iol.it/efa */
33
/* reSolveCli.c is part of ReSolve
44
ReSolve is free software: you can redistribute it and/or modify
@@ -29,7 +29,7 @@ int parCheck(int numPar, char* paramPtr[]) { // check CLI parameters
2929
if (numPar>0) {
3030
if (!strcmp(paramPtr[1],"-h") || !strcmp(paramPtr[1],"--help")) {
3131
showHelp();
32-
baseInit(); // LIB: set internal variables
32+
globalInit(); // LIB: set internal variables
3333
memInpCalc(); // LIB: memory size calculation for input values
3434
memResCalc(); // LIB: calculate the needed memory for results
3535
showConf();
@@ -92,9 +92,9 @@ int parCheck(int numPar, char* paramPtr[]) { // check CLI parameters
9292
int main(int numPar, char* paramPtr[]) { // CLI entry point
9393
int ret;
9494

95-
gui=0; // mean gprintf() do not update GUI
95+
gui = 0; // mean gprintf() do not update GUI
9696
guiUpdateOutPtr = NULL; // no function pointer to guiUpdateOut()
97-
winGuiLoop=1; // Win loop gtk_events_pending/gtk_main_iteration to update GUI
97+
winGuiLoop = 1; // Win loop gtk_events_pending/gtk_main_iteration to update GUI
9898

9999
showHead(); // LIB: show header
100100
chDirBin(paramPtr[0]); // change current working directory to binary path
@@ -109,14 +109,14 @@ int main(int numPar, char* paramPtr[]) { // CLI entry point
109109
numPar = parCheck(numPar, paramPtr); // CLI:
110110
ret = exprCheck(); // LIB: check expression syntax
111111
// 2 - read and set user request
112-
ret = baseInit(); // LIB: set internal variables
112+
ret = globalInit(); // LIB: set internal variables
113113

114114
// 3 - calculate the needed memory
115115
ret = memInpCalc(); // LIB: memory size calculation for input values
116116
ret = memResCalc(); // LIB: calculate the needed memory for results
117117

118118
// 4 - show config values
119-
ret=showConf(); // LIB: show config set
119+
ret = showConf(); // LIB: show config set
120120

121121
printf("\nReSolve ...\n");
122122
// 5 - allocate the memory asking to the OS a malloc()
@@ -132,7 +132,7 @@ int main(int numPar, char* paramPtr[]) { // CLI entry point
132132
return ERROR;
133133
}
134134
char* stringPtr;
135-
stringPtr=siMem(allocatedB);
135+
stringPtr = siMem(allocatedB);
136136
printf("Allocated about %s of total RAM\n", stringPtr);
137137
free(stringPtr);
138138

0 commit comments

Comments
 (0)