Decimal point count configurable in GUI...
... See Graph Global power
This commit is contained in:
parent
962250b98a
commit
8c4e4236bc
Binary file not shown.
@ -29,6 +29,11 @@
|
|||||||
<Name>Size</Name>
|
<Name>Size</Name>
|
||||||
<Value>29.424343109</Value>
|
<Value>29.424343109</Value>
|
||||||
</Widget>
|
</Widget>
|
||||||
|
<Widget>
|
||||||
|
<Kind>4</Kind>
|
||||||
|
<Name>Decimal points (All)</Name>
|
||||||
|
<Value>2.924342155</Value>
|
||||||
|
</Widget>
|
||||||
<Widget>
|
<Widget>
|
||||||
<Kind>4</Kind>
|
<Kind>4</Kind>
|
||||||
<Name>Red</Name>
|
<Name>Red</Name>
|
||||||
|
|||||||
@ -75,6 +75,7 @@ void GUI::addGraphGlobalGUI()
|
|||||||
gui->addLabel("GRAPH TEXT");
|
gui->addLabel("GRAPH TEXT");
|
||||||
gui->addSpacer(length, 1);
|
gui->addSpacer(length, 1);
|
||||||
gui->addSlider("Size", 5, 50, &app->scene.graphTextSize, length, dim);
|
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("Red", 0, 255, &app->scene.graphTextColour[0], length, dim);
|
||||||
gui->addSlider("Green", 0, 255, &app->scene.graphTextColour[1], length, dim);
|
gui->addSlider("Green", 0, 255, &app->scene.graphTextColour[1], length, dim);
|
||||||
gui->addSlider("Blue", 0, 255, &app->scene.graphTextColour[2], length, dim);
|
gui->addSlider("Blue", 0, 255, &app->scene.graphTextColour[2], length, dim);
|
||||||
|
|||||||
@ -86,8 +86,8 @@ void Scene::drawGraphValues()
|
|||||||
val1 = activeGraph->graphTextPnt1;
|
val1 = activeGraph->graphTextPnt1;
|
||||||
}
|
}
|
||||||
|
|
||||||
string stringVal0 = reduceDecimalCount(activeGraph->publisher0Data.back().stringValue, 4);
|
string stringVal0 = reduceDecimalCount(activeGraph->publisher0Data.back().stringValue, valDecimalPoints);
|
||||||
string stringVal1 = reduceDecimalCount(activeGraph->publisher1Data.back().stringValue, 4);
|
string stringVal1 = reduceDecimalCount(activeGraph->publisher1Data.back().stringValue, valDecimalPoints);
|
||||||
|
|
||||||
ofPushStyle();
|
ofPushStyle();
|
||||||
text.setAlignment(FTGL_ALIGN_LEFT);
|
text.setAlignment(FTGL_ALIGN_LEFT);
|
||||||
@ -171,8 +171,8 @@ void Scene::drawHUDCopy()
|
|||||||
|
|
||||||
if (activeGraph->publisher0Data.size() == 0) return;
|
if (activeGraph->publisher0Data.size() == 0) return;
|
||||||
|
|
||||||
string stringVal0 = reduceDecimalCount(activeGraph->publisher0Data.back().stringValue, 4);
|
string stringVal0 = reduceDecimalCount(activeGraph->publisher0Data.back().stringValue, valDecimalPoints);
|
||||||
string stringVal1 = reduceDecimalCount(activeGraph->publisher1Data.back().stringValue, 4);
|
string stringVal1 = reduceDecimalCount(activeGraph->publisher1Data.back().stringValue, valDecimalPoints);
|
||||||
|
|
||||||
|
|
||||||
int amountToAverage = MIN(p0Data->size(), averageAmount);
|
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" +
|
blStr = "Increase: " + ofToString(p0Data->back().value - p0Data->at(p0Data->size() - 2).value) + "\n" +
|
||||||
"Current Value: " + stringVal0 + "\n" +
|
"Current Value: " + stringVal0 + "\n" +
|
||||||
"Running average: " + reduceDecimalCount(valueWithCommas, 4);
|
"Running average: " + reduceDecimalCount(valueWithCommas, valDecimalPoints);
|
||||||
drawTextBox(blStr, "BOTTOM LEFT");
|
drawTextBox(blStr, "BOTTOM LEFT");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -203,7 +203,7 @@ void Scene::drawHUDCopy()
|
|||||||
|
|
||||||
blStr = "Increase: " + ofToString(p0Data->back().value - p0Data->at(p0Data->size() - 2).value) + "\n" +
|
blStr = "Increase: " + ofToString(p0Data->back().value - p0Data->at(p0Data->size() - 2).value) + "\n" +
|
||||||
"Current Value: " + stringVal0 + "\n" +
|
"Current Value: " + stringVal0 + "\n" +
|
||||||
"Running average: " + reduceDecimalCount(valueWithCommas, 4);
|
"Running average: " + reduceDecimalCount(valueWithCommas, valDecimalPoints);
|
||||||
drawTextBox(blStr, "BOTTOM LEFT");
|
drawTextBox(blStr, "BOTTOM LEFT");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ void Scene::drawHUDCopy()
|
|||||||
|
|
||||||
brStr = "Increase: " + ofToString(p1Data->back().value - p1Data->at(p1Data->size() - 2).value) + "\n" +
|
brStr = "Increase: " + ofToString(p1Data->back().value - p1Data->at(p1Data->size() - 2).value) + "\n" +
|
||||||
"Current Value: " + stringVal1 + "\n" +
|
"Current Value: " + stringVal1 + "\n" +
|
||||||
"Running average: " + reduceDecimalCount(valueWithCommas, 4);
|
"Running average: " + reduceDecimalCount(valueWithCommas, valDecimalPoints);
|
||||||
drawTextBox(brStr, "BOTTOM RIGHT");
|
drawTextBox(brStr, "BOTTOM RIGHT");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -233,7 +233,7 @@ void Scene::drawHUDCopy()
|
|||||||
|
|
||||||
brStr = "Increase: " + ofToString(p1Data->back().value - p1Data->at(p1Data->size() - 2).value) + "\n" +
|
brStr = "Increase: " + ofToString(p1Data->back().value - p1Data->at(p1Data->size() - 2).value) + "\n" +
|
||||||
"Current Value: " + stringVal1 + "\n" +
|
"Current Value: " + stringVal1 + "\n" +
|
||||||
"Running average: " + reduceDecimalCount(valueWithCommas, 4);
|
"Running average: " + reduceDecimalCount(valueWithCommas, valDecimalPoints);
|
||||||
drawTextBox(brStr, "BOTTOM RIGHT");
|
drawTextBox(brStr, "BOTTOM RIGHT");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -319,8 +319,8 @@ void Scene::addNewData(vector<DataObject> newData)
|
|||||||
bodyGraph.addNewData(newData);
|
bodyGraph.addNewData(newData);
|
||||||
separateBodyGraph.addNewData(newData);
|
separateBodyGraph.addNewData(newData);
|
||||||
|
|
||||||
tlStr = newData[0].info + newData[0].unitMeasure + "\n" + reduceDecimalCount(ofToString(newData[0].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), 4);
|
trStr = newData[1].info + newData[1].unitMeasure + "\n" + reduceDecimalCount(ofToString(newData[1].stringValue), valDecimalPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -93,4 +93,6 @@ public:
|
|||||||
float topColourBoxXOffset;
|
float topColourBoxXOffset;
|
||||||
float bottomColourBoxXOffset;
|
float bottomColourBoxXOffset;
|
||||||
float colourBoxThickness;
|
float colourBoxThickness;
|
||||||
|
|
||||||
|
float valDecimalPoints;
|
||||||
};
|
};
|
||||||
Loading…
x
Reference in New Issue
Block a user