V1.4 - A nasty surprise for the unsuspecting

  • SquareLine Studio version: 1.4
  • Operating system: MacOS
  • Target hardware: N/A

Like many, I have always exported the UI files directly into the sketch folder where the main .ino sketch lives. This makes it easy to update the UI, export and then immediately do a compile in the Arduino IDE.

But in an attempt to clean up old files, SLS 1.4 deletes every file in the export directory before exporting the new files. What a surprise when I modifiied code in my main sketch, only to find the new sketch wiped out when I subsequently exported the UI from SLS.

One way around this is to always export the UI files to another directory and then copy the files into the main sketch folder. An unwelcomed extra step in the workflow.

The other way is the revert to SLS v1.3.4. That is what I am choosing to do for now.

Good to know itā€™s more convenient for you and others to have the exported UI files of ā€˜uiā€™ folder directly in the sketch folder. But yes, SquareLine Studio 1.4.0 now deletes the contents of the UI folder selectively (leaving e.g. ui_events.c) before exporting the UI to ensure there are no residues left which could cause compile errors (I see your comments in the corresponding topic: SLS exports a deleted screen and breaks compilation ). The UI files are in the ā€˜uiā€™ folder for a reason, not to coincide with your project files using them. Probably thereā€™s a way to determine for sure which files are residues of deleted screens/etc. and which are your own code, but in SquareLine Studio there doesnā€™t seem to be a handling for this scenario currently. Anyway, thanks for the feedback, this feature request gives a material for further discussions.

Iā€™ve gone back to V1.4 to give it a second try.

I think that having it export into a separate directory probably isnā€™t a bad idea after all. While this is an extra step in my former workflow, I can see certain advantages now.

Thanks for your reply and thoughts.

1 Like

Hi, in 1.3.4 when check the option dont export ā€œCall functions export fileā€ the ui_events.cpp, dont export. but dont delete it, on 1.4.0 delete the file, please can you recover the last export type on next version 1.4.1.

Thanks

Not sure I get every details of what you mean. Could you please rephrase it?

When Export UI Files, in Project settings, if option ā€œCall functions export fileā€ is mark with ā€œdont exportā€, dont export file ui_event.cpp, but if exist, is deleted, this is the problem.

Hermit, did you see the issue?

I reproduced what you mean. The ui_events.c/.cpp file gets deleted when you press ā€˜Create Template Projectā€™ menupoint, but not deleted when you press only ā€˜Export UI Filesā€™ menupoint. I guess itā€™s the intended operation in SquareLine Studio 1.4 because it now deletes unnecessary files or residues of previous exports (as it was requested several times.) Maybe a filter to check if it contains custom code, and not deleting if it is, would be more adequate working in your case. Iā€™ll ask about this from the responsible staff.

This is also causing me problemsā€¦ I think is nice to have the ui files in a seperate folder, it makes things more organised. But how would you include this folder in the main sketch? Iā€™m getting errors when I compile the code, that I have ā€œUndefined references to ā€¦ā€ and I know is due to the seperate ui folder that I created.

Iā€™m using Arduino IDE. I have also changed the ui.h file in the main sketch so it is pointing to the right location. But Iā€™m still getting errors.

@subzero89ā€¦
I have opted to do it the Neanderthal wayā€¦ copy the newly generated UI files from the UI folder into the main sketch folder. One can always write a script to make it a one-click procedure.