Skip to content
Snippets Groups Projects
Commit 17c85644 authored by dp3n18's avatar dp3n18
Browse files

final app done with testing functions and strategy

parent 35544923
No related branches found
No related tags found
No related merge requests found
Showing
with 22 additions and 8 deletions
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
File added
File added
File added
File added
No preview for this file type
File added
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.13.3, 2021-03-26T17:24:06. -->
<!-- Written by QtCreator 4.13.3, 2021-03-30T15:36:52. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
......
......@@ -307,10 +307,14 @@ ChartsPage::ChartsPage(bool isSys,bool isFPGA, bool isMbox, bool isCore, bool is
if (this->msentBuffer.size() > 0) {
this->msent = std::accumulate(std::begin(msentBuffer), std::end(msentBuffer), 0.0) / msentBuffer.size();
this->msent = std::accumulate(std::begin(msentBuffer), std::end(msentBuffer), 0.0) / maxValues;
// msentBuffer.enqueue(0); //for constnat data flow. REMOVE IF SENDER IS CONSTANTLY SENDING PACKETS CONSISTENTLY AND EVENLY.
msentBuffer.dequeue();
//msentBuffer.clear();
}
else {
this->msent = 0;
}
......@@ -323,7 +327,9 @@ ChartsPage::ChartsPage(bool isSys,bool isFPGA, bool isMbox, bool isCore, bool is
float ChartsPage::reCalculateReceived() {
recLock.lock();
if (this->mreceivedBuffer.size() >0) {
this->mreceived = std::accumulate(std::begin(mreceivedBuffer), std::end(mreceivedBuffer), 0.0) / mreceivedBuffer.size();
this->mreceived = std::accumulate(std::begin(mreceivedBuffer), std::end(mreceivedBuffer), 0.0) / maxValues;
// msentBuffer.clear();
mreceivedBuffer.dequeue();
}
else {
this->mreceived= 0;
......@@ -337,7 +343,11 @@ ChartsPage::ChartsPage(bool isSys,bool isFPGA, bool isMbox, bool isCore, bool is
//mutex.lock();
chrLock.lock();
if (chrBuffer.size() > 0){
this->chr = std::accumulate(std::begin(chrBuffer), std::end(chrBuffer), 0.0) / chrBuffer.size();
this->chr = std::accumulate(std::begin(chrBuffer), std::end(chrBuffer), 0.0) / maxValues;
//built in for a smooth flow of data...
chrBuffer.dequeue();
}
else {
this->chr = 0;
......@@ -350,7 +360,10 @@ ChartsPage::ChartsPage(bool isSys,bool isFPGA, bool isMbox, bool isCore, bool is
float ChartsPage::reCalculateutil() {
utilLock.lock();
if (this->utilBuffer.size() > 0) {
this->util = std::accumulate(std::begin(utilBuffer), std::end(utilBuffer), 0.0) / utilBuffer.size();
this->util = std::accumulate(std::begin(utilBuffer), std::end(utilBuffer), 0.0) / maxValues;
//utilBuffer.clear();
utilBuffer.dequeue();
}
else {
util = 0;
......
......@@ -200,6 +200,7 @@ for (int c = 0; c < cachecount; c++) {
m->reCalculateSent();
metric = m->msent;
}
else if (metricval == "Messages Received") {
......@@ -485,7 +486,8 @@ xySeries->replace(MchrChartArray);
void DataSource::createChartsPage(bool isSys,bool isFPGA, bool isMbox, bool isCore, bool isThread, int boardX,int boardY,int mboxX,int mboxY,int coreID, int threadID,int maxValues) {
//make new chart
this->c = new ChartsPage(isSys,isFPGA,isMbox,isCore,isThread,boardX,boardY,mboxX,mboxY,coreID,threadID,maxValues);
//max buffer size is 5
this->c = new ChartsPage(isSys,isFPGA,isMbox,isCore,isThread,boardX,boardY,mboxX,mboxY,coreID,threadID,5);
this->ChartsPageInitialise = true;
sender->addChartsPage(c);
......@@ -570,7 +572,7 @@ void DataSource::removePageTwo() {
void DataSource::updatePageTwoSurface(QBar3DSeries *series,int rows, int cols,QString metricval) {
// if surface has finished, there is data, and series is existent.
if (series && ! m_data2.empty() ) {
if (series && !m_data2.empty() ) {
// Each iteration uses data from a different cached array
......
......@@ -92,7 +92,6 @@ public Q_SLOTS:
void updateStackp2(int rows,int cols,QString metricVal);
float getMetricPageTwo(QString metric, int core, int thread);
//page three+
void generatePage3MessagesSent(QAbstractSeries *series,int xmax);
void generatePage3Received(QAbstractSeries *series,int xmax);
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment