diff --git a/of/Active Tripod/bin/Active_Tripod.lib b/of/Active Tripod/bin/Active_Tripod.lib index 84ffa71..dcf2061 100644 Binary files a/of/Active Tripod/bin/Active_Tripod.lib and b/of/Active Tripod/bin/Active_Tripod.lib differ diff --git a/of/Active Tripod/bin/data/GUI/GRAPH GLOBALguiPagesettings.xml b/of/Active Tripod/bin/data/GUI/GRAPH GLOBALguiPagesettings.xml index 178e857..b8ddd25 100644 --- a/of/Active Tripod/bin/data/GUI/GRAPH GLOBALguiPagesettings.xml +++ b/of/Active Tripod/bin/data/GUI/GRAPH GLOBALguiPagesettings.xml @@ -29,6 +29,11 @@ Size 29.424343109 + + 4 + Decimal points (All) + 2.924342155 + 4 Red diff --git a/of/Active Tripod/src/gui/GUI.cpp b/of/Active Tripod/src/gui/GUI.cpp index de74c65..5087d98 100644 --- a/of/Active Tripod/src/gui/GUI.cpp +++ b/of/Active Tripod/src/gui/GUI.cpp @@ -75,6 +75,7 @@ void GUI::addGraphGlobalGUI() gui->addLabel("GRAPH TEXT"); gui->addSpacer(length, 1); gui->addSlider("Size", 5, 50, &app->scene.graphTextSize, length, dim); + gui->addSlider("Decimal points (All)", 1, 10, &app->scene.valDecimalPoints, length, dim); gui->addSlider("Red", 0, 255, &app->scene.graphTextColour[0], length, dim); gui->addSlider("Green", 0, 255, &app->scene.graphTextColour[1], length, dim); gui->addSlider("Blue", 0, 255, &app->scene.graphTextColour[2], length, dim); diff --git a/of/Active Tripod/src/visual/Scene.cpp b/of/Active Tripod/src/visual/Scene.cpp index 62b922e..416b55c 100644 --- a/of/Active Tripod/src/visual/Scene.cpp +++ b/of/Active Tripod/src/visual/Scene.cpp @@ -86,8 +86,8 @@ void Scene::drawGraphValues() val1 = activeGraph->graphTextPnt1; } - string stringVal0 = reduceDecimalCount(activeGraph->publisher0Data.back().stringValue, 4); - string stringVal1 = reduceDecimalCount(activeGraph->publisher1Data.back().stringValue, 4); + string stringVal0 = reduceDecimalCount(activeGraph->publisher0Data.back().stringValue, valDecimalPoints); + string stringVal1 = reduceDecimalCount(activeGraph->publisher1Data.back().stringValue, valDecimalPoints); ofPushStyle(); text.setAlignment(FTGL_ALIGN_LEFT); @@ -171,8 +171,8 @@ void Scene::drawHUDCopy() if (activeGraph->publisher0Data.size() == 0) return; - string stringVal0 = reduceDecimalCount(activeGraph->publisher0Data.back().stringValue, 4); - string stringVal1 = reduceDecimalCount(activeGraph->publisher1Data.back().stringValue, 4); + string stringVal0 = reduceDecimalCount(activeGraph->publisher0Data.back().stringValue, valDecimalPoints); + string stringVal1 = reduceDecimalCount(activeGraph->publisher1Data.back().stringValue, valDecimalPoints); int amountToAverage = MIN(p0Data->size(), averageAmount); @@ -189,7 +189,7 @@ void Scene::drawHUDCopy() blStr = "Increase: " + ofToString(p0Data->back().value - p0Data->at(p0Data->size() - 2).value) + "\n" + "Current Value: " + stringVal0 + "\n" + - "Running average: " + reduceDecimalCount(valueWithCommas, 4); + "Running average: " + reduceDecimalCount(valueWithCommas, valDecimalPoints); drawTextBox(blStr, "BOTTOM LEFT"); } else @@ -203,7 +203,7 @@ void Scene::drawHUDCopy() blStr = "Increase: " + ofToString(p0Data->back().value - p0Data->at(p0Data->size() - 2).value) + "\n" + "Current Value: " + stringVal0 + "\n" + - "Running average: " + reduceDecimalCount(valueWithCommas, 4); + "Running average: " + reduceDecimalCount(valueWithCommas, valDecimalPoints); drawTextBox(blStr, "BOTTOM LEFT"); } @@ -219,7 +219,7 @@ void Scene::drawHUDCopy() brStr = "Increase: " + ofToString(p1Data->back().value - p1Data->at(p1Data->size() - 2).value) + "\n" + "Current Value: " + stringVal1 + "\n" + - "Running average: " + reduceDecimalCount(valueWithCommas, 4); + "Running average: " + reduceDecimalCount(valueWithCommas, valDecimalPoints); drawTextBox(brStr, "BOTTOM RIGHT"); } else @@ -233,7 +233,7 @@ void Scene::drawHUDCopy() brStr = "Increase: " + ofToString(p1Data->back().value - p1Data->at(p1Data->size() - 2).value) + "\n" + "Current Value: " + stringVal1 + "\n" + - "Running average: " + reduceDecimalCount(valueWithCommas, 4); + "Running average: " + reduceDecimalCount(valueWithCommas, valDecimalPoints); drawTextBox(brStr, "BOTTOM RIGHT"); } } @@ -319,8 +319,8 @@ void Scene::addNewData(vector newData) bodyGraph.addNewData(newData); separateBodyGraph.addNewData(newData); - tlStr = newData[0].info + newData[0].unitMeasure + "\n" + reduceDecimalCount(ofToString(newData[0].stringValue), 4); - trStr = newData[1].info + newData[1].unitMeasure + "\n" + reduceDecimalCount(ofToString(newData[1].stringValue), 4); + tlStr = newData[0].info + newData[0].unitMeasure + "\n" + reduceDecimalCount(ofToString(newData[0].stringValue), valDecimalPoints); + trStr = newData[1].info + newData[1].unitMeasure + "\n" + reduceDecimalCount(ofToString(newData[1].stringValue), valDecimalPoints); } diff --git a/of/Active Tripod/src/visual/Scene.h b/of/Active Tripod/src/visual/Scene.h index ccbe98c..743baca 100644 --- a/of/Active Tripod/src/visual/Scene.h +++ b/of/Active Tripod/src/visual/Scene.h @@ -93,4 +93,6 @@ public: float topColourBoxXOffset; float bottomColourBoxXOffset; float colourBoxThickness; + + float valDecimalPoints; }; \ No newline at end of file