mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
clean up
This commit is contained in:
@@ -70,7 +70,7 @@ foreach(sim ${sims})
|
||||
# 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)
|
||||
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
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
$<TARGET_FILE:sim_${LIB_NAME}>
|
||||
|
||||
@@ -57,17 +57,3 @@ void Visa::send(QString data)
|
||||
m_tcp_socket->write(data.toUtf8());
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -50,13 +50,6 @@ class Visa : public QObject
|
||||
* @param data The data to send
|
||||
*/
|
||||
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:
|
||||
/**
|
||||
|
||||
@@ -72,7 +72,7 @@ void Simulator_base::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));
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
#include "CAN_interface.hpp"
|
||||
#include "extensions/CAN_interface.hpp"
|
||||
Q_FORWARD_DECLARE_OBJC_CLASS(UI_item);
|
||||
#endif
|
||||
|
||||
@@ -160,7 +160,7 @@ class Simulator_base : public QObject
|
||||
* @return true If the bit is high
|
||||
* @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:
|
||||
/**
|
||||
* @brief Signal emitted when the ui of the simulator changes
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "simulators.hpp"
|
||||
#include "CAN_wrapper.hpp"
|
||||
#include "simulator_base.hpp"
|
||||
#include "websocket.hpp"
|
||||
#include <QDirIterator>
|
||||
|
||||
Reference in New Issue
Block a user