From 3067d52e9834b4443b416bd8840565c68eb9ed00 Mon Sep 17 00:00:00 2001 From: James Alliban Date: Sat, 11 Jan 2014 06:13:04 +0000 Subject: [PATCH] New data timing now configurable - There is a slider for each graph that allows you to specify how often (in seconds) new data should appear. The amount of time it takes to fill the screen is displayed when the GUI is open --- of/Active Tripod/bin/Active_Tripod.lib | Bin 78700 -> 78700 bytes .../GUI/BAR GRAPH DESIGNguiPagesettings.xml | 9 +++++++-- .../GUI/BODY GRAPH DESIGNguiPagesettings.xml | 9 +++++++-- .../data/GUI/GRAPH GLOBALguiPagesettings.xml | 4 ++-- .../data/GUI/SIMULATIONguiPagesettings.xml | 2 +- of/Active Tripod/src/data/DataManager.cpp | 19 +++++++++++++----- of/Active Tripod/src/data/DataManager.h | 12 ++++++----- of/Active Tripod/src/gui/GUI.cpp | 2 ++ of/Active Tripod/src/testApp.cpp | 5 ++++- of/Active Tripod/src/visual/Scene.cpp | 7 +++++++ of/Active Tripod/src/visual/Scene.h | 2 ++ .../src/visual/graph/AbstractGraph.cpp | 12 ++++++++--- .../src/visual/graph/AbstractGraph.h | 7 ++++++- .../src/visual/graph/BarGraph.cpp | 14 +++++++++---- of/Active Tripod/src/visual/graph/BarGraph.h | 7 ++++--- .../src/visual/graph/BodyGraph.cpp | 15 +++++++++++--- of/Active Tripod/src/visual/graph/BodyGraph.h | 4 ++++ 17 files changed, 98 insertions(+), 32 deletions(-) diff --git a/of/Active Tripod/bin/Active_Tripod.lib b/of/Active Tripod/bin/Active_Tripod.lib index 66a1d2fd6efdfcd2ef1fe50cf72f993822ffa5b8..d300a2151735386f38ec5974b9775e6a7bdb6c99 100644 GIT binary patch delta 7034 zcmZ`-dvKK170-=J5;h@OvdQk|1qqOZggiEhL1vax^}$79Iu!+|7KO1!vRgJeesIAdUX|1Wydg4sz?yO zW=iBHxNS{_CN5m_6C&nsC{5A2i{j$q;^UIyVD8Ke@U#|N8N6gxtHZA^*w;$8%KRjw zXVQ~blg#QjP-gp+R~f>iYw>^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1?oXG?i&&#(3(BKK^m%lm;`K9cNR|~x z^W9TSd{-*I4CeE|gk=G_-SUz>SbMtGGc{u#+%VrOQ==4P@hl%JZl^(HZPBijmWT$I zu61krwh}RmfRxH_a;Ysp&VXjzRcZmi>{{}gaXeMIa<`6SQDwBuDKjd{ diff --git a/of/Active Tripod/bin/data/GUI/BAR GRAPH DESIGNguiPagesettings.xml b/of/Active Tripod/bin/data/GUI/BAR GRAPH DESIGNguiPagesettings.xml index 1828f4f..1380609 100644 --- a/of/Active Tripod/bin/data/GUI/BAR GRAPH DESIGNguiPagesettings.xml +++ b/of/Active Tripod/bin/data/GUI/BAR GRAPH DESIGNguiPagesettings.xml @@ -1,18 +1,23 @@ 4 Graph Item X Gap - 13.733552933 + 11.809210777 4 BarWidth - 8.157895088 + 5.631578922 4 Graph Height Max 440.460510254 + + 4 + Data send speed (seconds) + 4.944078445 + 4 Data0 red diff --git a/of/Active Tripod/bin/data/GUI/BODY GRAPH DESIGNguiPagesettings.xml b/of/Active Tripod/bin/data/GUI/BODY GRAPH DESIGNguiPagesettings.xml index ab8a49f..d575b63 100644 --- a/of/Active Tripod/bin/data/GUI/BODY GRAPH DESIGNguiPagesettings.xml +++ b/of/Active Tripod/bin/data/GUI/BODY GRAPH DESIGNguiPagesettings.xml @@ -11,18 +11,23 @@ 4 Graph Item X Gap - 7.220395088 + 6.332236767 4 Line width - 7.286184311 + 6.157894611 4 Graph Height Max 443.421051025 + + 4 + Data send speed (seconds) + 4.027631760 + 4 Data0 red diff --git a/of/Active Tripod/bin/data/GUI/GRAPH GLOBALguiPagesettings.xml b/of/Active Tripod/bin/data/GUI/GRAPH GLOBALguiPagesettings.xml index 8a017a7..c6f6fce 100644 --- a/of/Active Tripod/bin/data/GUI/GRAPH GLOBALguiPagesettings.xml +++ b/of/Active Tripod/bin/data/GUI/GRAPH GLOBALguiPagesettings.xml @@ -1,12 +1,12 @@ 2 Bar graph - 0 + 1 2 Solid Body graph - 1 + 0 2 diff --git a/of/Active Tripod/bin/data/GUI/SIMULATIONguiPagesettings.xml b/of/Active Tripod/bin/data/GUI/SIMULATIONguiPagesettings.xml index 65a6ee7..1908c35 100644 --- a/of/Active Tripod/bin/data/GUI/SIMULATIONguiPagesettings.xml +++ b/of/Active Tripod/bin/data/GUI/SIMULATIONguiPagesettings.xml @@ -1,7 +1,7 @@ 2 Toggle Data Simulation - 1 + 0 4 diff --git a/of/Active Tripod/src/data/DataManager.cpp b/of/Active Tripod/src/data/DataManager.cpp index ca14807..3181095 100644 --- a/of/Active Tripod/src/data/DataManager.cpp +++ b/of/Active Tripod/src/data/DataManager.cpp @@ -21,10 +21,12 @@ void DataManager::setup() newData.resize(2); - isPublisher0DataReceived = false; - isPublisher1DataReceived = false; + //isPublisher0DataReceived = false; + //isPublisher1DataReceived = false; setupSpacebrew(); + + nextDataSendTime = 0.1; } @@ -73,11 +75,18 @@ void DataManager::update() } else { - if (isPublisher0DataReceived && isPublisher1DataReceived) + /*if (isPublisher0DataReceived && isPublisher1DataReceived) { isPublisher0DataReceived = false; isPublisher1DataReceived = false; app->scene.addNewData(newData); + }*/ + + //sendDataSpeed = app->scene.activeGraph->sendDataSpeed; + if (ofGetElapsedTimef() >= nextDataSendTime + app->scene.activeGraph->sendDataSpeed) + { + nextDataSendTime += app->scene.activeGraph->sendDataSpeed; + app->scene.addNewData(newData); } } } @@ -132,12 +141,12 @@ void DataManager::onMessage( Spacebrew::Message & m ) if (m.name == publisher0Name) { - isPublisher0DataReceived = true; + //isPublisher0DataReceived = true; newData[0] = dataObject; } else if (m.name == publisher1Name) { - isPublisher1DataReceived = true; + //isPublisher1DataReceived = true; newData[1] = dataObject; } } diff --git a/of/Active Tripod/src/data/DataManager.h b/of/Active Tripod/src/data/DataManager.h index 4b17903..87f8daa 100644 --- a/of/Active Tripod/src/data/DataManager.h +++ b/of/Active Tripod/src/data/DataManager.h @@ -26,6 +26,9 @@ class DataManager void update(); void draw(); vector explode( const string &delimiter, const string &str); + + // listen to spacebrew Messages + void onMessage( Spacebrew::Message & m ); testApp* app; @@ -39,14 +42,13 @@ class DataManager vector newData; - bool isPublisher0DataReceived; - bool isPublisher1DataReceived; + //bool isPublisher0DataReceived; + //bool isPublisher1DataReceived; bool isDataSimulated; float perlinXScale; float perlinYScale; float simulationSpeed; - - // listen to spacebrew Messages - void onMessage( Spacebrew::Message & m ); + + float nextDataSendTime; }; diff --git a/of/Active Tripod/src/gui/GUI.cpp b/of/Active Tripod/src/gui/GUI.cpp index ea2c87a..a5687b1 100644 --- a/of/Active Tripod/src/gui/GUI.cpp +++ b/of/Active Tripod/src/gui/GUI.cpp @@ -81,6 +81,7 @@ void GUI::addBarGraphDesignGUI() gui->addSlider("Graph Item X Gap", 5, 50, &app->scene.barGraph.graphItemXGap, length, dim); gui->addSlider("BarWidth", 2, 50, &app->scene.barGraph.barWidth, length, dim); gui->addSlider("Graph Height Max", 100, 1000, &app->scene.barGraph.graphHeightMax, length, dim); + gui->addSlider("Data send speed (seconds)", 0.1, 20, &app->scene.barGraph.sendDataSpeed, length, dim); gui->addSpacer(length, 1); gui->addSlider("Data0 red", 0, 255, &app->scene.barGraph.col0[0], length, dim); @@ -108,6 +109,7 @@ void GUI::addBodyGraphDesignGUI() gui->addSlider("Graph Item X Gap", 5, 50, &app->scene.bodyGraph.graphItemXGap, length, dim); gui->addSlider("Line width", 1, 50, &app->scene.bodyGraph.lineWidth, length, dim); gui->addSlider("Graph Height Max", 100, 1000, &app->scene.bodyGraph.graphHeightMax, length, dim); + gui->addSlider("Data send speed (seconds)", 0.1, 20, &app->scene.bodyGraph.sendDataSpeed, length, dim); gui->addSpacer(length, 1); gui->addSlider("Data0 red", 0, 255, &app->scene.bodyGraph.col0[0], length, dim); diff --git a/of/Active Tripod/src/testApp.cpp b/of/Active Tripod/src/testApp.cpp index e9d7190..45a161b 100644 --- a/of/Active Tripod/src/testApp.cpp +++ b/of/Active Tripod/src/testApp.cpp @@ -2,13 +2,13 @@ // TODO // ==== -// - Add option to resize video draw size (rather than making it fullscreen) and init size // - Make system to slow down data - The screen should show 15-20 minutes worth of data // - Make 3rd graph - separate fade // - Crosshairs in HUD // - Create graph animation system // - Create a single config file to be loaded from online location. It will contain IP address and host name // - Add 'clear all data' button to UI +// - If min or max values change - clear graph - ask bout this // //-------------------------------------------------------------- void testApp::setup() @@ -35,6 +35,7 @@ void testApp::update() dataManager.update(); scene.update(); + //if (gui.isVisible()) } @@ -57,6 +58,8 @@ void testApp::keyPressed(int key) isPaused = !isPaused; else if (key == 'f') ofToggleFullscreen(); + else if (key == 'c') + scene.clearGraphData(); scene.keyPressed(key); } diff --git a/of/Active Tripod/src/visual/Scene.cpp b/of/Active Tripod/src/visual/Scene.cpp index c4c6c70..ebfb0dc 100644 --- a/of/Active Tripod/src/visual/Scene.cpp +++ b/of/Active Tripod/src/visual/Scene.cpp @@ -208,4 +208,11 @@ void Scene::addNewData(vector newData) void Scene::keyPressed(int key) { +} + + +void Scene::clearGraphData() +{ + barGraph.clear(); + bodyGraph.clear(); } \ No newline at end of file diff --git a/of/Active Tripod/src/visual/Scene.h b/of/Active Tripod/src/visual/Scene.h index 23681c0..062c44c 100644 --- a/of/Active Tripod/src/visual/Scene.h +++ b/of/Active Tripod/src/visual/Scene.h @@ -28,7 +28,9 @@ public: void drawHUDColourBars(); void drawTextBox(string copy, string align); void addNewData(vector newData); + void clearGraphData(); void keyPressed(int key); + BarGraph barGraph; BodyGraph bodyGraph; diff --git a/of/Active Tripod/src/visual/graph/AbstractGraph.cpp b/of/Active Tripod/src/visual/graph/AbstractGraph.cpp index 87cff5f..1d744e3 100644 --- a/of/Active Tripod/src/visual/graph/AbstractGraph.cpp +++ b/of/Active Tripod/src/visual/graph/AbstractGraph.cpp @@ -19,7 +19,8 @@ void AbstractGraph::setup() void AbstractGraph::update() { - + maxData = (ofGetWidth() * (AbstractGraph::maxGraphPercent - AbstractGraph::minGraphPercent)) / graphItemXGap; + printf("ofGetWidth():%i, maxData:%i, graphItemXGap:%f, screen active:%f \n", ofGetWidth(), maxData, graphItemXGap, (AbstractGraph::maxGraphPercent - AbstractGraph::minGraphPercent)); } @@ -34,11 +35,16 @@ void AbstractGraph::addNewData(vector newData) publisher0Data.push_back(newData[0]); publisher1Data.push_back(newData[1]); - maxData = (ofGetWidth() / graphItemXGap) * (AbstractGraph::maxGraphPercent - AbstractGraph::minGraphPercent); - while (publisher0Data.size() > maxData && publisher0Data.size() > maxData) { publisher0Data.erase(publisher0Data.begin()); publisher1Data.erase(publisher1Data.begin()); } +} + + +void AbstractGraph::clear() +{ + publisher0Data.clear(); + publisher1Data.clear(); } \ No newline at end of file diff --git a/of/Active Tripod/src/visual/graph/AbstractGraph.h b/of/Active Tripod/src/visual/graph/AbstractGraph.h index 6ad1b01..1cfa3ec 100644 --- a/of/Active Tripod/src/visual/graph/AbstractGraph.h +++ b/of/Active Tripod/src/visual/graph/AbstractGraph.h @@ -11,6 +11,7 @@ #include "ofMain.h" #include "DataManager.h" + class AbstractGraph { public: @@ -18,7 +19,8 @@ public: virtual void update(); virtual void draw(); virtual void addNewData(vector newData); - + void clear(); + vector publisher0Data; vector publisher1Data; int maxData; // calculated from graphWidth and graphItemXGap @@ -33,4 +35,7 @@ public: float col0[4]; float col1[4]; + string graphName; + float sendDataSpeed; + }; \ No newline at end of file diff --git a/of/Active Tripod/src/visual/graph/BarGraph.cpp b/of/Active Tripod/src/visual/graph/BarGraph.cpp index 88ea5ab..d6506d2 100644 --- a/of/Active Tripod/src/visual/graph/BarGraph.cpp +++ b/of/Active Tripod/src/visual/graph/BarGraph.cpp @@ -1,23 +1,29 @@ #include "BarGraph.h" +#include "testApp.h" void BarGraph::setup() { AbstractGraph::setup(); - + app = (testApp*)ofGetAppPtr(); graphItemXGap = 10; + graphName = "BAR"; } void BarGraph::update() { -// if (ofGetFrameNum() % 30 == 0) -// printf("publisher0Data.size():%i \n", publisher0Data.size()); + AbstractGraph::update(); } void BarGraph::draw() { - //printf("BarGraph::draw() - graphItemXGap = %f \n", graphItemXGap); + if (app->gui.getVisible()) + { + int timePerScreenfull = maxData * sendDataSpeed; + ofDrawBitmapString("Time to fill screen:" + ofToString(timePerScreenfull), 500, 150); + } + if (publisher0Data.size() > 1) { diff --git a/of/Active Tripod/src/visual/graph/BarGraph.h b/of/Active Tripod/src/visual/graph/BarGraph.h index 05d0bef..ff94387 100644 --- a/of/Active Tripod/src/visual/graph/BarGraph.h +++ b/of/Active Tripod/src/visual/graph/BarGraph.h @@ -3,6 +3,8 @@ #include "ofMain.h" #include "AbstractGraph.h" +class testApp; + class BarGraph : public AbstractGraph { public: @@ -10,9 +12,8 @@ public: virtual void update(); virtual void draw(); virtual void addNewData(vector newData); + + testApp *app; float barWidth; - - - }; \ No newline at end of file diff --git a/of/Active Tripod/src/visual/graph/BodyGraph.cpp b/of/Active Tripod/src/visual/graph/BodyGraph.cpp index 7aa1527..249bddb 100644 --- a/of/Active Tripod/src/visual/graph/BodyGraph.cpp +++ b/of/Active Tripod/src/visual/graph/BodyGraph.cpp @@ -4,23 +4,32 @@ // #include "BodyGraph.h" +#include "testApp.h" void BodyGraph::setup() { AbstractGraph::setup(); + app = (testApp*)ofGetAppPtr(); + graphName = "BODY"; } void BodyGraph::update() { -// if (ofGetFrameNum() % 30 == 0) -// printf("publisher0Data.size():%i \n", publisher0Data.size()); -} + AbstractGraph::update(); +} void BodyGraph::draw() { + if (app->gui.getVisible()) + { + float timePerScreenfull = (float)maxData * sendDataSpeed; + printf("timePerScreenfull:%f, maxData:%i, sendDataSpeed:%f \n", timePerScreenfull, maxData, sendDataSpeed); + ofDrawBitmapString("Time to fill screen:" + ofToString(timePerScreenfull), 500, 150); + } + if (publisher0Data.size() > 1) { //for (int i = 0; i < publisher0Data.size() - 1; i++) diff --git a/of/Active Tripod/src/visual/graph/BodyGraph.h b/of/Active Tripod/src/visual/graph/BodyGraph.h index f59e781..c6ee976 100644 --- a/of/Active Tripod/src/visual/graph/BodyGraph.h +++ b/of/Active Tripod/src/visual/graph/BodyGraph.h @@ -4,6 +4,8 @@ #include "ofMain.h" #include "AbstractGraph.h" +class testApp; + class BodyGraph : public AbstractGraph { public: @@ -11,6 +13,8 @@ public: virtual void update(); virtual void draw(); virtual void addNewData(vector newData); + + testApp *app; float barWidth; float lineWidth;