]> git.mxchange.org Git - flightgear.git/blob - src/Network/ATC-Main.hxx
PLIB net removed from FlightGear
[flightgear.git] / src / Network / ATC-Main.hxx
1 // ATC-Main.hxx -- FGFS interface to ATC 610x hardware
2 //
3 // Written by Curtis Olson, started January 2002.
4 //
5 // Copyright (C) 2002  Curtis L. Olson - http://www.flightgear.org/~curt
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 //
21 // $Id$
22
23
24 #ifndef _FG_ATC_MAIN_HXX
25 #define _FG_ATC_MAIN_HXX
26
27 #ifdef HAVE_CONFIG_H
28 #  include <config.h>
29 #endif
30
31 #include <simgear/misc/sg_path.hxx>
32
33 #include <Main/fg_props.hxx>
34
35 #include "protocol.hxx"
36
37 #include "ATC-Inputs.hxx"
38 #include "ATC-Outputs.hxx"
39
40
41 class FGATCMain : public FGProtocol {
42
43     FGATCInput *input0;         // board0 input interface class
44     FGATCInput *input1;         // board1 input interface class
45     FGATCOutput *output0;       // board0 output interface class
46     FGATCOutput *output1;       // board1 output interface class
47
48     SGPath input0_path;
49     SGPath input1_path;
50     SGPath output0_path;
51     SGPath output1_path;
52
53     int board;
54
55     int lock0_fd;
56     int lock1_fd;
57
58 public:
59
60     FGATCMain() :
61         input0(NULL),
62         input1(NULL),
63         output0(NULL),
64         output1(NULL),
65         input0_path(""),
66         input1_path(""),
67         output0_path(""),
68         output1_path("")
69     { }
70
71     ~FGATCMain() {
72         delete input0;
73         delete input1;
74         delete output0;
75         delete output1;
76     }
77
78     // Open and initialize ATC 610x hardware
79     bool open();
80
81     void init_config();
82
83     bool process();
84
85     bool close();
86
87     inline void set_path_names( const SGPath &in0, const SGPath &in1,
88                                 const SGPath &out0, const SGPath &out1 )
89     {
90         input0_path = in0;
91         input1_path = in1;
92         output0_path = out0;
93         output1_path = out1;
94     }
95 };
96
97
98 #endif // _FG_ATC_MAIN_HXX