Added Spacebrew auto-reconnect
Millis between reconnect checks added to GUI
This commit is contained in:
Binary file not shown.
@@ -84,3 +84,8 @@
|
||||
<Name>Graph Text RectAlpha</Name>
|
||||
<Value>140.921051025</Value>
|
||||
</Widget>
|
||||
<Widget>
|
||||
<Kind>4</Kind>
|
||||
<Name>Reconnect Frequency</Name>
|
||||
<Value>3134.868408203</Value>
|
||||
</Widget>
|
||||
|
||||
@@ -24,7 +24,7 @@ void DataManager::setup()
|
||||
//isPublisher0DataReceived = false;
|
||||
//isPublisher1DataReceived = false;
|
||||
|
||||
nameConcat = " dev";
|
||||
nameConcat = "";
|
||||
|
||||
setupSpacebrew();
|
||||
|
||||
@@ -39,6 +39,9 @@ void DataManager::setupSpacebrew()
|
||||
string name = "Active Tripod " + ofToString(appId) + nameConcat;
|
||||
string description = "Description goes here. Not sure why. Let me know if you see this and tell me if you need it";
|
||||
|
||||
spacebrew.setAutoReconnect(true);
|
||||
spacebrew.setReconnectRate(reconnectFrequency);
|
||||
|
||||
spacebrew.addSubscribe(publisher0Name, Spacebrew::TYPE_STRING);
|
||||
spacebrew.addSubscribe(publisher1Name, Spacebrew::TYPE_STRING);
|
||||
spacebrew.connect( host, name, description );
|
||||
|
||||
@@ -51,6 +51,8 @@ class DataManager
|
||||
//bool isPublisher0DataReceived;
|
||||
//bool isPublisher1DataReceived;
|
||||
|
||||
float reconnectFrequency;
|
||||
|
||||
bool isDataSimulated;
|
||||
float perlinXScale;
|
||||
float perlinYScale;
|
||||
|
||||
@@ -90,6 +90,9 @@ void GUI::addGraphGlobalGUI()
|
||||
gui->addSlider("Graph Text RectBlue", 0, 255, &app->scene.graphTextRectCol[2], length, dim);
|
||||
gui->addSlider("Graph Text RectAlpha", 0, 255, &app->scene.graphTextRectCol[3], length, dim);
|
||||
|
||||
gui->addSpacer(length, 1);
|
||||
gui->addSlider("Reconnect Frequency", 1000, 60000, &app->dataManager.reconnectFrequency, length, dim);
|
||||
|
||||
ofAddListener(gui->newGUIEvent, this, &GUI::graphGlobalGUIEvent);
|
||||
finaliseCanvas(gui, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user