Skip to content

Commit 5178f4d

Browse files
committed
Updating Visualizer to lastest BioGears 7.4.0
1 parent 19be722 commit 5178f4d

File tree

9 files changed

+158
-128
lines changed

9 files changed

+158
-128
lines changed

cmake/cmake-common_logic.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ if( NOT CMAKE_BUILD_TYPE )
1515
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${BUILD_OPTIONS_STRINGS})
1616
endif()
1717

18-
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
19-
set (CMAKE_INSTALL_PREFIX "${_ROOT}/usr" CACHE PATH "default install path" FORCE )
18+
if (WIN32 AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
19+
set (CMAKE_INSTALL_PREFIX "install/" CACHE PATH "default install path" FORCE )
2020
endif()
2121

2222
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

extern/biogears

Submodule biogears updated 1593 files

projects/ui/cpp/biogears/EventTree.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "EventTree.h"
22

3+
#include <iostream>
34
#include <fstream>
45
#include <istream>
56
#include <QFileInfo>

projects/ui/cpp/biogears/EventTree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class EventTree : public QObject {
202202
Q_INVOKABLE void add_event(Event ev);
203203
Q_INVOKABLE void add_event(QString name, int type, int subType, QString params, double startTime_s, double duration_s);
204204
Q_INVOKABLE Event get_event(int index) { return _events[index]; };
205-
Q_INVOKABLE int get_event_count() { return _events.size(); };
205+
Q_INVOKABLE int get_event_count() { return static_cast<int>(_events.size()); };
206206
Q_INVOKABLE void clear_events() { _events.clear(); };
207207
Q_INVOKABLE QString get_timeline_name() { return _timeline_name; };
208208
Q_INVOKABLE QString get_patient_name() { return _patient_name; };

projects/ui/cpp/biogears/Logger.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
#include "Logger.h"
2+
#include <biogears/io/io-manager.h>
23

34
#include <QDebug>
45
#include <QLoggingCategory>
56
#include <QString>
67

7-
void QtLogForward::ForwardDebug(const std::string& msg, const std::string& origin)
8+
void QtLogForward::Debug(char const* msg) const
89
{
9-
messageReceived(QString("<font color=#ff0000ff>%1</font>\n").arg(msg.c_str()));
10+
messageReceived(QString("<font color=#ff0000ff>%1</font>\n").arg(msg));
1011
}
1112
//-------------------------------------------------------------------------------
12-
void QtLogForward::ForwardInfo(const std::string& msg, const std::string& origin)
13+
void QtLogForward::Info(char const* msg) const
1314
{
14-
messageReceived(QString("<color=#ffaaaaaa>%1</color>\n").arg(msg.c_str()));
15+
messageReceived(QString("<color=#ffaaaaaa>%1</color>\n").arg(msg));
1516
}
1617
//-------------------------------------------------------------------------------
17-
void QtLogForward::ForwardWarning(const std::string& msg, const std::string& origin)
18+
void QtLogForward::Warning(char const* msg) const
1819
{
19-
messageReceived(QString("<color=#ffffff00>%1</color>\n").arg(msg.c_str()));
20+
messageReceived(QString("<color=#ffffff00>%1</color>\n").arg(msg));
2021
}
2122
//-------------------------------------------------------------------------------
22-
void QtLogForward::ForwardError(const std::string& msg, const std::string& origin)
23+
void QtLogForward::Error(char const* msg) const
2324
{
2425

25-
messageReceived(QString("<color=#ffff0000>%1</color>\n").arg(msg.c_str()));
26+
messageReceived(QString("<color=#ffff0000>%1</color>\n").arg(msg));
2627
}
2728
//-------------------------------------------------------------------------------
28-
void QtLogForward::ForwardFatal(const std::string& msg, const std::string& origin)
29+
void QtLogForward::Fatal(char const* msg) const
2930
{
30-
messageReceived(QString("<color=#ffff66cc>%1</color>\n").arg(msg.c_str()));
31+
messageReceived(QString("<color=#ffff66cc>%1</color>\n").arg(msg));
3132
}
3233
//-------------------------------------------------------------------------------
3334
//-------------------------------------------------------------------------------
@@ -44,8 +45,8 @@ struct QtLogger::Implementation {
4445
};
4546
//-------------------------------------------------------------------------------
4647

47-
QtLogger::QtLogger(const QString& logFilename, const QString& working_dir)
48-
: biogears::Logger(logFilename.toStdString(), working_dir.toStdString())
48+
QtLogger::QtLogger(const QString& logFilename, biogears::IOManager iomanager)
49+
: biogears::Logger(logFilename.toStdString(), iomanager)
4950
, _pimpl(std::make_unique<Implementation>())
5051
{
5152
biogears::Logger::SetForward(&_pimpl->Qt5LogStream);

projects/ui/cpp/biogears/Logger.h

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
11
#pragma once
2-
#include <biogears/cdm/utils/Logger.h>
2+
3+
#define WINDOWS_LEAN_AND_MEAN
4+
35
#include <string>
46
#include <memory>
57

68
#include <QObject>
79
#include <QString>
810
#include <qtextstream.h>
11+
#ifdef ERROR
12+
#undef ERROR
13+
#endif
914

15+
#include <biogears/cdm/utils/Logger.h>
1016
class QtLogForward : public QObject, public biogears::LoggerForward {
1117
Q_OBJECT
1218

1319
public:
1420

1521
QtLogForward(QObject* parent = nullptr);
1622
~QtLogForward() = default;
17-
void ForwardDebug(const std::string& msg, const std::string& origin) final;
18-
void ForwardInfo(const std::string& msg, const std::string& origin) final;
19-
void ForwardWarning(const std::string& msg, const std::string& origin) final;
20-
void ForwardError(const std::string& msg, const std::string& origin) final;
21-
void ForwardFatal(const std::string& msg, const std::string& origin) final;
23+
void Debug(const char* msg) const final;
24+
void Info(const char* msg) const final;
25+
void Warning(const char* msg) const final;
26+
void Error(const char* msg) const final;
27+
void Fatal(const char* msg) const final;
2228

2329
signals:
24-
void messageReceived(QString message);
30+
void messageReceived(QString message) const;
2531

2632

2733
private:
@@ -33,7 +39,7 @@ class QtLogger : public biogears::Logger {
3339
friend biogears::Loggable;
3440

3541
public:
36-
QtLogger(const QString& logFilename, const QString& working_dir);
42+
QtLogger(const QString& logFilename, biogears::IOManager iomanager);
3743
virtual ~QtLogger();
3844

3945
protected:

projects/ui/cpp/biogears/PatientMetrics.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#pragma once
22

3+
#include <iostream>
4+
35
#include <QObject>
46

57
struct PatientMetrics : QObject {
@@ -8,7 +10,6 @@ struct PatientMetrics : QObject {
810
{
911
}
1012
~PatientMetrics() override {
11-
std::cout << "simulationTime : " << simulationTime << "\n;";
1213
};
1314
QString respiratory_rate_bpm;
1415
QString heart_rate_bpm;

0 commit comments

Comments
 (0)