Conversation
Add defines to test in ide.cpp and main.cpp
Note that unicode is not currently written to JSON
mjprilliman
left a comment
There was a problem hiding this comment.
I like the json formatting of the UI files. How will we diff callback and equation changes in the future? Seems like it might be more difficult as a single string with \n values.
That's a great point. The best recommendation for this seems to be using an array of strings, in which each element of the array is a line: https://stackoverflow.com/a/52557585 If we want to go that route I would recommend completing the review of this format and migrating to that format as a separate issue, so we're a little less locked down on forms changes for the patch. |
| @@ -2348,7 +2347,8 @@ void VarInfo::Write(wxOutputStream &os) | |||
| wxDataOutputStream out(os); | |||
| out.Write8(0xe1); | |||
| // out.Write8(2); | |||
| out.Write8(3); // change to version 3 after wxString "UIObject" field added | |||
| // out.Write8(3); // change to version 3 after wxString "UIObject" field added | |||
| out.Write8(4); // change to version 3 after wxString "UIObject" field added | |||
There was a problem hiding this comment.
Comment doesn't make sense here - what is version 4?
| // Group | ||
| Write_JSON_value(doc, "Group", Group); | ||
| // IndexLabels | ||
| /* Handle multiline equations in IndexLabels |
| // sz_form_tools->Add(new wxButton(this, ID_FORM_LOAD_ALL, "Load all", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT), 0, wxALL | wxEXPAND, 2); | ||
| // sz_form_tools->Add(new wxButton(this, ID_FORM_SAVE_TEXT, "Save text", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT), 0, wxALL | wxEXPAND, 2); | ||
| // sz_form_tools->Add(new wxButton(this, ID_FORM_LOAD_TEXT, "Load text", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT), 0, wxALL | wxEXPAND, 2); | ||
| // sz_form_tools->Add(new wxButton(this, ID_FORM_SAVE_ALL_TEXT, "Save all text", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT), 0, wxALL | wxEXPAND, 2); | ||
| // sz_form_tools->Add(new wxButton(this, ID_FORM_LOAD_ALL_TEXT, "Load all text", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT), 0, wxALL | wxEXPAND, 2); | ||
| //sz_form_tools->Add(new wxButton(this, ID_FORM_LOAD_ALL_TEXT, "Load all text", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT), 0, wxALL | wxEXPAND, 2); |
There was a problem hiding this comment.
Maybe I'm missing something, but why add commented out lines? This is hard to follow with all the commented out code.
There was a problem hiding this comment.
Maybe I'm missing something, but why add commented out lines? This is hard to follow with all the commented out code.
The code is temporarily commented so that when merging into develop, the updated text forms can be loaded and then saved as JSON and then the text UI forms can be removed. The forms in develop have diverged from patch so that a separate pull request is necessary for the SAM repo.
Why am I not seeing these additional buttons when I build the branches? |
Oh, whoops. I had an older version of SAM 504 checked out. |
|
This looks good from the UI. I also tested loading all configs with this LK script: The script works in Windows, but on Linux (Mint 21.1), when I run the script, I get errors like:
But the forms load fine when opening a case by hand, so not sure it's worth pursuing at this stage. |
Maybe we can write a better code versioning system than github that sometimes defaults to date and time changes instead of actually comparing file contents... |
Where are you running SAM from to get this script error? Did you make from the SAM-private build_linux folder and run from the installation folder? I am not seeing this issue on MacOS or on CentOS7. |
There was a problem hiding this comment.
It looks like the updates to the CI script swapped the target branch from patch to develop, that need to be addressed prior to merge.
Also the comment on line 2351 of variables.cpp is referring to the wrong version number.
Other than that, the new code works well for me - thanks for updating the rapid json environment variable!
Reset to single line until JSON Array of strings encodes and decodes correctly.
|
@brtietz , @mjprilliman , @cpaulgilman the multiline string saving for equations and callbacks has been implemented in this pull request and in wex pull request 155. An example of changing AA Widgets callback line 36 from x=0; to y=0; Please recheck this pull request along with wex 155 and let me know if you run into any issues. |
|
Arrays should work now with the two str replace…. Both objects and arrays
had the same escaping sequence issue.
I can make the change and test new lines and update the pull request.
…On Thu, Feb 2, 2023 at 10:02 AM Brian Mirletz ***@***.***> wrote:
The diff for changing lines looks great. The diff for adding a new line,
however, is quite messy:
[image: image]
<https://user-images.githubusercontent.com/5530592/216391880-46013a91-cc5b-4c1f-a601-0a2de8f85550.png>
Is there a reason it has to be an object with line numbers as opposed to
an array?
—
Reply to this email directly, view it on GitHub
<#1338 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRSQBYHDFW4DFLKPI5OVJLWVPSD7ANCNFSM6AAAAAAULAHD64>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|







goes with associated pull requests in wex 155 and SAM-private