forked from ChrisVeigl/BrainBay
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ob_array3600.h
67 lines (44 loc) · 1.74 KB
/
ob_array3600.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
/* -----------------------------------------------------------------------------
BrainBay Version 1.7, GPL 2003-2010, contact: chris@shifz.org
MODULE: OB_ARRAY3600.H: declarations for the ARRAY Power Supply Controller
Authors: Chris Veigl, Gerhard Nussbaum
The ARRAY Power Supply Controller Object can be used to write Bytes to an
Array 3600 remote controllable Power Supply via a Com-Port.
Maximum values for Voltage, Current and Power can be specified,
Voltage can be adjusted periodically according to the element's input values.
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; See the
GNU General Public License for more details.
-----------------------------------------------------------------------------*/
#include "brainBay.h"
class ARRAY3600OBJ : public BASE_CL
{
private:
float cnt;
public:
float input1;
HANDLE comdev;
unsigned int baudrate,comport,connected;
int periodic;
int period;
int maxcurrent,maxvoltage,maxpower,voltage,address;
DWORD dwWritten;
byte getCheckByte(byte * command);
byte getHighByte(int val);
byte getLowByte(int val);
void setToSelfControl();
void setToPcControlOn();
void setToPcControlOff();
void setParameters(byte address, int maxI, int maxU, int maxP, int u);
BOOL ARRAY3600OBJ::SetupComPort(int port);
BOOL ARRAY3600OBJ::WriteComPort(HANDLE device, unsigned char * data, unsigned int len);
BOOL ARRAY3600OBJ::BreakDownComPort(void);
ARRAY3600OBJ(int num);
void make_dialog(void);
void load(HANDLE hFile);
void save(HANDLE hFile);
void incoming_data(int port, float value);
void work(void);
~ARRAY3600OBJ();
};