-
Notifications
You must be signed in to change notification settings - Fork 0
/
fsLatencyGui.h
executable file
·102 lines (85 loc) · 3.39 KB
/
fsLatencyGui.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
* spikeFSGUI.cpp: the qt object for user program interfaces
*
* Copyright 2008 Loren M. Frank
*
* This program is part of the nspike data acquisition package.
* nspike is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* nspike is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with nspike; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "fsGUI.h"
LatencyTab::LatencyTab (QWidget *parent)
: QWidget(parent)
{
QString s;
QGridLayout *grid = new QGridLayout(this);
/* grid->addMultiCellWidget(new QLabel("Tetrode / channel", this), 0, 0, 0, 4);
StimChan = new QComboBox( FALSE, this, "Channel Combo Box" );
StimChan->insertStringList(*(daq_io_widget->ChannelStrings));
grid->addMultiCellWidget(StimChan, 0, 0, 3, 3);
connect(StimChan, SIGNAL(activated( int )), daq_io_widget, SLOT(updateChan(int)));
connect(daq_io_widget, SIGNAL(updateChanDisplay(int)), this, SLOT(changeStimChanDisplay(int))); */
triggeredStart = new QPushButton("Start", this);
triggeredStart->setCheckable(TRUE);
triggeredStart->setEnabled(FALSE);
grid->addMultiCellWidget(triggeredStart, 9, 9, 1, 1);
connect(triggeredStart, SIGNAL(toggled(bool)), this,
SLOT(startTest(bool)));
triggeredStop = new QPushButton("Stop", this);
triggeredStop->setCheckable(TRUE);
grid->addMultiCellWidget(triggeredStop, 9, 9, 4, 4);
connect(triggeredStop, SIGNAL(toggled(bool)), this,
SLOT(stopTest(bool)));
grid->addMultiCellWidget(new QLabel("Threshold", this), 7, 7, 0, 2);
thresh = new QSpinBox(this);
thresh->setRange(0, 65535);
thresh->setValue(65535);
grid->addMultiCellWidget(thresh, 7, 7, 3, 3);
connect(thresh, SIGNAL(valueChanged(int)), this, SLOT(updateLatencyData(void)));
}
void LatencyTab::updateLatencyData(void)
{
LatencyTestParameters data;
//daq_io_widget->updateChan(StimChan->currentItem());
data.thresh = thresh->value();
data.pulse_length = 10;
//SendDAQFSMessage(DIO_SET_RT_LATENCY_TEST_PARAMS, (char *) &data, sizeof(LatencyTestParameters));
triggeredStart->setEnabled(TRUE);
}
void LatencyTab::startTest(bool on)
{
if (on) {
updateLatencyData();
//SendDAQFSMessage(DIO_RT_ENABLE, NULL, 0);
SendMessage(digioinfo.outputfd, DIO_LATENCY_TEST_START, NULL, 0);
triggeredStart->setOn(false);
triggeredStart->setPaletteForegroundColor("green");
triggeredStart->setText("Running");
triggeredStop->setPaletteForegroundColor("black");
triggeredStop->setText("Stop");
triggeredStop->setOn(false);
}
}
void LatencyTab::stopTest(bool on)
{
if (on) {
//SendMessage(digioinfo.outputfd, DIO_LATENCY_TEST_STOP, NULL, 0);
//SendDAQFSMessage(DIO_RT_DISABLE, NULL, 0);
triggeredStart->setPaletteForegroundColor("black");
triggeredStart->setText("Start");
triggeredStop->setPaletteForegroundColor("red");
triggeredStop->setText("Stopped");
triggeredStart->setOn(false);
}
}