-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlptwiniodirectiointerface.cpp
77 lines (62 loc) · 1.38 KB
/
lptwiniodirectiointerface.cpp
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
#include "lptwiniodirectiointerface.h"
LptWinIODirectIOInterface::LptWinIODirectIOInterface()
{
}
void LptWinIODirectIOInterface::setInterface(WinIOLptPortInterface * w)
{
wiop = w;
}
int LptWinIODirectIOInterface::getPortCount()
{
return 3;
}
void LptWinIODirectIOInterface::setPortValue(int no,unsigned char value)
{
if (no == 0) wiop->setDataPins(value);
// if (no == 1)
if (no == 2) wiop->setCtrlPins(value);
}
unsigned char LptWinIODirectIOInterface::getPortValue(int no)
{
if (no == 0) return wiop->getDataPins();
if (no == 1) return wiop->getStatPins();
return 0;
}
void LptWinIODirectIOInterface::setPinMode(int no,int pin,IO_MODE mode)
{
Q_UNUSED(no);
Q_UNUSED(pin);
Q_UNUSED(mode);
}
void LptWinIODirectIOInterface::setPortMode(int no,IO_MODE mode)
{
if (no == 0) wiop->setDataModeIn(mode == IO_MODE_INPUT);
}
void LptWinIODirectIOInterface::setPortName(QString n)
{
wiop->setPortName(n);
}
QString LptWinIODirectIOInterface::getPortName()
{
return wiop->getPortName();
}
QStringList LptWinIODirectIOInterface::getPortList()
{
return wiop->getPortList();
}
bool LptWinIODirectIOInterface::open()
{
return wiop->open();
}
void LptWinIODirectIOInterface::close()
{
wiop->close();
}
bool LptWinIODirectIOInterface::load()
{
return wiop->load();
}
void LptWinIODirectIOInterface::unload()
{
return wiop->unload();
}