diff --git a/gui/timelineview/configurationwidget.cpp b/gui/timelineview/configurationwidget.cpp index 8f2043fed5..e9ceff11f3 100644 --- a/gui/timelineview/configurationwidget.cpp +++ b/gui/timelineview/configurationwidget.cpp @@ -25,22 +25,36 @@ #include "configurationwidget.h" #include +#include +#include +#include ConfigurationWidget::ConfigurationWidget(QWidget* parent) - : QWidget(parent) + : QGroupBox("Connection", parent) , _ipAddress(new QLineEdit("localhost")) , _port(new QLineEdit("20500")) , _connect(new QPushButton("Connect")) { QGridLayout* layout = new QGridLayout; - layout->addWidget(_ipAddress, 0, 0); - layout->addWidget(_port, 0, 1); - layout->addWidget(_connect, 0, 2); + layout->setVerticalSpacing(0); + { + QLabel* t = new QLabel("IP Address"); + layout->addWidget(t, 0, 0); + } + layout->addWidget(_ipAddress, 1, 0); + + { + QLabel* t = new QLabel("Port"); + layout->addWidget(t, 0, 1); + } + layout->addWidget(_port, 1, 1); + layout->addWidget(_connect, 1, 2, 1, 1); setLayout(layout); QObject::connect(_connect, SIGNAL(clicked()), this, SLOT(onConnectButton())); + QTimer::singleShot(100, this, SLOT(onConnectButton())); } void ConfigurationWidget::onConnectButton() { @@ -48,7 +62,17 @@ void ConfigurationWidget::onConnectButton() { } void ConfigurationWidget::socketConnected() { + _ipAddress->setEnabled(false); + _port->setEnabled(false); + _connect->setText("Disconnect"); + QObject::disconnect(_connect, SIGNAL(clicked()), this, SLOT(onConnectButton())); + QObject::connect(_connect, SIGNAL(clicked()), this, SIGNAL(disconnect())); } void ConfigurationWidget::socketDisconnected() { + _ipAddress->setEnabled(true); + _port->setEnabled(true); + _connect->setText("Connect"); + QObject::disconnect(_connect, SIGNAL(clicked()), this, SIGNAL(disconnect())); + QObject::connect(_connect, SIGNAL(clicked()), this, SLOT(onConnectButton())); } diff --git a/gui/timelineview/configurationwidget.h b/gui/timelineview/configurationwidget.h index ae6fd8b654..345222521c 100644 --- a/gui/timelineview/configurationwidget.h +++ b/gui/timelineview/configurationwidget.h @@ -25,11 +25,12 @@ #ifndef __CONFIGURATIONWIDGET_H__ #define __CONFIGURATIONWIDGET_H__ -#include +#include +//#include #include #include -class ConfigurationWidget : public QWidget { +class ConfigurationWidget : public QGroupBox { Q_OBJECT public: ConfigurationWidget(QWidget* parent); @@ -39,6 +40,7 @@ public: signals: void connect(QString host, QString port); + void disconnect(); private slots: void onConnectButton(); diff --git a/gui/timelineview/controlwidget.cpp b/gui/timelineview/controlwidget.cpp index ad53a9903e..5f659188f1 100644 --- a/gui/timelineview/controlwidget.cpp +++ b/gui/timelineview/controlwidget.cpp @@ -24,12 +24,16 @@ #include "controlwidget.h" +#include "mainwindow.h" + #include #include +#include #include #include #include #include +#include namespace { struct ImportantDate { @@ -39,6 +43,7 @@ namespace { }; const ImportantDate ImportantDates[] = { + { "", "", "" }, { "2007-02-27T16:40:00.00", "JupiterProjection", "Jupiter" }, { "2015-07-14T10:10:00.00", "PlutoProjection", "Pluto" }, { "2015-07-14T10:50:00.00", "PlutoProjection", "Pluto" }, @@ -73,11 +78,10 @@ ControlWidget::ControlWidget(QWidget* parent) , _setTime(new QComboBox) , _currentDelta(new QLabel("Current Delta")) , _setDelta(new QSlider(Qt::Horizontal)) - , _rewind(new QPushButton("<<")) , _pause(new QPushButton("||")) , _play(new QPushButton("|>")) - , _forward(new QPushButton(">>")) , _focusNode(new QComboBox) + , _setFocusToNextTarget(new QPushButton("Set Focus to the next Target")) { for (const ImportantDate& d : ImportantDates) _setTime->addItem(d.date); @@ -107,13 +111,6 @@ ControlWidget::ControlWidget(QWidget* parent) SLOT(onValueChange()) ); - QObject::connect( - _rewind, - SIGNAL(clicked()), - this, - SLOT(onRewindButton()) - ); - QObject::connect( _pause, SIGNAL(clicked()), @@ -129,31 +126,68 @@ ControlWidget::ControlWidget(QWidget* parent) ); QObject::connect( - _forward, + _setFocusToNextTarget, SIGNAL(clicked()), this, - SLOT(onForwardButton()) + SLOT(onFocusToTargetButton()) ); - QGridLayout* layout = new QGridLayout; + QVBoxLayout* mainLayout = new QVBoxLayout; - layout->addWidget(_currentTime, 0, 0); - layout->addWidget(_setTime, 0, 1); - layout->addWidget(_currentDelta, 1, 0); - layout->addWidget(_setDelta, 2, 0, 1, 2); + { + QGroupBox* box = new QGroupBox("Time", this); + QGridLayout* layout = new QGridLayout; - QWidget* controlContainer = new QWidget; - QHBoxLayout* controlContainerLayout = new QHBoxLayout; - controlContainerLayout->addWidget(_rewind); - controlContainerLayout->addWidget(_pause); - controlContainerLayout->addWidget(_play); - controlContainerLayout->addWidget(_forward); - controlContainer->setLayout(controlContainerLayout); - layout->addWidget(controlContainer, 3, 0, 1, 2); + //layout->setRowStretch(1, 5); + box->setLayout(layout); - layout->addWidget(_focusNode, 4, 0, 1, 2); + { + QLabel* l = new QLabel("Current Time (UTC):"); + layout->addWidget(l, 0, 0, Qt::AlignLeft); + layout->addWidget(_currentTime, 0, 1, Qt::AlignRight); + } + { + QLabel* l = new QLabel("Bookmarks:"); + layout->addWidget(l, 1, 0, Qt::AlignLeft); + layout->addWidget(_setTime, 1, 1, Qt::AlignRight); + } + layout->addItem(new QSpacerItem(0, 7), 2, 0, 1, 2); + { + QLabel* l = new QLabel("Current Time Increment (seconds per second):"); + layout->addWidget(l, 3, 0, Qt::AlignLeft); + layout->addWidget(_currentDelta, 3, 1, Qt::AlignRight); + } - setLayout(layout); + layout->addWidget(_setDelta, 4, 0, 1, 2); + + + QWidget* controlContainer = new QWidget; + QHBoxLayout* controlContainerLayout = new QHBoxLayout; + controlContainerLayout->addWidget(_pause); + controlContainerLayout->addWidget(_play); + controlContainer->setLayout(controlContainerLayout); + layout->addWidget(controlContainer, 5, 0, 1, 2); + + mainLayout->addWidget(box); + } + + { + QGroupBox* box = new QGroupBox("Focus"); + QGridLayout* layout = new QGridLayout; + box->setLayout(layout); + + { + QLabel* l = new QLabel("Set Focus:"); + layout->addWidget(l, 0, 0, Qt::AlignLeft); + _focusNode->setMinimumWidth(200); + layout->addWidget(_focusNode, 0, 1, Qt::AlignRight); + } + layout->addWidget(_setFocusToNextTarget, 1, 0, 1, 2); + + mainLayout->addWidget(box); + } + + setLayout(mainLayout); } void ControlWidget::update(QString currentTime, QString currentDelta) { @@ -164,23 +198,18 @@ void ControlWidget::update(QString currentTime, QString currentDelta) { void ControlWidget::onValueChange() { float value = static_cast(_setDelta->value()); - int delta; + float delta; if (value < 0.f) { value = -value; - float d = std::pow(2, value / 10); - delta = static_cast(-d); + float d = std::pow(2, value / 10) - 1.f; + delta = -d; } else { - float d = std::pow(2, value / 10); - delta = static_cast(d); + float d = std::pow(2, value / 10) - 1.f; + delta = d; } - - QString script = "openspace.time.setDeltaTime(" + QString::number(delta) + ");"; - emit scriptActivity(script); -} -void ControlWidget::onRewindButton() { - QString script = "openspace.time.setDeltaTime(-openspace.time.deltaTime());"; + QString script = "openspace.time.setDeltaTime(" + QString::number(delta) + ");"; emit scriptActivity(script); } @@ -194,22 +223,18 @@ void ControlWidget::onPlayButton() { emit scriptActivity(script); } -void ControlWidget::onForwardButton() { - QString script = "openspace.time.setDeltaTime(-openspace.time.deltaTime());"; - emit scriptActivity(script); - -} - void ControlWidget::onDateChange() { int index = _setTime->currentIndex(); - QString date = ImportantDates[index].date; - QString focus = ImportantDates[index].focus; - QString coordinateSystem = ImportantDates[index].coordinateSystem; - QString script = - "openspace.time.setTime('" + date + "');\ - openspace.setOrigin('" + focus + "');\ - openspace.changeCoordinateSystem('" + coordinateSystem + "');"; - emit scriptActivity(script); + if (index != 0) { + QString date = ImportantDates[index].date; + QString focus = ImportantDates[index].focus; + QString coordinateSystem = ImportantDates[index].coordinateSystem; + QString script = + "openspace.time.setTime('" + date + "');\ + openspace.setOrigin('" + focus + "');\ + openspace.changeCoordinateSystem('" + coordinateSystem + "');"; + emit scriptActivity(script); + } } void ControlWidget::onFocusChange() { @@ -230,6 +255,19 @@ void ControlWidget::onFocusChange() { emit scriptActivity(script); } +void ControlWidget::onFocusToTargetButton() { + std::string target = reinterpret_cast(parent())->nextTarget(); + if (!target.empty()) { + auto it = std::find_if(std::begin(FocusNodes), std::end(FocusNodes), [target](const FocusNode& n) { return n.guiName.toLower() == QString::fromStdString(target).toLower(); }); + if (it != std::end(FocusNodes)) { + QString name = it->name; + QString coordinateSystem = it->coordinateSystem; + QString script = "openspace.setOrigin('" + name + "');openspace.changeCoordinateSystem('" + coordinateSystem + "');"; + emit scriptActivity(script); + } + } +} + void ControlWidget::socketConnected() { setDisabled(false); } @@ -237,3 +275,4 @@ void ControlWidget::socketConnected() { void ControlWidget::socketDisconnected() { setDisabled(true); } + diff --git a/gui/timelineview/controlwidget.h b/gui/timelineview/controlwidget.h index 970040cfb7..aae206f079 100644 --- a/gui/timelineview/controlwidget.h +++ b/gui/timelineview/controlwidget.h @@ -49,21 +49,19 @@ private slots: void onValueChange(); void onDateChange(); void onFocusChange(); - void onRewindButton(); void onPauseButton(); void onPlayButton(); - void onForwardButton(); + void onFocusToTargetButton(); private: QLabel* _currentTime; QComboBox* _setTime; QLabel* _currentDelta; QSlider* _setDelta; - QPushButton* _rewind; QPushButton* _pause; QPushButton* _play; - QPushButton* _forward; QComboBox* _focusNode; + QPushButton* _setFocusToNextTarget; }; #endif // __CONTROLWIDGET_H__ diff --git a/gui/timelineview/informationwidget.cpp b/gui/timelineview/informationwidget.cpp index 0647f9fb32..ac7ae9935a 100644 --- a/gui/timelineview/informationwidget.cpp +++ b/gui/timelineview/informationwidget.cpp @@ -30,6 +30,7 @@ InformationWidget::InformationWidget(QWidget* parent) : QTextEdit(parent) { + setReadOnly(true); } void InformationWidget::socketConnected() { @@ -39,3 +40,11 @@ void InformationWidget::socketConnected() { void InformationWidget::socketDisconnected() { setDisabled(true); } + +void InformationWidget::logInformation(QString text) { + QString currentText = toPlainText(); + + currentText += text + "\n"; + + setPlainText(currentText); +} diff --git a/gui/timelineview/informationwidget.h b/gui/timelineview/informationwidget.h index abf56897a9..c1a657ee20 100644 --- a/gui/timelineview/informationwidget.h +++ b/gui/timelineview/informationwidget.h @@ -33,6 +33,9 @@ public: InformationWidget(QWidget* parent); void socketConnected(); void socketDisconnected(); + +public slots: + void logInformation(QString text); }; #endif // __INFORMATIONWIDGET_H__ diff --git a/gui/timelineview/mainwindow.cpp b/gui/timelineview/mainwindow.cpp index 3574f4dbfe..b4759fc51b 100644 --- a/gui/timelineview/mainwindow.cpp +++ b/gui/timelineview/mainwindow.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -84,6 +85,10 @@ MainWindow::MainWindow() _configurationWidget, SIGNAL(connect(QString, QString)), this, SLOT(onConnect(QString, QString)) ); + QObject::connect( + _configurationWidget, SIGNAL(disconnect()), + this, SLOT(onDisconnect()) + ); QObject::connect( _timeControlWidget, SIGNAL(scriptActivity(QString)), @@ -113,10 +118,15 @@ void MainWindow::onConnect(QString host, QString port) { _socket->connectToHost(host, port.toUInt()); } +void MainWindow::onDisconnect() { + delete _socket; + _socket = nullptr; +} void MainWindow::readTcpData() { static const uint16_t MessageTypeStatus = 0; - static const uint16_t MessageTypePlayBook = 2; + static const uint16_t MessageTypePlayBookHongKang = 2; + static const uint16_t MessageTypePlayBookLabel = 3; QByteArray data = _socket->readAll(); @@ -139,7 +149,8 @@ void MainWindow::readTcpData() { case MessageTypeStatus: handleStatusMessage(data.mid(2)); break; - case MessageTypePlayBook: + case MessageTypePlayBookHongKang: + case MessageTypePlayBookLabel: { const char* payloadDebug = data.mid(2).data(); @@ -147,15 +158,26 @@ void MainWindow::readTcpData() { uint32_t size = readFromBuffer(data.mid(2).data(), beginning); while (_socket->waitForReadyRead() && data.size() < size) { - //while (data.size() < size) { data = data.append(_socket->readAll()); + QThread::msleep(50); } handlePlaybook(data.mid(2)); + + if (messageType.value == MessageTypePlayBookHongKang) + _hasHongKangTimeline = true; + if (messageType.value == MessageTypePlayBookLabel) + _hasLabelTimeline = true; + + if (_hasHongKangTimeline && _hasLabelTimeline) { + fullyConnected(); + } + break; } default: qDebug() << "Unknown message of type '" << messageType.value << "'"; } + } void MainWindow::handleStatusMessage(QByteArray data) { @@ -244,10 +266,6 @@ void MainWindow::handlePlaybook(QByteArray data) { _timelineWidget->setData(std::move(images), std::move(targetMap), std::move(instrumentMap)); - _configurationWidget->socketConnected(); - _timeControlWidget->socketConnected(); - _informationWidget->socketConnected(); - _timelineWidget->socketConnected(); } void MainWindow::sendScript(QString script) { @@ -257,6 +275,7 @@ void MainWindow::sendScript(QString script) { void MainWindow::onSocketConnected() { _socket->write(QString("1\r\n").toLatin1()); + } void MainWindow::onSocketDisconnected() { @@ -264,5 +283,19 @@ void MainWindow::onSocketDisconnected() { _timeControlWidget->socketDisconnected(); _informationWidget->socketDisconnected(); _timelineWidget->socketDisconnected(); + + _informationWidget->logInformation("Disconnected."); } +std::string MainWindow::nextTarget() const { + return _timelineWidget->nextTarget(); +} + +void MainWindow::fullyConnected() { + _informationWidget->logInformation("Connected to " + _socket->peerName() + " on port " + QString::number(_socket->peerPort()) + "."); + + _configurationWidget->socketConnected(); + _timeControlWidget->socketConnected(); + _informationWidget->socketConnected(); + _timelineWidget->socketConnected(); +} diff --git a/gui/timelineview/mainwindow.h b/gui/timelineview/mainwindow.h index 594e400583..23d85fec0b 100644 --- a/gui/timelineview/mainwindow.h +++ b/gui/timelineview/mainwindow.h @@ -41,21 +41,24 @@ public: MainWindow(); ~MainWindow(); + std::string nextTarget() const; + public slots: void sendScript(QString script); private slots: void onConnect(QString host, QString port); + void onDisconnect(); void onSocketConnected(); void onSocketDisconnected(); - //void onConnectButton(); - //void sendCommandButton(); void readTcpData(); void handleStatusMessage(QByteArray data); void handlePlaybook(QByteArray data); + void fullyConnected(); + private: ConfigurationWidget* _configurationWidget; ControlWidget* _timeControlWidget; @@ -63,6 +66,9 @@ private: TimelineWidget* _timelineWidget; QTcpSocket* _socket; + + bool _hasHongKangTimeline = false; + bool _hasLabelTimeline = false; }; #endif // __MAINWINDOW_H__ diff --git a/gui/timelineview/timelinewidget.cpp b/gui/timelineview/timelinewidget.cpp index d8f2b0c3e6..3f8b98612c 100644 --- a/gui/timelineview/timelinewidget.cpp +++ b/gui/timelineview/timelinewidget.cpp @@ -25,6 +25,7 @@ #include "timelinewidget.h" #include +#include #include #include @@ -37,25 +38,55 @@ namespace { static const int TextOffset = 5; - //const QColor targetColors[] = { - // QColor(251, 180, 174), - // QColor(179, 205, 227), - // QColor(204, 235, 197), - // QColor(222, 203, 228), - // QColor(254, 217, 166), - // QColor(255, 255, 204) - //}; - const QColor instrumentColors[] = { - QColor(228, 26, 28), - QColor(55, 126, 184), - QColor(77, 175, 74), - QColor(152, 78, 163), - QColor(255, 127, 0), - QColor(255, 255, 51), - QColor(166, 86, 40), - QColor(247, 129, 191), - QColor(153, 153, 153), + QColor(242, 101, 74), + QColor(175, 18, 18), + QColor(211, 154, 31), + QColor(241, 231, 48), + QColor(149, 219, 32), + QColor(49, 234, 219), + QColor(49, 155, 234), + QColor(139, 86, 152), + QColor(84, 79, 149), + QColor(203, 153, 200), + QColor(82, 145, 57) + + //QColor(166, 206, 227), + //QColor(31, 120, 180), + //QColor(178, 223, 138), + //QColor(51, 160, 44), + //QColor(251, 154, 153), + //QColor(227, 26, 28), + //QColor(253, 191, 111), + //QColor(255, 127, 0), + //QColor(202, 178, 214), + //QColor(106, 61, 154), + //QColor(255, 255, 153), + + + //QColor(228, 26, 28), + //QColor(55, 126, 184), + //QColor(77, 175, 74), + //QColor(152, 78, 163), + //QColor(255, 127, 0), + //QColor(255, 255, 51), + //QColor(166, 86, 40), + //QColor(247, 129, 191), + //QColor(153, 153, 153), + }; + + QMap InstrumentConversion = { + { "NH_ALICE_AIRGLOW", "ALICE Airglow" }, + { "NH_RALPH_LEISA", "RALPH LEISA" }, + { "NH_RALPH_MVIC_NIR", "RALPH MVIC NIR" }, + { "NH_ALICE_SOC", "ALICE SOC" }, + { "NH_RALPH_MVIC_BLUE", "RALPH MVIC Blue" }, + { "NH_RALPH_MVIC_PAN1" , "RALPH MVIC Pan1" }, + { "NH_LORRI", "LORRI" }, + { "NH_RALPH_MVIC_FT", "RALPH MVIC FT" }, + { "NH_RALPH_MVIC_PAN2", "RALPH MVIC Pan2" }, + { "NH_RALPH_MVIC_METHANE", "RALPH MVIC Methane" }, + { "NH_RALPH_MVIC_RED", "RALPH MVIC Red" } }; const double etSpread = 100.0; @@ -86,12 +117,12 @@ void TimelineWidget::paintEvent(QPaintEvent* event) { } void TimelineWidget::setData(std::vector images, std::map targetMap, std::map instrumentMap) { - _images = std::move(images); + _images.insert(_images.end(), images.begin(), images.end()); std::sort(_images.begin(), _images.end(), [](const Image& a, const Image& b) { return a.beginning < b.beginning; }); - _targetMap = std::move(targetMap); - _instrumentMap = std::move(instrumentMap); + _targetMap.insert(targetMap.begin(), targetMap.end()); + _instrumentMap.insert(instrumentMap.begin(), instrumentMap.end()); _instruments.clear(); std::set instruments; @@ -180,7 +211,7 @@ void TimelineWidget::drawLegend(QPainter& painter, QRectF rect) { currentHorizontalPosition += BoxSize + Padding; painter.setPen(QPen(Qt::black)); - painter.drawText(currentHorizontalPosition, currentVerticalPosition + BoxSize / 2 + TextOffset, QString::fromStdString(instrument)); + painter.drawText(currentHorizontalPosition, currentVerticalPosition + BoxSize / 2 + TextOffset, InstrumentConversion[QString::fromStdString(instrument)]); int textWidth = painter.boundingRect(QRect(), QString::fromStdString(instrument)).width(); currentHorizontalPosition += std::max(textWidth, 25) + Padding; } @@ -258,3 +289,16 @@ void TimelineWidget::socketDisconnected() { _instruments.clear(); _targets.clear(); } + +std::string TimelineWidget::nextTarget() const { + auto it = std::lower_bound(_images.begin(), _images.end(), _currentTime.et, [](const Image& i, double et) { return i.beginning < et; }); + if (it != _images.end()) + return it->target; + else + return ""; + //for (const Image& i : _images) { + // double imageTime = i.beginning; + // double currentTime = _currentTime.et; + // if () + //} +} diff --git a/gui/timelineview/timelinewidget.h b/gui/timelineview/timelinewidget.h index 86ec18779d..f0c9233a8a 100644 --- a/gui/timelineview/timelinewidget.h +++ b/gui/timelineview/timelinewidget.h @@ -45,6 +45,8 @@ public: void socketConnected(); void socketDisconnected(); + std::string nextTarget() const; + protected: void paintEvent(QPaintEvent* event); void drawContent(QPainter& painter, QRectF rect); diff --git a/include/openspace/util/sequenceparser.h b/include/openspace/util/sequenceparser.h index c39e649327..4eb3a42582 100644 --- a/include/openspace/util/sequenceparser.h +++ b/include/openspace/util/sequenceparser.h @@ -22,48 +22,52 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ - #ifndef __SEQUENCEPARSER_H__ #define __SEQUENCEPARSER_H__ -#include +#include #include #include #include namespace openspace { - struct Image{ - double startTime; - double stopTime; - std::string path; - std::vector activeInstruments; - std::string target; - bool projected; - }; - struct TimeRange{ - TimeRange() : _min(-1), _max(-1){}; - void setRange(double val){ - if (_min > val) _min = val; - if (_max < val) _max = val; - }; - bool inRange(double min, double max){ - return (min >= _min && max <= _max); - } - bool inRange(double val){ - return (val >= _min && val <= _max); - } - double _min; - double _max; - }; - struct ImageSubset{ - TimeRange _range; - std::vector < Image > _subset; - }; + +class Decoder; + +struct Image { + double startTime; + double stopTime; + std::string path; + std::vector activeInstruments; + std::string target; + bool projected; +}; + +struct TimeRange { + TimeRange() : _min(-1), _max(-1){}; + void setRange(double val){ + if (_min > val) _min = val; + if (_max < val) _max = val; + }; + bool inRange(double min, double max){ + return (min >= _min && max <= _max); + } + bool inRange(double val){ + return (val >= _min && val <= _max); + } + double _min; + double _max; +}; + +struct ImageSubset { + TimeRange _range; + std::vector _subset; +}; class SequenceParser { public: - virtual void create() = 0; + virtual void create() = 0; virtual std::map getSubsetMap() final; virtual std::vector> getIstrumentTimes() final; virtual std::vector> getTargetTimes() final; @@ -71,13 +75,16 @@ public: virtual std::vector getCaptureProgression() final; protected: - void sendPlaybookInformation(); + void sendPlaybookInformation(const std::string& name); std::map _subsetMap; std::vector> _instrumentTimes; std::vector> _targetTimes; std::vector _captureProgression; + NetworkEngine::MessageIdentifier _messageIdentifier; }; -} -#endif //__SEQUENCEPARSER_H__ \ No newline at end of file + +} // namespace openspace + +#endif //__SEQUENCEPARSER_H__ diff --git a/openspace.cfg b/openspace.cfg index 774cd01124..1b3f990e52 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -31,7 +31,7 @@ return { LogLevel = "Debug", ImmediateFlush = true, Logs = { --- { Type = "HTML", FileName = "${BASE_PATH}/log.html", Append = false } + { Type = "HTML", FileName = "${BASE_PATH}/log.html", Append = false } } }, LuaDocumentationFile = { diff --git a/src/util/hongkangparser.cpp b/src/util/hongkangparser.cpp index 784cfd2f44..c2198e9766 100644 --- a/src/util/hongkangparser.cpp +++ b/src/util/hongkangparser.cpp @@ -40,7 +40,7 @@ namespace { const std::string _loggerCat = "HongKangParser"; const std::string keyTranslation = "DataInputTranslation"; - const std::string PlaybookIdentifierName = "Playbook"; + const std::string PlaybookIdentifierName = "HongKang"; } namespace openspace { @@ -251,7 +251,7 @@ void HongKangParser::create(){ } } - sendPlaybookInformation(); + sendPlaybookInformation(PlaybookIdentifierName); //std::ofstream myfile; //myfile.open("HongKangOutput.txt"); diff --git a/src/util/imagesequencer2.cpp b/src/util/imagesequencer2.cpp index 446cd20bf0..bae2259547 100644 --- a/src/util/imagesequencer2.cpp +++ b/src/util/imagesequencer2.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include diff --git a/src/util/labelparser.cpp b/src/util/labelparser.cpp index ba68c15971..47e01423ed 100644 --- a/src/util/labelparser.cpp +++ b/src/util/labelparser.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,8 @@ namespace { const std::string _loggerCat = "LabelParser"; const std::string keySpecs = "Read"; const std::string keyConvert = "Convert"; + + const std::string PlaybookIdentifierName = "LabelParser"; } namespace openspace { @@ -272,6 +275,7 @@ void LabelParser::create(){ } //myfile.close(); + sendPlaybookInformation(PlaybookIdentifierName); } diff --git a/src/util/sequenceparser.cpp b/src/util/sequenceparser.cpp index aaa60fc0c3..9b44c8092e 100644 --- a/src/util/sequenceparser.cpp +++ b/src/util/sequenceparser.cpp @@ -25,8 +25,8 @@ #include #include -#include #include +#include namespace { const std::string _loggerCat = "SequenceParser"; @@ -73,8 +73,9 @@ void writeToBuffer(std::vector& buffer, size_t& currentWriteL currentWriteLocation += length; } -void SequenceParser::sendPlaybookInformation() { - static const NetworkEngine::MessageIdentifier PlaybookIdentifier = OsEng.networkEngine()->identifier(PlaybookIdentifierName); +void SequenceParser::sendPlaybookInformation(const std::string& name) { + std::string fullName = PlaybookIdentifierName + "_" + name; + _messageIdentifier = OsEng.networkEngine()->identifier(fullName); std::vector buffer(1024); size_t currentWriteLocation = 0; @@ -164,7 +165,7 @@ void SequenceParser::sendPlaybookInformation() { buffer.resize(currentWriteLocation); //OsEng.networkEngine()->publishMessage(PlaybookIdentifier, buffer); - OsEng.networkEngine()->setInitialConnectionMessage(PlaybookIdentifier, buffer); + OsEng.networkEngine()->setInitialConnectionMessage(_messageIdentifier, buffer); } } \ No newline at end of file