-
Notifications
You must be signed in to change notification settings - Fork 0
/
manager.cpp
87 lines (71 loc) · 3.47 KB
/
manager.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
78
79
80
81
82
83
84
85
86
87
/* SPDX-License-Identifier: GPLv3-or-later */
/* Copyright (c) 2019 Project WomoLIN */
/* Author Myron Franze <[email protected]> */
#include "manager.h"
#include <iostream>
namespace pcsim
{
CManager::CManager( )
: CHal()
, siguni::CManagerBase( GetHandleControlbus() )
{
// signal vector versions
signalVector["GetHwBoardVersion"] = &GetHwBoardVersion;
signalVector["GetDriverVersion"] = &GetDriverVersion;
// signal vector birelays
signalVector["SetResetBirelayK1"] = &SetResetBirelayK1;
signalVector["SetResetBirelayK2"] = &SetResetBirelayK2;
signalVector["SetResetBirelayK3"] = &SetResetBirelayK3;
signalVector["SetResetBirelayK4"] = &SetResetBirelayK4;
signalVector["GetBirelayK1"] = &GetBirelayK1;
signalVector["GetBirelayK2"] = &GetBirelayK2;
signalVector["GetBirelayK3"] = &GetBirelayK3;
signalVector["GetBirelayK4"] = &GetBirelayK4;
// signal vector external relays
signalVector["SetResetExtRelay1"] = &SetResetExtRelay1;
signalVector["SetResetExtRelay2"] = &SetResetExtRelay2;
signalVector["SetResetExtRelay3"] = &SetResetExtRelay3;
signalVector["SetResetExtRelay4"] = &SetResetExtRelay4;
signalVector["SetResetExtRelay5"] = &SetResetExtRelay5;
signalVector["SetResetExtRelay6"] = &SetResetExtRelay6;
signalVector["SetResetExtRelay7"] = &SetResetExtRelay7;
signalVector["SetResetExtRelay8"] = &SetResetExtRelay8;
signalVector["GetExtRelay1"] = &GetExtRelay1;
signalVector["GetExtRelay2"] = &GetExtRelay2;
signalVector["GetExtRelay3"] = &GetExtRelay3;
signalVector["GetExtRelay4"] = &GetExtRelay4;
signalVector["GetExtRelay5"] = &GetExtRelay5;
signalVector["GetExtRelay6"] = &GetExtRelay6;
signalVector["GetExtRelay7"] = &GetExtRelay7;
signalVector["GetExtRelay8"] = &GetExtRelay8;
// connect versions
GetHwBoardVersion.AddUnit( &UnitInputGetHwBoardVersion );
GetDriverVersion.AddUnit( &UnitInputGetDriverVersion );
// connect birelays
SetResetBirelayK1.AddUnit( &UnitOutputSetResetBirelayK1 );
SetResetBirelayK2.AddUnit( &UnitOutputSetResetBirelayK2 );
SetResetBirelayK3.AddUnit( &UnitOutputSetResetBirelayK3 );
SetResetBirelayK4.AddUnit( &UnitOutputSetResetBirelayK4 );
GetBirelayK1.AddUnit( &UnitInputGetBirelayK1 );
GetBirelayK2.AddUnit( &UnitInputGetBirelayK2 );
GetBirelayK3.AddUnit( &UnitInputGetBirelayK3 );
GetBirelayK4.AddUnit( &UnitInputGetBirelayK4 );
// connect external relays
SetResetExtRelay1.AddUnit( &UnitOutputSetResetExtRelay1 );
SetResetExtRelay2.AddUnit( &UnitOutputSetResetExtRelay2 );
SetResetExtRelay3.AddUnit( &UnitOutputSetResetExtRelay3 );
SetResetExtRelay4.AddUnit( &UnitOutputSetResetExtRelay4 );
SetResetExtRelay5.AddUnit( &UnitOutputSetResetExtRelay5 );
SetResetExtRelay6.AddUnit( &UnitOutputSetResetExtRelay6 );
SetResetExtRelay7.AddUnit( &UnitOutputSetResetExtRelay7 );
SetResetExtRelay8.AddUnit( &UnitOutputSetResetExtRelay8 );
GetExtRelay1.AddUnit( &UnitInputGetExtRelay1 );
GetExtRelay2.AddUnit( &UnitInputGetExtRelay2 );
GetExtRelay3.AddUnit( &UnitInputGetExtRelay3 );
GetExtRelay4.AddUnit( &UnitInputGetExtRelay4 );
GetExtRelay5.AddUnit( &UnitInputGetExtRelay5 );
GetExtRelay6.AddUnit( &UnitInputGetExtRelay6 );
GetExtRelay7.AddUnit( &UnitInputGetExtRelay7 );
GetExtRelay8.AddUnit( &UnitInputGetExtRelay8 );
}
}