This commit is contained in:
2026-02-14 14:32:43 +01:00
parent 2e1d461026
commit fbf0d02d9c
8 changed files with 5 additions and 27 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ foreach(sim ${sims})
# Create a library for each .cpp file # Create a library for each .cpp file
add_library(sim_${LIB_NAME} SHARED ${CMAKE_CURRENT_SOURCE_DIR}/simulators/${LIB_NAME}.hpp ${CMAKE_CURRENT_SOURCE_DIR}/simulators/${LIB_NAME}.cpp) add_library(sim_${LIB_NAME} SHARED ${CMAKE_CURRENT_SOURCE_DIR}/simulators/${LIB_NAME}.hpp ${CMAKE_CURRENT_SOURCE_DIR}/simulators/${LIB_NAME}.cpp)
target_link_libraries(sim_${LIB_NAME} PRIVATE Qt::SerialBus magic_enum::magic_enum nlohmann_json::nlohmann_json) target_link_libraries(sim_${LIB_NAME} PRIVATE Qt::SerialBus magic_enum::magic_enum nlohmann_json::nlohmann_json)
target_include_directories(sim_${LIB_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/CAN ${CMAKE_SOURCE_DIR}/VISA ${CMAKE_SOURCE_DIR}/GPIO ${CMAKE_SOURCE_DIR}/UI ${CMAKE_SOURCE_DIR}/external/color ${CMAKE_SOURCE_DIR}/external/spdlog/include) target_include_directories(sim_${LIB_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/extensions ${CMAKE_CURRENT_LIST_DIR}/extensions/CAN_R1 ${CMAKE_SOURCE_DIR}/UI ${CMAKE_SOURCE_DIR}/external/color ${CMAKE_SOURCE_DIR}/external/spdlog/include)
add_custom_command(TARGET sim_${LIB_NAME} POST_BUILD add_custom_command(TARGET sim_${LIB_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:sim_${LIB_NAME}> $<TARGET_FILE:sim_${LIB_NAME}>
+1 -15
View File
@@ -56,18 +56,4 @@ void Visa::send(QString data)
data.append('\n'); data.append('\n');
m_tcp_socket->write(data.toUtf8()); m_tcp_socket->write(data.toUtf8());
m_tcp_socket->waitForBytesWritten(); m_tcp_socket->waitForBytesWritten();
} }
QString Visa::query(QString data)
{
uint32_t counter = 0;
m_data.clear();
send(data);
while (!m_data_ready && counter < 1024)
{
QCoreApplication::processEvents();
counter++;
}
return m_data;
}
-7
View File
@@ -50,13 +50,6 @@ class Visa : public QObject
* @param data The data to send * @param data The data to send
*/ */
void send(QString data); void send(QString data);
/**
* @brief Query the VISA device
*
* @param data The query data
* @return QString The response from the device
*/
QString query(QString data);
signals: signals:
/** /**
+1 -1
View File
@@ -72,7 +72,7 @@ void Simulator_base::reboot()
system("reboot"); system("reboot");
} }
bool Simulator_base::check_input_high(uint32_t data, uint16_t pinnummer) constexpr bool Simulator_base::check_input_high(uint32_t data, uint16_t pinnummer)
{ {
return (data & (1 << pinnummer)); return (data & (1 << pinnummer));
} }
+2 -2
View File
@@ -11,7 +11,7 @@
using json = nlohmann::json; using json = nlohmann::json;
#include "CAN_interface.hpp" #include "extensions/CAN_interface.hpp"
Q_FORWARD_DECLARE_OBJC_CLASS(UI_item); Q_FORWARD_DECLARE_OBJC_CLASS(UI_item);
#endif #endif
@@ -160,7 +160,7 @@ class Simulator_base : public QObject
* @return true If the bit is high * @return true If the bit is high
* @return false If the bit is low * @return false If the bit is low
*/ */
bool check_input_high(uint32_t data, uint16_t pinnummer); constexpr bool check_input_high(uint32_t data, uint16_t pinnummer);
signals: signals:
/** /**
* @brief Signal emitted when the ui of the simulator changes * @brief Signal emitted when the ui of the simulator changes
-1
View File
@@ -1,5 +1,4 @@
#include "simulators.hpp" #include "simulators.hpp"
#include "CAN_wrapper.hpp"
#include "simulator_base.hpp" #include "simulator_base.hpp"
#include "websocket.hpp" #include "websocket.hpp"
#include <QDirIterator> #include <QDirIterator>