![]() |
reactor-c 1.0
C Runtime for Lingua Franca
|
Simple terminal-based user interface based on ncurses. More...
Go to the source code of this file.
Functions | |
| void | end_sensor_simulator () |
| End ncurses control of the terminal. | |
| int | register_sensor_key (char key, void *action) |
| Register a keyboard key to trigger the specified action. | |
| void | show_tick (const char *character) |
| Place a tick (usually a single character) in the tick window. | |
| int | start_sensor_simulator (const char *message_lines[], int number_of_lines, int tick_window_width, char *log_file, int log_level) |
| Start the sensor simulator if it has not been already started. | |
Simple terminal-based user interface based on ncurses.
When prototyping Lingua Franca programs on a laptop, it is convenient to use the laptop keyboard to simulate asynchronous sensor input. This small library provides a convenient way to do that.
To use this, include the following flags in your target properties:
This requires ncurses, a library providing somewhat portable keyboard access.
In addition, you need this in your Lingua Franca file:
To start the sensor simulator, call start_sensor_simulator passing it an array of strings to print and the width of the window to use to display characters using the show_tick function.
To print messages to the screen, rather than using printf(), you should use the messaging functions in util.h, such as lf_print(). Otherwise, your messages will be printed over other information.