Utils is only used within TouchGFX.
 
Symbols
loading...
Files
loading...

Utils class

Syntax

class Utils { public:     static int randomNumberBetween(int lowest, int highest)     { #ifdef SIMULATOR         return (int)(lowest + (highest - lowest) * (rand() / (float)RAND_MAX)); #else         uint32_t random = (touchgfx::HAL::getInstance()->getCPUCycles() * HAL::getInstance()->getCPUCycles());         return lowest + (random % (highest - lowest)); #endif     }     static int reducedPerformance()     {         return false;     } };

Methods

randomNumberBetween()

No summary provided. Read more...

reducedPerformance()

No summary provided. Read more...

References

LocationReferrerText
Utils.hpp:28
class Utils
CustomControlsView.cpp:52CustomControlsView::CustomControlsView()
int numberOfElements = (Utils::reducedPerformance()) ? 3 : 4;
CustomControlsView.cpp:60CustomControlsView::CustomControlsView()
if (!Utils::reducedPerformance())
CustomControlsView.cpp:166CustomControlsView::handleTickEvent()
int newValue = value + Utils::randomNumberBetween(-6, 18);
CustomControlsView.cpp:191CustomControlsView::startThreeWayProgressBarAnimation()
animationDuration[i] = Utils::randomNumberBetween(100, 200);
CustomControlsView.cpp:219CustomControlsView::getRandomEasingEquation()
switch (Utils::randomNumberBetween(0, 6))
CustomControlsView.cpp:350CustomControlsView::screenSaverMinorTick()
if (Utils::randomNumberBetween(0, 100) < 50)
GraphView.cpp:103GraphView::setupScreen()
if (Utils::reducedPerformance())
GraphView.cpp:281GraphView::handleTickEvent()
primaryGraph.addValue(graphX, (int)((CWRUtil::toQ5(150) * CWRUtil::sine(graphX + Utils::randomNumberBetween(-25, 25))).to<int>()) + 200 + Utils::randomNumberBetween(-50, 50));
GraphView.cpp:282GraphView::handleTickEvent()
secondaryGraph.addValue(graphX, (int)((CWRUtil::toQ5(150) * CWRUtil::sine(graphX + 230)).to<int>()) + 200 + Utils::randomNumberBetween(-50, 50));
GraphView.cpp:303GraphView::handleTickEvent()
value1 = Utils::randomNumberBetween(graph1min, graph1max);
GraphView.cpp:304GraphView::handleTickEvent()
value2 = Utils::randomNumberBetween(graph2min, graph2max);
GraphView.cpp:317GraphView::handleTickEvent()
value1 += Utils::randomNumberBetween(-randomMax, randomMax);
GraphView.cpp:318GraphView::handleTickEvent()
value2 += Utils::randomNumberBetween(-randomMax, randomMax);
GraphView.cpp:321GraphView::handleTickEvent()
value1 += Utils::randomNumberBetween(randomMax, 2 * randomMax);
GraphView.cpp:325GraphView::handleTickEvent()
value1 -= Utils::randomNumberBetween(randomMax, 2 * randomMax);
GraphView.cpp:329GraphView::handleTickEvent()
value2 += Utils::randomNumberBetween(randomMax, 2 * randomMax);
GraphView.cpp:333GraphView::handleTickEvent()
value2 -= Utils::randomNumberBetween(randomMax, 2 * randomMax);
GraphView.cpp:569GraphView::resetPieChart()
shares[i] = Utils::randomNumberBetween(10, 100);
GraphView.cpp:747GraphView::screenSaverMajorTick()
if (Utils::randomNumberBetween(0, 100) < 50)