UniSet  2.6.0
IOController_i.idl
1 /*
2  * Copyright (c) 2015 Pavel Vainerman.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as
6  * published by the Free Software Foundation, version 2.1.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Lesser Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 // --------------------------------------------------------------------------
20 // --------------------------------------------------------------------------
21 #ifndef BaseIOController_i_IDL_
22 #define BaseIOController_i_IDL_
23 // --------------------------------------------------------------------------
24 #include "../UniSetTypes/UniSetTypes_i.idl"
25 #include "../UniSetTypes/UniSetManager_i.idl"
26 // --------------------------------------------------------------------------------------------------------------
27 
34 {
35  // исключения
36 
38  exception NameNotFound
39  {
40  string err;
41  };
42 
43  exception IOBadParam
44  {
45  string err;
46  };
47 
51  exception Undefined
52  {
53  };
54 
56  struct SensorInfo
57  {
60  };
61 
62  long getValue(in uniset::ObjectId sid) raises(NameNotFound,Undefined);
63  void setValue(in uniset::ObjectId sid, in long value,
64  in uniset::ObjectId sup_id) raises(NameNotFound,Undefined);
65 
66  // установка неопределённого состояния
67  // (пока работает только для аналоговых датчиков)
68  void setUndefinedState(in uniset::ObjectId sid, in boolean undefined, in uniset::ObjectId sup_id )
69  raises(NameNotFound);
70 
71  UniversalIO::IOType getIOType(in uniset::ObjectId sid) raises(NameNotFound);
72 
73  // --- Интерфейс для конфигурирования ---
74 
76  long getRawValue( in uniset::ObjectId sid ) raises(NameNotFound);
77 
79  {
80  long minRaw;
81  long maxRaw;
82  long minCal;
83  long maxCal;
84  short precision;
85  };
86 
87  void calibrate( in uniset::ObjectId sid, in CalibrateInfo ci, in uniset::ObjectId adminId ) raises(NameNotFound);
88  CalibrateInfo getCalibrateInfo( in uniset::ObjectId sid ) raises(NameNotFound);
89 
90  // --- Интерфес получения информации о всех датчиках ---
92  struct SensorIOInfo
93  {
94  long value;
95  boolean undefined;
96  boolean blocked;
97  long real_value;
98  UniversalIO::IOType type;
99  long priority;
101  long default_val;
103  unsigned long tv_sec;
104  unsigned long tv_nsec;
106  boolean dbignore;
107  };
108 
109  typedef sequence<SensorIOInfo> SensorInfoSeq;
110 
111  SensorInfoSeq getSensorsMap();
112  SensorIOInfo getSensorIOInfo( in uniset::ObjectId sid ) raises(NameNotFound);
113 
114  // -- Функции работы со списком датчиков --
115 
117  SensorInfoSeq getSensorSeq( in uniset::IDSeq lst );
118 
120  struct OutInfo
121  {
123  long value;
124  };
125 
126  typedef sequence<OutInfo> OutSeq;
127 
133  uniset::IDSeq setOutputSeq( in OutSeq lst, in uniset::ObjectId sup_id );
134 
135 
137  struct ShortIOInfo
138  {
139  long value;
140 
141  // могут быть проблеммы в 64bit-ных
142  unsigned long tv_sec;
143  unsigned long tv_nsec;
145  };
146 
147  ShortIOInfo getTimeChange( in uniset::ObjectId sid ) raises(NameNotFound);
148 
149 
151  struct ShortMap
152  {
153  UniversalIO::IOType type;
154  long value;
155  long id;
156  };
157 
158  typedef sequence<ShortMap> ShortMapSeq;
159 
160  ShortMapSeq getSensors();
161 };
162 
163 // --------------------------------------------------------------------------------------------------------------
174 {
176  exception BadRange
177  {
178  };
179 
183  void askSensor(in uniset::ObjectId sid, in uniset::ConsumerInfo ci, in UniversalIO::UIOCommand cmd ) raises(NameNotFound,IOBadParam);
184 
191  in uniset::ConsumerInfo ci,
192  in UniversalIO::UIOCommand cmd );
193 
194 
197  {
201  };
202 
204  {
206  long hilimit;
207  long lowlimit;
208  ThresholdState state;
209  unsigned long tv_sec;
210  unsigned long tv_nsec;
211  boolean invert;
212  };
213 
214  typedef sequence<ThresholdInfo> ThresholdInfoSeq;
215 
226  in long lowLimit, in long hiLimit, in boolean invert,
227  in UniversalIO::UIOCommand cmd ) raises(NameNotFound, IOBadParam, BadRange);
228 
229 
234 
236  {
238  UniversalIO::IOType type;
239  long value;
240  ThresholdInfoSeq tlist;
241  };
242 
243  typedef sequence<ThresholdList> ThresholdsListSeq;
244 
247 
249  ThresholdsListSeq getThresholdsList();
250 };
251 // --------------------------------------------------------------------------
252 #endif