change display
This commit is contained in:
parent
8027708b3e
commit
503e90b95a
2 changed files with 22 additions and 6 deletions
|
@ -11,6 +11,10 @@ static const double TimeBaseSteps [] = {
|
|||
2.0e-6, 5.0e-6, 1.0e-5, 2.0e-5, 5.0e-5, 1.0e-4, 2.0e-4, 5.0e-4, 1.0e-3,
|
||||
2.0e-3, 5.0e-3, 1.0e-2, 2.0e-2, 5.0e-2, 1.0e-1, 2.0e-1, 5.0e-1, 1.0,
|
||||
};
|
||||
static const int TimeBaseCounts [] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 10,
|
||||
5, 2, 1, 1, 1, 1, 1, 1, 1,
|
||||
};
|
||||
static const double ChannelsSteps [] = {
|
||||
0.1, 0.2, 0.5,
|
||||
1.0, 2.0, 5.0,
|
||||
|
@ -42,6 +46,8 @@ DisplayWidget::DisplayWidget(QWidget * p) : QWidget(p), pcol(), ACopy(), BCopy()
|
|||
n = 0;
|
||||
for (QPointF & e : ChB) { const QPointF p (n++, 0); e = p; }
|
||||
m_continual = false;
|
||||
m_cont_limit = 0;
|
||||
m_cont_pass = 0;
|
||||
}
|
||||
DisplayWidget::~DisplayWidget() {
|
||||
}
|
||||
|
@ -189,10 +195,9 @@ void DisplayWidget::setTrigger(TrigerSettings * ts) {
|
|||
void DisplayWidget::DispChannels(QVector<int> cha, QVector<int> chb) {
|
||||
ACopy = cha;
|
||||
BCopy = chb;
|
||||
reloadData();
|
||||
update();
|
||||
if (reloadData()) update();
|
||||
}
|
||||
void DisplayWidget::reloadData () {
|
||||
bool DisplayWidget::reloadData () {
|
||||
const size_t Alen = ACopy.size();
|
||||
const size_t Blen = BCopy.size();
|
||||
const size_t Amin = Alen < T_SIZE ? Alen : T_SIZE;
|
||||
|
@ -204,7 +209,13 @@ void DisplayWidget::reloadData () {
|
|||
ChB[m_timeCount] = ptb;
|
||||
m_timeCount += 1u;
|
||||
m_timeCount &= T_MASK;
|
||||
return;
|
||||
m_cont_pass += 1;
|
||||
if (m_cont_pass >= m_cont_limit) {
|
||||
m_cont_pass = 0;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
m_continual = false;
|
||||
for (unsigned n=0u; n<Amin; n++) {
|
||||
|
@ -220,6 +231,7 @@ void DisplayWidget::reloadData () {
|
|||
x_lenght = l;
|
||||
reloadMatrix (size());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
void DisplayWidget::reloadMatrix(const QSize & sz) {
|
||||
const double xm = sz.width();
|
||||
|
@ -232,6 +244,8 @@ void DisplayWidget::reloadMatrix(const QSize & sz) {
|
|||
}
|
||||
void DisplayWidget::TimeBaseRange(int n) {
|
||||
m_timeBase = n;
|
||||
m_cont_limit = TimeBaseCounts [m_timeBase];
|
||||
//qDebug("count = %d", m_cont_limit);
|
||||
reloadMatrix (size());
|
||||
drawBackground();
|
||||
update();
|
||||
|
|
|
@ -46,6 +46,8 @@ class DisplayWidget : public QWidget {
|
|||
} marker_type;
|
||||
unsigned m_timeCount;
|
||||
bool m_continual;
|
||||
int m_cont_limit;
|
||||
int m_cont_pass;
|
||||
public:
|
||||
explicit DisplayWidget (QWidget * p);
|
||||
virtual ~DisplayWidget ();
|
||||
|
@ -71,7 +73,7 @@ class DisplayWidget : public QWidget {
|
|||
protected:
|
||||
void drawCurrent (QPainter & p);
|
||||
void drawBackground ();
|
||||
void reloadData ();
|
||||
bool reloadData ();
|
||||
void reloadMatrix (const QSize & sz);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue