Skip to content

Commit

Permalink
Selecting DP file with TV is core dumping!
Browse files Browse the repository at this point in the history
With the new ability to run koviz without RUNs,
koviz was confused when having no runs when
connecting a Trick var server.

This is a fix due to not testing the tv after
all the big changes introduced with the
the dynamic run capability.
  • Loading branch information
keithvetter committed Aug 9, 2024
1 parent d273f46 commit fccb877
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 0 deletions.
6 changes: 6 additions & 0 deletions koviz/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,12 @@ int main(int argc, char *argv[])
if ( fileInfo.fileName().startsWith("MONTE_") ) {
isMonte = true;
}
} else if ( runPaths.size() == 0 &&
opts.trickport > 0 ) {
// Add var server "run path"
QString tvpath = QString("trick://%1:%2").
arg(opts.trickhost).arg(opts.trickport);
runPaths.append(tvpath);
}

bool isShowProgress = true;
Expand Down
2 changes: 2 additions & 0 deletions libkoviz/libkoviz.pro
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ SOURCES += bookmodel.cpp \
rundir.cpp \
runfile.cpp \
runswidget.cpp \
runtv.cpp \
sie_listmodel.cpp \
trickvarsortfilterproxymodel.cpp \
varswidget.cpp \
Expand Down Expand Up @@ -137,6 +138,7 @@ HEADERS += bookmodel.h \
rundir.h \
runfile.h \
runswidget.h \
runtv.h \
sie_listmodel.h \
trickvarsortfilterproxymodel.h \
varswidget.h \
Expand Down
6 changes: 6 additions & 0 deletions libkoviz/runs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ void Runs::_init()
_filterPattern,_excludePattern);
} else if ( fi.isFile() ) {
run = new RunFile(runPath,_timeNames,_varMap);
} else if ( runPath.startsWith("trick://") ) {
run = new RunTV(runPath);
} else {
fprintf(stderr, "koviz [error]: Runs::_init() Bad run path=%s\n",
runPath.toLatin1().constData());
exit(-1);
}
_runs.append(run);
if ( progress ) {
Expand Down
1 change: 1 addition & 0 deletions libkoviz/runs.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "mapvalue.h"
#include "rundir.h"
#include "runfile.h"
#include "runtv.h"

class Runs : public QObject
{
Expand Down
17 changes: 17 additions & 0 deletions libkoviz/runtv.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "runtv.h"

RunTV::RunTV(const QString &host_port_path) :
_host_port_path(host_port_path)
{
}

QStringList RunTV::params()
{
return _params;
}

DataModel *RunTV::dataModel(const QString &param)
{
DataModel* model = 0;
return model;
}
22 changes: 22 additions & 0 deletions libkoviz/runtv.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef RUNTV_H
#define RUNTV_H

#include <QString>
#include <QStringList>
#include "run.h"

// For now, this class is a placeholder that returns empty

class RunTV : public Run
{
public:
RunTV(const QString& host_port_path); // e.g. trick://127.0.0.1:4545
virtual QStringList params();
virtual DataModel *dataModel(const QString& param);
private:
QString _host_port_path;
DataModel* _model;
QStringList _params;
};

#endif // RUNTV_H

0 comments on commit fccb877

Please sign in to comment.