mirror of
https://github.com/ChronosX88/nesca.git
synced 2024-11-23 18:52:19 +00:00
Shuffle Viz fix
This commit is contained in:
parent
36f908a204
commit
d39de296e7
32
ColoredIndexBarDrawer.cpp
Normal file
32
ColoredIndexBarDrawer.cpp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#include "ColoredIndexBarDrawer.h"
|
||||||
|
|
||||||
|
int cIndex = 0;
|
||||||
|
|
||||||
|
void ColoredIndexBarDrawer::doEmitionDrawPointerPB2(int pointer)
|
||||||
|
{
|
||||||
|
emit pbTh2->drawPointerPB2(pointer);
|
||||||
|
};
|
||||||
|
|
||||||
|
void ColoredIndexBarDrawer::run()
|
||||||
|
{
|
||||||
|
globalScanFlag = true;
|
||||||
|
int oldPointer = 0;
|
||||||
|
msleep(1000);
|
||||||
|
while (globalScanFlag)
|
||||||
|
{
|
||||||
|
msleep(200);
|
||||||
|
int sz = stt->getColoredIndexes().size();
|
||||||
|
if (sz > 0) {
|
||||||
|
int pointer = 100 * cIndex / sz;
|
||||||
|
|
||||||
|
if (pointer < oldPointer) {
|
||||||
|
oldPointer = 0;
|
||||||
|
}
|
||||||
|
if (pointer > oldPointer) {
|
||||||
|
doEmitionDrawPointerPB2(pointer);
|
||||||
|
oldPointer = pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
msleep(1000);
|
||||||
|
}
|
||||||
|
};
|
20
ColoredIndexBarDrawer.h
Normal file
20
ColoredIndexBarDrawer.h
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#ifndef CIPBD_H
|
||||||
|
#define CIPBD_H
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include "STh.h"
|
||||||
|
#include "externData.h"
|
||||||
|
|
||||||
|
class ColoredIndexBarDrawer : public QThread
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public: signals : void drawPointerPB2(int);
|
||||||
|
public:
|
||||||
|
static void doEmitionDrawPointerPB2(int pointer);
|
||||||
|
protected:
|
||||||
|
void run();
|
||||||
|
};
|
||||||
|
extern ColoredIndexBarDrawer *pbTh2;
|
||||||
|
|
||||||
|
#endif // CIPBD_H
|
Loading…
Reference in New Issue
Block a user