|
UniSet
2.0.0
|
00001 /* This file is part of the UniSet project 00002 * Copyright (c) 2002 Free Software Foundation, Inc. 00003 * Copyright (c) 2002 Pavel Vainerman 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 */ 00019 // -------------------------------------------------------------------------- 00023 // -------------------------------------------------------------------------- 00024 #ifndef BaseIOController_i_IDL_ 00025 #define BaseIOController_i_IDL_ 00026 // -------------------------------------------------------------------------- 00027 #include "../UniSetTypes/UniSetTypes_i.idl" 00028 #include "../UniSetTypes/UniSetManager_i.idl" 00029 // -------------------------------------------------------------------------------------------------------------- 00030 00036 interface IOController_i : UniSetManager_i 00037 { 00038 // исключения 00039 00041 exception NameNotFound 00042 { 00043 string err; 00044 }; 00045 00046 exception IOBadParam 00047 { 00048 string err; 00049 }; 00050 00054 exception Undefined 00055 { 00056 }; 00057 00059 struct SensorInfo 00060 { 00061 UniSetTypes::ObjectId id; 00062 UniSetTypes::ObjectId node; 00063 }; 00064 00065 long getValue(in UniSetTypes::ObjectId sid) raises(NameNotFound,Undefined); 00066 void setValue(in UniSetTypes::ObjectId sid, in long value, 00067 in UniSetTypes::ObjectId sup_id) raises(NameNotFound,Undefined); 00068 00069 // установка неопределённого состояния 00070 // (пока работает только для аналоговых датчиков) 00071 void setUndefinedState(in UniSetTypes::ObjectId sid, in boolean undefined, in UniSetTypes::ObjectId sup_id ) 00072 raises(NameNotFound); 00073 00074 // fast version (не вырабатывает исключения) 00075 oneway void fastSetValue(in UniSetTypes::ObjectId sid, in long value, in UniSetTypes::ObjectId sup_id); 00076 00077 UniversalIO::IOType getIOType(in UniSetTypes::ObjectId sid) raises(NameNotFound); 00078 00079 // --- Интерфейс для конфигурирования --- 00080 00082 long getRawValue( in UniSetTypes::ObjectId sid ) raises(NameNotFound); 00083 00084 struct CalibrateInfo 00085 { 00086 long minRaw; 00087 long maxRaw; 00088 long minCal; 00089 long maxCal; 00090 short precision; 00091 }; 00092 00093 void calibrate( in UniSetTypes::ObjectId sid, in CalibrateInfo ci, in UniSetTypes::ObjectId adminId ) raises(NameNotFound); 00094 CalibrateInfo getCalibrateInfo( in UniSetTypes::ObjectId sid ) raises(NameNotFound); 00095 00096 // --- Интерфес получения информации о всех датчиках --- 00098 struct SensorIOInfo 00099 { 00100 long value; 00101 boolean undefined; 00102 boolean blocked; 00103 long real_value; 00104 UniversalIO::IOType type; 00105 long priority; 00106 IOController_i::SensorInfo si; 00107 long default_val; 00108 CalibrateInfo ci; 00109 long tv_sec; 00110 long tv_usec; 00111 boolean dbignore; 00112 }; 00113 00114 typedef sequence<SensorIOInfo> SensorInfoSeq; 00115 00116 SensorInfoSeq getSensorsMap(); 00117 SensorIOInfo getSensorIOInfo( in UniSetTypes::ObjectId sid ) raises(NameNotFound); 00118 00119 // -- Функции работы со списком датчиков -- 00120 00122 SensorInfoSeq getSensorSeq( in UniSetTypes::IDSeq lst ); 00123 00125 struct OutInfo 00126 { 00127 SensorInfo si; 00128 long value; 00129 }; 00130 00131 typedef sequence<OutInfo> OutSeq; 00132 00138 UniSetTypes::IDSeq setOutputSeq( in OutSeq lst, in UniSetTypes::ObjectId sup_id ); 00139 00140 00142 struct ShortIOInfo 00143 { 00144 long value; 00145 long tv_sec; 00146 long tv_usec; 00147 }; 00148 00149 ShortIOInfo getChangedTime( in UniSetTypes::ObjectId sid ) raises(NameNotFound); 00150 00151 00153 struct ShortMap 00154 { 00155 UniversalIO::IOType type; 00156 long value; 00157 long id; 00158 }; 00159 00160 typedef sequence<ShortMap> ShortMapSeq; 00161 00162 ShortMapSeq getSensors(); 00163 }; 00164 00165 // -------------------------------------------------------------------------------------------------------------- 00175 interface IONotifyController_i : IOController_i 00176 { 00178 exception BadRange 00179 { 00180 }; 00181 00186 void askSensor(in UniSetTypes::ObjectId sid, in UniSetTypes::ConsumerInfo ci, in UniversalIO::UIOCommand cmd ) raises(NameNotFound,IOBadParam); 00187 00193 UniSetTypes::IDSeq askSensorsSeq( in UniSetTypes::IDSeq lst, 00194 in UniSetTypes::ConsumerInfo ci, 00195 in UniversalIO::UIOCommand cmd ); 00196 00197 00199 enum ThresholdState 00200 { 00201 LowThreshold, 00202 NormalThreshold, 00203 HiThreshold 00204 }; 00205 00206 struct ThresholdInfo 00207 { 00208 UniSetTypes::ThresholdId id; 00209 long hilimit; 00210 long lowlimit; 00211 ThresholdState state; 00212 long tv_sec; 00213 long tv_usec; 00214 boolean invert; 00215 }; 00216 00217 typedef sequence<ThresholdInfo> ThresholdInfoSeq; 00218 00228 void askThreshold(in UniSetTypes::ObjectId sid, in UniSetTypes::ConsumerInfo ci, in UniSetTypes::ThresholdId tid, 00229 in long lowLimit, in long hiLimit, in boolean invert, 00230 in UniversalIO::UIOCommand cmd ) raises(NameNotFound, IOBadParam, BadRange); 00231 00232 00236 ThresholdInfo getThresholdInfo( in UniSetTypes::ObjectId sid, in UniSetTypes::ThresholdId tid ) raises(NameNotFound); 00237 00238 struct ThresholdList 00239 { 00240 IOController_i::SensorInfo si; 00241 UniversalIO::IOType type; 00242 long value; 00243 ThresholdInfoSeq tlist; 00244 }; 00245 00246 typedef sequence<ThresholdList> ThresholdsListSeq; 00247 00249 ThresholdList getThresholds( in UniSetTypes::ObjectId sid ) raises(NameNotFound); 00250 00252 ThresholdsListSeq getThresholdsList(); 00253 }; 00254 // -------------------------------------------------------------------------- 00255 #endif
1.7.6.1