Commit Graph
100 Commits
Author SHA1 Message Date
sani7 8efa935754 websocket
move sending broadcasts back to it's own thread
cause it can lock the even loop
2024-08-28 19:10:44 +02:00
sani7 733858af7a websocket
remove connection_lock that was not required
2024-08-28 19:09:55 +02:00
sani7 ffe446d565 test sim
change timer interval in Sim_base constructor
change start value of slider, dial and thermo
add timer logic to make the sim more attractive
2024-08-27 22:28:18 +02:00
sani7 157f9e9491 UI
add getters for min and max in dial slider and thermo
2024-08-27 22:25:45 +02:00
sani7 5d7b184480 b simulators
Add mutex
Add lock guard in invoke_active_simulator
Add lock guard in changed_UI_items
2024-08-27 17:30:11 +02:00
sani7 a329fd3f03 UI
move every from_json over to use at
2024-08-27 17:25:32 +02:00
sani7 e8f9bc20aa bump timer version 2024-08-27 16:55:25 +02:00
sani7 5d8db074de b message parser
fix command parser returning null when sending empty command
2024-08-27 16:42:14 +02:00
sani7 1efd73cfb5 main
change log location
2024-08-27 16:41:41 +02:00
sani7 33add7b306 b UI
fix bugs discovered by tests
2024-08-27 15:20:13 +02:00
sani7 d47510f58f Test
Add extra ui tests
2024-08-27 15:19:57 +02:00
sani7 ebc2a28241 b message parser
move from [id] json lookup to .at(id)
this gives better exception output
2024-08-27 13:30:20 +02:00
sani7 6dca168b71 b message parser
add try catch around command_parser and event_parser
2024-08-27 13:23:02 +02:00
sani7 35d36a675d b simulators
if diff contains multiple changes in the same UI_item it was pushed in multiple times
now we use a set to check if it is already in the changed or not
2024-08-27 12:50:00 +02:00
sani7 bba27d9e86 websocket
reducing cpu % from 12% to 3%
this by adding this_thread sleep for 1ms
and moving sending of data to the process_messages thread
2024-08-27 11:10:47 +02:00
sani7 ec93fd887c test sim
add color map things to test
2024-08-27 11:10:47 +02:00
sani7 47533c3b3d Tests
fix tests
2024-08-27 11:10:47 +02:00
sani7 b06435f557 UI
Add color map to thermo
2024-08-27 11:10:46 +02:00
sani7 1e3d553cdd Bump color lib version 2024-08-27 11:10:46 +02:00
sani7 179752ec06 test sim
add dial and thermo
2024-08-27 11:10:45 +02:00
sani7 da4300e8de UI
Add dial and thermo
2024-08-27 11:10:45 +02:00
sani7 1bbfe5f907 test sim
add slider change cb
2024-08-27 11:10:45 +02:00
sani7 67a3e2536b UI
standardising type name
2024-08-27 11:10:44 +02:00
sani7 f67f241217 b simulators
m_current_simulator now has "" as default
2024-08-27 11:10:44 +02:00
sani7 484bb730a9 websocket
cleaner alog and elog
2024-08-27 11:10:43 +02:00
sani7 93dbf028a1 b simulators
fix for if sim does not exist
2024-08-27 11:10:43 +02:00
sani7 e26d1f39ff bump color lib version 2024-08-27 11:10:43 +02:00
sani7 291fe0b892 main
set log level to trace
2024-08-27 11:10:42 +02:00
sani7 1863d5649e message parser
move event logs from info to debug
2024-08-27 11:10:42 +02:00
sani7 2df1c67a52 b main
sig int handler check if pointer is not null
2024-08-27 11:10:41 +02:00
sani7 7656402ae9 test sim
Add led
2024-08-27 11:10:41 +02:00
sani7 e06007817c UI
Add extra color for led to UI led class
2024-08-27 11:10:41 +02:00
sani7 5a2fb2de22 simulator base
add shutdown and reboot
2024-08-27 11:10:40 +02:00
sani7 edfe0a91e4 Add initial can debugger 2024-08-27 11:10:40 +02:00
sani7 e56fe54853 b message parser
fix core dump when an event is called and no sim is active
2024-08-27 11:10:39 +02:00
sani7 162018b002 main
use global ptr to sims instead of global instance
and init the global ptr in main
2024-08-27 11:10:39 +02:00
sani7 981d101052 message parser
clean up
2024-08-27 11:10:38 +02:00
sani7 04d9957fd0 main
fix ^C being on the same line as the logging
2024-08-27 11:10:38 +02:00
sani7 0566a4045e spdlog in websocket class
better logging for std::cerr
2024-08-27 11:10:38 +02:00
sani7 3f1cf62d5c Start using spdlog library
b CAN
2024-08-27 11:10:37 +02:00
sani7 d24168e5d1 Add logger submodule 2024-08-24 15:21:26 +02:00
sani7 a340889f62 UI
Add textbox
2024-08-24 00:06:56 +02:00
sani7 43793e1065 message parser
reuse type string instead of hard coding the  type
2024-08-23 22:31:11 +02:00
sani7 163b9e2534 UI
Add led element
2024-08-23 22:30:53 +02:00
sani7 7b8a3ccff5 UI
Add enabled and visible to UI_item
2024-08-23 22:28:14 +02:00
sani7 8161d33245 message parser + simulators
better response on commands and UI_changed event
2024-08-23 22:15:23 +02:00
sani7 864f99a359 Rename all member functions from p_ to m_ 2024-08-23 16:11:49 +02:00
sani7 b0b3855c6b bump version of color and timer lib 2024-08-23 16:07:37 +02:00
sani7 b657472d7f test_sim
implement run at startup function
2024-08-23 15:23:22 +02:00
sani7 6c5e31765d sim base
add run at startup function
2024-08-23 15:22:59 +02:00
sani7 20932015bc bump version of color lib 2024-08-23 15:16:53 +02:00
sani7 cd5c2876dd Add test sim 2024-08-23 14:55:06 +02:00
sani7 e66f528bdc b message parser
fix type of value of value_changed event in event parser
2024-08-23 14:53:44 +02:00
sani7 ba3598dac8 websocket
set log levels
2024-08-23 14:33:41 +02:00
sani7 65f7705d1b b message parser
fix bug that magic enum expects a string and crashes when you give it a json object
add stout messages on command and events
2024-08-23 14:23:50 +02:00
sani7 511c6382db websocket
add same check from broadcast
2024-08-23 14:20:35 +02:00
sani7 368c5b04b3 b simulator + websocket
simulator changed_UI_items returning null instead of {}
cleanup of process broadcast discard on empty update
2024-08-23 13:50:34 +02:00
sani7 6185786f61 update protocol
follow update of message parser
2024-08-23 00:48:57 +02:00
sani7 fd160d9143 message parser
add cmd name to response
2024-08-23 00:34:53 +02:00
sani7 88fe68ad33 server
bump magic enum version
2024-08-22 22:57:26 +02:00
sani7 bd9f7e7fe6 CMake
fix dev warning
2024-08-22 22:51:38 +02:00
sani7 6d76d0174c main
implement the message_parser function
2024-08-22 13:58:18 +02:00
sani7 e12263b8d2 message parser
Add magic enum
Add function to parse commands
Add function to parse events
Add function to feed json input to there corresponding parse functions and return there result
2024-08-22 13:57:32 +02:00
sani7 45263970fc protocol
update names to snake case
2024-08-22 13:48:07 +02:00
sani7 81cadfce17 simulators
Add function to retrieve active sim name
2024-08-22 13:47:50 +02:00
sani7 afdba524c2 main
better comment
2024-08-22 13:17:22 +02:00
sani7 f910643e04 simulator_base
add Doxygen documentation for the people using this class
2024-08-22 13:12:22 +02:00
sani7 33eb776c57 simulator_base
Add timer interval as parameter in the constructor
2024-08-22 13:11:42 +02:00
sani7 f4d8246bc8 simulators
change from returning diff to returning a list of ui_elements by extracting the index out of the diff and pushing the item in the list
2024-08-22 12:54:01 +02:00
sani7 4f6b060c54 main
broadcast is now working
2024-08-22 11:20:52 +02:00
sani7 835dc2c0a8 simulators
use diff instead of custom garbage
2024-08-22 11:20:20 +02:00
sani7 619f565480 simulators
use already defined function instead of code duplication
2024-08-22 11:20:03 +02:00
sani7 aed0d52dbd websocket
split broadcast out of message function
2024-08-22 11:19:31 +02:00
sani7 a6ec23fb24 main
add prefix to simulators
2024-08-22 11:06:36 +02:00
sani7 23c5d1df22 Add initial protocol 2024-08-22 10:12:00 +02:00
sani7 1d89d5b1e1 simulators
add changed_ui_items
2024-08-22 10:11:09 +02:00
sani7 aaff6802c3 simulators
change prefix p to m
add list_simulators
2024-08-22 10:10:27 +02:00
sani7 94a5d5c69f sim base
add is_ui_id_unique
implement it in the  add_ui_item function
2024-08-22 10:02:37 +02:00
sani7 afcbc0f231 UI
Add virtual event methods to UI_item and override them in derived class
2024-08-20 00:49:49 +02:00
sani7 7cf109904e Using broadcast server example for server 2024-08-20 00:16:56 +02:00
sani7 bbf434b73e CMake
rename simulators to server
2024-08-20 00:14:09 +02:00
sani7 ca6adcdd29 Format signal handler 2024-08-20 00:13:45 +02:00
sani7 d740d54f86 update on shutdown 2024-08-20 00:13:01 +02:00
sani7 37ee64d3e1 websocket
Move listen to run
2024-08-19 23:05:54 +02:00
sani7 d67108542e Add websocket class 2024-08-19 21:29:22 +02:00
sani7 352f25abe4 Add simulators 2024-08-19 12:22:31 +02:00
sani7 5760a1f97f simulator base
rename
add name getter
2024-08-19 12:21:35 +02:00
sani7 4120d032af Add unused to ui 2024-08-19 12:21:05 +02:00
sani7 7233ea487b Add custom websocketpp 2024-08-19 11:43:29 +02:00
sani7 7331a562e3 update color submodule 2024-08-19 11:00:36 +02:00
sani7 b2dacb6868 simulator base
adds stop
2024-08-19 09:48:21 +02:00
sani7 61ba25ea98 b UI_combobox
fix missing selected field in json
2024-08-19 01:58:10 +02:00
sani7 fea99e99d5 b UI_checkbox
fix bad implementation of toggle_selected
2024-08-19 01:57:52 +02:00
sani7 895aa66b82 Add initial simulator base 2024-08-19 01:41:51 +02:00
sani7 a6c0f1c406 Fix check bugs for UI_combobox and UI_slider 2024-08-19 01:35:32 +02:00
sani7 2ae7845e7c Fix initialiser bug for UI_checkbox 2024-08-19 01:33:49 +02:00
sani7 d257dc154f Move from function pointers to std::function 2024-08-19 01:07:52 +02:00
sani7 45aa67473f Fix inheritance issue 2024-08-19 01:06:56 +02:00
sani7 62ab0e7eb7 Update timer submodule 2024-08-19 01:06:39 +02:00
sani7 f7f5826bc1 Move timer to submodule 2024-08-18 22:27:21 +02:00