kopia lustrzana https://gitlab.com/Teuniz/DSRemote
Work in progress.
rodzic
1d03554fc5
commit
0df109e9d5
|
@ -1091,8 +1091,6 @@ void UI_Mainwindow::ch1ButtonClicked()
|
|||
else
|
||||
{
|
||||
devparms.activechannel = 0;
|
||||
|
||||
chan_menu(ch1Button->mapToGlobal(QPoint(0,0)));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1135,8 +1133,6 @@ void UI_Mainwindow::ch2ButtonClicked()
|
|||
else
|
||||
{
|
||||
devparms.activechannel = 1;
|
||||
|
||||
chan_menu(ch2Button->mapToGlobal(QPoint(0,0)));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1179,8 +1175,6 @@ void UI_Mainwindow::ch3ButtonClicked()
|
|||
else
|
||||
{
|
||||
devparms.activechannel = 2;
|
||||
|
||||
chan_menu(ch3Button->mapToGlobal(QPoint(0,0)));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1223,8 +1217,6 @@ void UI_Mainwindow::ch4ButtonClicked()
|
|||
else
|
||||
{
|
||||
devparms.activechannel = 3;
|
||||
|
||||
chan_menu(ch4Button->mapToGlobal(QPoint(0,0)));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1240,13 +1232,18 @@ void UI_Mainwindow::ch4ButtonClicked()
|
|||
}
|
||||
|
||||
|
||||
void UI_Mainwindow::chan_menu(QPoint xy_pos)
|
||||
void UI_Mainwindow::chan_menu()
|
||||
{
|
||||
QMenu menu,
|
||||
submenubwl,
|
||||
submenucoupling,
|
||||
submenuinvert;
|
||||
|
||||
if((devparms.activechannel < 0) || (devparms.activechannel > MAX_CHNS))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
submenucoupling.setTitle("Coupling");
|
||||
submenucoupling.addAction("AC", this, SLOT(chan_coupling_ac()));
|
||||
submenucoupling.addAction("DC", this, SLOT(chan_coupling_dc()));
|
||||
|
@ -1264,7 +1261,7 @@ void UI_Mainwindow::chan_menu(QPoint xy_pos)
|
|||
submenuinvert.addAction("Off", this, SLOT(chan_invert_off()));
|
||||
menu.addMenu(&submenuinvert);
|
||||
|
||||
menu.exec(xy_pos);
|
||||
menu.exec(chanMenuButton->mapToGlobal(QPoint(0,0)));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1344,6 +1341,11 @@ void UI_Mainwindow::chan_invert_on()
|
|||
{
|
||||
char str[128];
|
||||
|
||||
if(!devparms.chaninvert[devparms.activechannel])
|
||||
{
|
||||
devparms.triggeredgelevel[devparms.activechannel] *= -1;
|
||||
}
|
||||
|
||||
devparms.chaninvert[devparms.activechannel] = 1;
|
||||
|
||||
sprintf(str, ":CHAN%i:INV 1", devparms.activechannel + 1);
|
||||
|
@ -1356,6 +1358,11 @@ void UI_Mainwindow::chan_invert_off()
|
|||
{
|
||||
char str[128];
|
||||
|
||||
if(devparms.chaninvert[devparms.activechannel])
|
||||
{
|
||||
devparms.triggeredgelevel[devparms.activechannel] *= -1;
|
||||
}
|
||||
|
||||
devparms.chaninvert[devparms.activechannel] = 0;
|
||||
|
||||
sprintf(str, ":CHAN%i:INV 0", devparms.activechannel + 1);
|
||||
|
|
|
@ -215,7 +215,7 @@ UI_Mainwindow::UI_Mainwindow()
|
|||
horPosDial->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
verticalGrpBox = new QGroupBox("Vertical", DPRwidget);
|
||||
verticalGrpBox->setGeometry(5, 290, 140, 200);
|
||||
verticalGrpBox->setGeometry(5, 290, 140, 255);
|
||||
|
||||
ch1InputLabel = new QLabel(verticalGrpBox);
|
||||
ch1InputLabel->setGeometry(12, 15, 50, 18);
|
||||
|
@ -241,6 +241,9 @@ UI_Mainwindow::UI_Mainwindow()
|
|||
ch4Button = new QPushButton(verticalGrpBox);
|
||||
ch4Button->setGeometry(15, 150, 40, 18);
|
||||
ch4Button->setText("CH4");
|
||||
chanMenuButton = new QPushButton(verticalGrpBox);
|
||||
chanMenuButton->setGeometry(15, 190, 40, 18);
|
||||
chanMenuButton->setText("Menu");
|
||||
vertOffsetLabel = new QLabel(verticalGrpBox);
|
||||
vertOffsetLabel->setGeometry(80, 30, 40, 18);
|
||||
vertOffsetLabel->setStyleSheet("font: 7pt;");
|
||||
|
@ -588,6 +591,7 @@ void UI_Mainwindow::open_connection()
|
|||
connect(ch2Button, SIGNAL(clicked()), this, SLOT(ch2ButtonClicked()));
|
||||
connect(ch3Button, SIGNAL(clicked()), this, SLOT(ch3ButtonClicked()));
|
||||
connect(ch4Button, SIGNAL(clicked()), this, SLOT(ch4ButtonClicked()));
|
||||
connect(chanMenuButton, SIGNAL(clicked()), this, SLOT(chan_menu()));
|
||||
connect(waveForm, SIGNAL(chan1Clicked()), this, SLOT(ch1ButtonClicked()));
|
||||
connect(waveForm, SIGNAL(chan2Clicked()), this, SLOT(ch2ButtonClicked()));
|
||||
connect(waveForm, SIGNAL(chan3Clicked()), this, SLOT(ch3ButtonClicked()));
|
||||
|
|
|
@ -148,6 +148,7 @@ private:
|
|||
*ch2Button,
|
||||
*ch3Button,
|
||||
*ch4Button,
|
||||
*chanMenuButton,
|
||||
*clearButton,
|
||||
*autoButton,
|
||||
*runButton,
|
||||
|
@ -291,7 +292,7 @@ private slots:
|
|||
void chan_invert_on();
|
||||
void chan_invert_off();
|
||||
|
||||
void chan_menu(QPoint);
|
||||
void chan_menu();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *);
|
||||
|
|
|
@ -1058,38 +1058,6 @@ void SignalCurve::mousePressEvent(QMouseEvent *press_event)
|
|||
|
||||
if(press_event->button()==Qt::LeftButton)
|
||||
{
|
||||
if(m_y > (h + 12))
|
||||
{
|
||||
// printf("m_x is: %i m_y is: %i\n", m_x, m_y);
|
||||
|
||||
m_x += bordersize;
|
||||
|
||||
if((m_x > 8) && (m_x < 118))
|
||||
{
|
||||
emit chan1Clicked();
|
||||
}
|
||||
else if((m_x > 133) && (m_x < 243))
|
||||
{
|
||||
emit chan2Clicked();
|
||||
}
|
||||
else if((m_x > 258) && (m_x < 368))
|
||||
{
|
||||
if(devparms->channel_cnt > 2)
|
||||
{
|
||||
emit chan3Clicked();
|
||||
}
|
||||
}
|
||||
else if((m_x > 383) && (m_x < 493))
|
||||
{
|
||||
if(devparms->channel_cnt > 3)
|
||||
{
|
||||
emit chan4Clicked();
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if((m_x > (trig_pos_arrow_pos - 8)) && (m_x < (trig_pos_arrow_pos + 8)) && (m_y > 5) && (m_y < 24))
|
||||
{
|
||||
trig_pos_arrow_moving = 1;
|
||||
|
|
Ładowanie…
Reference in New Issue