mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Code Cleanup: Deprecate Train Streaming
We no longer support streaming data from the Train View. All the source for this has been moved to deprecated.
This commit is contained in:
@@ -324,7 +324,6 @@ TrainTool::TrainTool(MainWindow *parent, const QDir &home) : GcWindow(parent), h
|
||||
|
||||
// set home
|
||||
main = parent;
|
||||
streamController = NULL;
|
||||
ergFile = NULL;
|
||||
calibrating = false;
|
||||
|
||||
@@ -359,7 +358,6 @@ TrainTool::TrainTool(MainWindow *parent, const QDir &home) : GcWindow(parent), h
|
||||
|
||||
connect(gui_timer, SIGNAL(timeout()), this, SLOT(guiUpdate()));
|
||||
connect(disk_timer, SIGNAL(timeout()), this, SLOT(diskUpdate()));
|
||||
connect(stream_timer, SIGNAL(timeout()), this, SLOT(streamUpdate()));
|
||||
connect(load_timer, SIGNAL(timeout()), this, SLOT(loadUpdate()));
|
||||
|
||||
configChanged(); // will reset the workout tree
|
||||
@@ -621,45 +619,6 @@ TrainTool::mediaTreeWidgetSelectionChanged()
|
||||
* Was realtime window, now local and manages controller and chart updates etc
|
||||
*------------------------------------------------------------------------------*/
|
||||
|
||||
// open a connection to the GoldenServer via a GoldenClient
|
||||
void TrainTool::setStreamController()
|
||||
{
|
||||
int deviceno = selectedServerNumber();
|
||||
|
||||
if (deviceno == -1) return;
|
||||
|
||||
// zap the current one
|
||||
if (streamController != NULL) {
|
||||
delete streamController;
|
||||
streamController = NULL;
|
||||
}
|
||||
|
||||
if (Devices.count() > 0) {
|
||||
DeviceConfiguration config = Devices.at(deviceno);
|
||||
streamController = new GoldenClient;
|
||||
|
||||
// connect
|
||||
QStringList speclist = config.portSpec.split(":", QString::SkipEmptyParts);
|
||||
bool rc = streamController->connect(speclist[0], // host
|
||||
speclist[1].toInt(), // port
|
||||
"9cf638294030cea7b1590a4ca32e7f58", // raceid
|
||||
appsettings->cvalue(main->cyclist, GC_NICKNAME).toString(), // name
|
||||
FTP, // CP60
|
||||
appsettings->cvalue(main->cyclist, GC_WEIGHT).toDouble()); // weight
|
||||
|
||||
// no connection
|
||||
if (rc == false) {
|
||||
streamController->closeAndExit();
|
||||
streamController = NULL;
|
||||
status &= ~RT_STREAMING;
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(QString(tr("Cannot Connect to Server %1 on port %2").arg(speclist[0]).arg(speclist[1])));
|
||||
msgBox.setIcon(QMessageBox::Critical);
|
||||
msgBox.exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TrainTool::Start() // when start button is pressed
|
||||
{
|
||||
static QIcon playIcon(":images/oxygen/play.png");
|
||||
@@ -759,9 +718,6 @@ void TrainTool::Start() // when start button is pressed
|
||||
// we're away!
|
||||
status |=RT_RUNNING;
|
||||
|
||||
// should we be streaming too?
|
||||
if (streamController != NULL) status |= RT_STREAMING;
|
||||
|
||||
load_period.restart();
|
||||
session_time.start();
|
||||
session_elapsed_msec = 0;
|
||||
@@ -898,13 +854,6 @@ void TrainTool::Stop(int deviceStatus) // when stop button is pressed
|
||||
}
|
||||
}
|
||||
|
||||
if (status & RT_STREAMING) {
|
||||
stream_timer->stop();
|
||||
streamController->closeAndExit();
|
||||
delete streamController;
|
||||
streamController = NULL;
|
||||
}
|
||||
|
||||
if (status & RT_WORKOUT) {
|
||||
load_timer->stop();
|
||||
load_msecs = 0;
|
||||
@@ -1126,39 +1075,6 @@ void TrainTool::warnnoConfig()
|
||||
QMessageBox::warning(this, tr("No Devices Configured"), "Please configure a device in Preferences.");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// STREAMING FUNCTION
|
||||
//----------------------------------------------------------------------
|
||||
void
|
||||
TrainTool::streamUpdate()
|
||||
{
|
||||
// send over the wire...
|
||||
if (streamController) {
|
||||
|
||||
// send my data
|
||||
streamController->sendTelemetry(displayPower,
|
||||
displayCadence,
|
||||
displayDistance,
|
||||
displayHeartRate,
|
||||
displaySpeed);
|
||||
|
||||
// get standings for everyone else
|
||||
RaceStatus current = streamController->getStandings();
|
||||
|
||||
// send out to all the widgets...
|
||||
notifyRaceStandings(current);
|
||||
|
||||
// has the race finished?
|
||||
if (current.race_finished == true) {
|
||||
Stop(0); // all over dude
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("Race Over!"));
|
||||
msgBox.setIcon(QMessageBox::Information);
|
||||
msgBox.exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// DISK UPDATE FUNCTIONS
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "GoldenCheetah.h"
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "GoldenClient.h"
|
||||
#include "RealtimeData.h"
|
||||
#include "RealtimePlot.h"
|
||||
#include "DeviceConfiguration.h"
|
||||
@@ -80,7 +79,6 @@ class TrainTool : public GcWindow
|
||||
QStringList listWorkoutFiles(const QDir &) const;
|
||||
|
||||
QList<int> devices(); // convenience function for iterating over active devices
|
||||
GoldenClient *streamController; // send out to
|
||||
|
||||
const QTreeWidgetItem *currentWorkout() { return workout; }
|
||||
const QTreeWidgetItem *currentMedia() { return media; }
|
||||
@@ -94,9 +92,6 @@ class TrainTool : public GcWindow
|
||||
// set labels when ergfile selected etc
|
||||
void setLabels();
|
||||
|
||||
// notify widgets of race update
|
||||
void notifyRaceStandings(RaceStatus x) { raceStandings(x); }
|
||||
|
||||
// was realtimewindow,merged into tool
|
||||
// update charts/dials and manage controller
|
||||
void updateData(RealtimeData &); // to update telemetry by push devices
|
||||
@@ -119,7 +114,6 @@ class TrainTool : public GcWindow
|
||||
|
||||
void deviceSelected();
|
||||
void serverSelected();
|
||||
void raceStandings(RaceStatus);
|
||||
void start();
|
||||
void pause();
|
||||
void stop();
|
||||
@@ -157,7 +151,6 @@ class TrainTool : public GcWindow
|
||||
// Timed actions
|
||||
void guiUpdate(); // refreshes the telemetry
|
||||
void diskUpdate(); // writes to CSV file
|
||||
void streamUpdate(); // writes to remote Peer
|
||||
void loadUpdate(); // sets Load on CT like devices
|
||||
|
||||
// When no config has been setup
|
||||
|
||||
@@ -284,7 +284,6 @@ HEADERS += \
|
||||
GcWindowRegistry.h \
|
||||
GcWindowTool.h \
|
||||
GoldenCheetah.h \
|
||||
GoldenClient.h \
|
||||
GoogleMapControl.h \
|
||||
GpxParser.h \
|
||||
GpxRideFile.h \
|
||||
@@ -331,7 +330,6 @@ HEADERS += \
|
||||
PowerTapDevice.h \
|
||||
PowerTapUtil.h \
|
||||
PwxRideFile.h \
|
||||
ProtocolHandler.h \
|
||||
QuarqParser.h \
|
||||
QuarqRideFile.h \
|
||||
RawRideFile.h \
|
||||
@@ -471,7 +469,6 @@ SOURCES += \
|
||||
GcWindowRegistry.cpp \
|
||||
GcWindowTool.cpp \
|
||||
GoldenCheetah.cpp \
|
||||
GoldenClient.cpp \
|
||||
GoogleMapControl.cpp \
|
||||
GpxParser.cpp \
|
||||
GpxRideFile.cpp \
|
||||
@@ -519,7 +516,6 @@ SOURCES += \
|
||||
PowerHist.cpp \
|
||||
PowerTapDevice.cpp \
|
||||
PowerTapUtil.cpp \
|
||||
Protocolhandler.cpp \
|
||||
PwxRideFile.cpp \
|
||||
QuarqParser.cpp \
|
||||
QuarqRideFile.cpp \
|
||||
|
||||
Reference in New Issue
Block a user