Ability to 'don't export' events

What do you want to achieve?

I’d like the ability for my UI engineer to setup events in SquareLine that are not exported into the product code.

Mention some use cases

This way, my UI engineer can freely design how the transitions should look, but I can also use function calls to control navigation.

Here’s an example password entry page:

  • In SquareLine simulator, clicking image button moves to the next page in flow. Not exported.
  • When exported, a function call C code checks type of chosen access point, finds password length requirement, compares keyboard text field length with access point requirement, if password is ok move to the next page in flow, otherwise show a helpful error.

Do you see alternative options and workaround to achieve it?

Currently our workflow is:

  1. UI engineer designs nice flow
  2. Firmware engineer(me) replaces screen changes with function calls and error checking
  3. Screen changes no longer work in SquareLine

Hi, thanks for the idea, it’s an interesting concept to make event exporting optional.

While we don’t currently have a “don’t export” option for events, I’d like to suggest a workaround that might help with your workflow.

Try adding a call function action before the screen change event. In this function, you can determine when the screen change function should actually run:

Add a custom function call that runs before your screen transition
Implement your password validation logic in this function
Have this function return a value that determines whether the screen change should proceed

I’m not exactly sure how you’re using the call function and what your project structure looks like, but this might be a solution for you.

Try adding a call function action before the screen change event. In this function, you can determine when the screen change function should actually run:
Add a custom function call that runs before your screen transition
Implement your password validation logic in this function
Have this function return a value that determines whether the screen change should proceed

I’m not sure I understand how this would work. Currently the custom function-call event handlers have a void return type. I think SquareLine would need to emit some logic to call the custom function, then check what it returned before the screen change.

I did have another idea - does SquareLine studio use the _events.py file? If so, perhaps I could put an unconditional screen change in the Python event handler, and keep a conditional screen change in the C event handler?