-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclamp-protocol.h
More file actions
124 lines (103 loc) · 3.28 KB
/
clamp-protocol.h
File metadata and controls
124 lines (103 loc) · 3.28 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
* Copyright (C) 2011 Weill Medical College of Cornell University
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#pragma once
#include <fifo.h>
#include <default_gui_model.h>
#include "clamp-protocol-editor.h"
#include "clamp-protocol-window.h"
#include "protocol.h"
namespace ClampProtocolModule {
class ClampProtocol : public DefaultGUIModel {
Q_OBJECT
public:
ClampProtocol(void);
~ClampProtocol(void);
void initParameters(void);
void customizeGUI(void);
void execute(void);
void refresh(void);
void foreignToggleProtocol(bool);
void receiveEvent( const ::Event::Object *);
void receiveEventRT( const ::Event::Object *);
protected:
virtual void update(DefaultGUIModel::update_flags_t);
private:
void doLoad(const Settings::Object::State &);
void doSave(Settings::Object::State &) const;
std::list< ClampProtocolWindow * > plotWindowList;
// QString fileName;
double period;
double voltage, junctionPotential;
double trial, time, sweep, segmentNumber, intervalTime;
int numTrials;
Protocol protocol;
enum executeMode_t { IDLE, PROTOCOL } executeMode;
enum protocolMode_t { SEGMENT, STEP, EXECUTE, END, WAIT } protocolMode;
Step step;
ProtocolStep::stepType_t stepType;
int segmentIdx;
int sweepIdx;
int stepIdx;
int trialIdx;
int numSweeps;
int numSteps;
int stepTime, stepEndTime;
double protocolEndTime;
double stepOutput;
double outputFactor, inputFactor;
double rampIncrement;
double pulseWidth;
int pulseRate;
Fifo fifo;
std::vector<double> data;
double prevSegmentEnd; // Time segment ends after its first sweep
int stepStart; //Time when step starts divided by period
curve_token_t token;
bool recordData;
bool protocolOn;
bool recording;
bool plotting;
QTimer *plotTimer;
QCheckBox *recordCheckBox;
QLineEdit *loadFilePath;
QPushButton *loadButton, *editorButton, *viewerButton, *runProtocolButton;
ClampProtocolWindow *plotWindow;
ClampProtocolEditor *protocolEditor;
friend class ToggleProtocolEvent;
class ToggleProtocolEvent : public RT::Event {
public:
ToggleProtocolEvent(ClampProtocol*, bool, bool);
~ToggleProtocolEvent(void);
int callback(void);
private:
ClampProtocol *parent;
bool protocolOn;
bool recordData;
};
signals:
void plotCurve( double *, curve_token_t );
public slots:
void loadProtocolFile(void);
void openProtocolEditor(void);
void openProtocolWindow(void);
void updateProtocolWindow(void);
void closeProtocolWindow(void);
void closeProtocolEditor(void);
void toggleProtocol(void);
};
}