thegrumpys / odop

Open Design Optimization Platform (ODOP) - Coil spring design app; mechanical springs; compression spring, extension spring, torsion spring
https://www.springdesignsoftware.org
MIT License
4 stars 5 forks source link

Add Search & Seek in SymbolValue and SymbolValueWireDia Components #809

Closed 1fifoto closed 1 year ago

1fifoto commented 1 year ago

It is believed that adding Search & Seek in SymbolValue and SymbolValueWireDia Components will encourage users to repeatedly invoke Search on an incremental basis as new values are entered. Hopefully, this will highlight the point at which constraints are first violated and / or an over-specified design situation is first encountered. Highlighting these issues sooner should reduce the potential distraction of values that have not yet been entered, thus improving the troubleshooting process.

grumpyinca commented 1 year ago

Feedback from initial testing of the current state of this branch

  1. SymbolValueWireDia does not yet have the changes to get the new "button treatment"
  2. The modal correctly drops after a Seek. It should drop after a Search with feasible result as well.
  3. "Stgatus" should go back to "Status"
  4. Seek button should not appear for Calc Inputs.
  5. Perhaps it is possible to improve the usage logging. It would be nice to discriminate searches that start from the modal dialog from those that are started from the main page button. Currently, a Seek started from the modal dialog produces a log entry: "{"tag":"event","action":"ActionSeek","note":{"event_value":9,"event_label":"Button MIN undefined"}}". Currently, use of the modal dialog's Reset button does not seem to produce a log entry.
  6. Perhaps an info icon that appears somewhere in the result panel only when "NOT FEASIBLE" is displayed would be helpful. The text of the tooltip could say something like "This design may be over-specified" and then direct users to improved versions of the existing Help topics on Feasibility, Design Situations, Spring Design Technique and Hints, Tricks & Tips.
  7. The linked Help article (settingValues.html) needs a significant update before release.
  8. Note #802. As a "nice to have", perhaps disabled Seek buttons could get situation-specific tooltips (no tooltip for enabled Seek buttons). The tool-tips might say things like:
    • "Seek is disabled because (variable name) is in Fixed status." or
    • "Seek is disabled because additional Fixes and constraints specific to your application are required in order to obtain meaningful results"

None of these items blocks further testing.

1fifoto commented 1 year ago

Item 2 Done. Item 3 Done. item 4 Done - Feasibility Indicator, Search Button and Seek Button do not appear for Calc Inputs. Item 5 Done - Log entries are now "ActionSearch Element ", "ActionSeek Element MIN", or "ActionSeek Element MAX". Fixed the "undefined" bug. Item 6 Done. But links in a tooltip cannot be selected. Screenshot 2023-01-31 at 12 50 10 PM

Skipped 1, 7 and 8 - to discuss.

grumpyinca commented 1 year ago

Feedback from next round testing of the current state of this branch

The Reset button is not restoring constraints properly. Example:

  1. Start from initialState
  2. Menu : View : Calculator
  3. Click in FS_2
  4. Observe that FS_2 Max is 1.5
  5. Change the value of FS_2 Min to 1.03 (any value will do)
  6. Click Reset
  7. Observe that the value of FS_2 Max has become 1.02 <--- This is the bug !
grumpyinca commented 1 year ago

Discussion of entry 8 in Jan 29 comment: Consider: rather than add a tooltip, don't display the Seek button.

grumpyinca commented 1 year ago

Regarding item 6 in the January 29 and January 31, 2023 comments above.

In the ideal case, the round "info" spot and its associated tooltip would be limited to appear only immediately after a search that produces a "NOT FEASIBLE" result. It would clear at the same time that the termination message is cleared.

If restricting the appearance of the "info" spot and its associated tooltip in this way provides implementation challenges, a compromise might involve suppressing it when "NOT FEASIBLE" and the termination message is empty (null, blank).

grumpyinca commented 1 year ago

Current version test results:

The exact sequence is not well documented. Clicked something (Reset?) and got traceback in red:

Error: In reducers.RESTORE_OUTPUT_SYMBOL_CONSTRAINTS, No old value exists for restore
(anonymous function)
C:/Users/Mike/git/odop/client/src/store/reducers.js:268
  265 |             smax: sclden(state.model.system_controls, element.value, cmax, element.sdlim, lmax)
  266 |         });
  267 |     } else {
> 268 |         throw new Error('In reducers.RESTORE_OUTPUT_SYMBOL_CONSTRAINTS, No old value exists for restore');
      | ^  269 |     }
  270 | }
  271 | return element; 
View compiled

reducers
C:/Users/Mike/git/odop/client/src/store/reducers.js:242
  239 |         return Object.assign({}, state, {
  240 |             model: {
  241 |                 ...state.model,
> 242 |                 symbol_table: state.model.symbol_table.map((element) => {
  243 |                     if (element.name === action.payload.name) {
  244 | //                        console.log('In reducers.RESTORE_OUTPUT_SYMBOL_CONSTRAINTS state=',state,'action=', action);
  245 | //                        console.log('In reducers.RESTORE_OUTPUT_SYMBOL_CONSTRAINTS',
View compiled
dispatch
C:/Users/Mike/git/odop/client/node_modules/redux/es/redux.js:213
(anonymous function)
C:/Users/Mike/git/odop/client/src/store/middleware/dispatcher.js:45
  42 |     var sink;
  43 |     var index;
  44 | 
> 45 |     const returnValue = next(action);
  46 | 
  47 | //    console.log('<li>','In dispatcher state=',store.getState(),'action=',action,'</li>');
  48 | //    if (action.payload === undefined || action.payload.name === undefined) {
View compiled

The last few lines in the usage log are:

6375, 2023-03-06 00:25:41, 2023-03-06 00:25:41, 127.0.0.1, {"tag":"event","action":"ActionSearch","note":{"event_value":21,"event_label":"Element Wire_Dia 66.72 --> 0.1417"}}, , , , 
6376, 2023-03-06 00:27:34, 2023-03-06 00:27:34, 127.0.0.1, {"tag":"event","action":"Values","note":{"event_value":22,"event_label":"Wire_Dia(FixedFlag)=FREE"}}, , , , 
6377, 2023-03-06 00:27:34, 2023-03-06 00:27:34, 127.0.0.1, {"tag":"event","action":"ActionSearch","note":{"event_value":23,"event_label":"Element Wire_Dia 0.1417 --> 0.000009015"}}, , , , 
6378, 2023-03-06 00:27:48, 2023-03-06 00:27:48, 127.0.0.1, {"tag":"event","action":"ActionSeek","note":{"event_value":24,"event_label":"Element Wire_Dia MIN"}}, , , , 
6379, 2023-03-06 00:28:00, 2023-03-06 00:28:00, 127.0.0.1, {"tag":"event","action":"ActionSearch","note":{"event_value":25,"event_label":"Element Wire_Dia 0.00002081 --> 0.000009302"}}, , , , 
6380, 2023-03-06 00:28:44, 2023-03-06 00:28:44, 127.0.0.1, {"tag":"event","action":"ActionSeek","note":{"event_value":26,"event_label":"Element Wire_Dia MIN"}}, , , , 
6381, 2023-03-06 00:29:22, 2023-03-06 00:29:22, 127.0.0.1, {"tag":"event","action":"ActionSearch","note":{"event_value":27,"event_label":"Element Wire_Dia 0.00002888 --> 0.000009710"}}, , , , 
6382, 2023-03-06 00:30:22, 2023-03-06 00:30:22, 127.0.0.1, {"tag":"event","action":"ActionSearch","note":{"event_value":28,"event_label":"Button 28.67 --> 0.1416"}}, , , , 

A subsequent attempt reproduced this failure with a Free Wire_Dia operation (Calculator View) immediately after a reset operation.

See the March 11 comment (below) for a sequence that will reproduce this bug.

grumpyinca commented 1 year ago

Should Search and Seek buttons appear in the "Edit Independent Variable Wire_Dia" modal when the "Select std size" radio button is active ? Having the std size option selected might imply that the results of Search and Seek might be restricted to standard wire sizes. Such a feature is proposed in #825, but is not available in the current code.

grumpyinca commented 1 year ago

There seems to be a recently introduced problem in the way that user input of numeric values is validated. The problem described here does not appear in the 4.3.3 staging system.

  1. Reset the app.
  2. View : Calculator
  3. Click in Wire_Dia input field.
  4. Observe "Edit Independent Variable Wire_Dia" modal appears.
  5. Select "Enter non-std value" radio button
  6. Double click in Wire_Dia input field
  7. Observe that the entire existing value is highlighted.
  8. Enter a decimal point
  9. Observe a single pixel red border
  10. Enter "0" (single digit zero)
  11. Observe that the decimal point disappears. <-- This is the problem.
1fifoto commented 1 year ago

This is a simplified sequence to trigger the bug: (I executed a "Pull" and then re-confirmed that this sequence triggers the bug)

# id,   created_at,             updated_at,         ip_address,     note, tag,      action,                   event_value,    event_label

6777    2023-03-12 00:05:48 2023-03-12 00:05:48 127.0.0.1   {"tag":"event","action":"Routes","note":{"event_value":1,"event_label":"type: null load defaultDesign"}}                

6778    2023-03-12 00:05:56 2023-03-12 00:05:56 127.0.0.1   {"tag":"event","action":"Routes","note":{"event_value":2,"event_label":"type: Spring/Compression name: Startup"}}               

6779    2023-03-12 00:06:26 2023-03-12 00:06:26 127.0.0.1   {"tag":"event","action":"ViewSelect","note":{"event_value":3,"event_label":"Calculator"}}               

***  Reorder start  ***

6781    2023-03-12 00:07:33 2023-03-12 00:07:33 127.0.0.1   {"tag":"event","action":"Values","note":{"event_value":4,"event_label":"
    Wire_Dia(FixedFlag)=AUTOFIXED
    Wire_Dia(TableValue)=0.08"}}                

Close & re-open dialog

6780    2023-03-12 00:07:33 2023-03-12 00:07:33 127.0.0.1   {"tag":"event","action":"ActionSearch","note":{"event_value":5,"event_label":"Element Wire_Dia 12.62 --> 0.000"}}               

***  Reorder finish  ***

6782    2023-03-12 00:08:40 2023-03-12 00:08:40 127.0.0.1   {"tag":"event","action":"Values","note":{"event_value":6,"event_label":"Wire_Dia(TableValue)=0.106"}}               

6783    2023-03-12 00:08:40 2023-03-12 00:08:40 127.0.0.1   {"tag":"event","action":"ActionSearch","note":{"event_value":7,"event_label":"Element Wire_Dia 0.9016 --> 0.000"}}              

Free

Reset

Free 
1fifoto commented 1 year ago

Merged into master, closing