|
UniSet
2.2.1
|
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 UniSetTypes::ObjectId supplier; 00112 boolean dbignore; 00113 }; 00114 00115 typedef sequence<SensorIOInfo> SensorInfoSeq; 00116 00117 SensorInfoSeq getSensorsMap(); 00118 SensorIOInfo getSensorIOInfo( in UniSetTypes::ObjectId sid ) raises(NameNotFound); 00119 00120 // -- Функции работы со списком датчиков -- 00121 00123 SensorInfoSeq getSensorSeq( in UniSetTypes::IDSeq lst ); 00124 00126 struct OutInfo 00127 { 00128 SensorInfo si; 00129 long value; 00130 }; 00131 00132 typedef sequence<OutInfo> OutSeq; 00133 00139 UniSetTypes::IDSeq setOutputSeq( in OutSeq lst, in UniSetTypes::ObjectId sup_id ); 00140 00141 00143 struct ShortIOInfo 00144 { 00145 long value; 00146 long tv_sec; 00147 long tv_usec; 00148 UniSetTypes::ObjectId supplier; 00149 }; 00150 00151 ShortIOInfo getChangedTime( in UniSetTypes::ObjectId sid ) raises(NameNotFound); 00152 00153 00155 struct ShortMap 00156 { 00157 UniversalIO::IOType type; 00158 long value; 00159 long id; 00160 }; 00161 00162 typedef sequence<ShortMap> ShortMapSeq; 00163 00164 ShortMapSeq getSensors(); 00165 }; 00166 00167 // -------------------------------------------------------------------------------------------------------------- 00177 interface IONotifyController_i : IOController_i 00178 { 00180 exception BadRange 00181 { 00182 }; 00183 00187 void askSensor(in UniSetTypes::ObjectId sid, in UniSetTypes::ConsumerInfo ci, in UniversalIO::UIOCommand cmd ) raises(NameNotFound,IOBadParam); 00188 00194 UniSetTypes::IDSeq askSensorsSeq( in UniSetTypes::IDSeq lst, 00195 in UniSetTypes::ConsumerInfo ci, 00196 in UniversalIO::UIOCommand cmd ); 00197 00198 00200 enum ThresholdState 00201 { 00202 LowThreshold, 00203 NormalThreshold, 00204 HiThreshold 00205 }; 00206 00207 struct ThresholdInfo 00208 { 00209 UniSetTypes::ThresholdId id; 00210 long hilimit; 00211 long lowlimit; 00212 ThresholdState state; 00213 long tv_sec; 00214 long tv_usec; 00215 boolean invert; 00216 }; 00217 00218 typedef sequence<ThresholdInfo> ThresholdInfoSeq; 00219 00229 void askThreshold(in UniSetTypes::ObjectId sid, in UniSetTypes::ConsumerInfo ci, in UniSetTypes::ThresholdId tid, 00230 in long lowLimit, in long hiLimit, in boolean invert, 00231 in UniversalIO::UIOCommand cmd ) raises(NameNotFound, IOBadParam, BadRange); 00232 00233 00237 ThresholdInfo getThresholdInfo( in UniSetTypes::ObjectId sid, in UniSetTypes::ThresholdId tid ) raises(NameNotFound); 00238 00239 struct ThresholdList 00240 { 00241 IOController_i::SensorInfo si; 00242 UniversalIO::IOType type; 00243 long value; 00244 ThresholdInfoSeq tlist; 00245 }; 00246 00247 typedef sequence<ThresholdList> ThresholdsListSeq; 00248 00250 ThresholdList getThresholds( in UniSetTypes::ObjectId sid ) raises(NameNotFound); 00251 00253 ThresholdsListSeq getThresholdsList(); 00254 }; 00255 // -------------------------------------------------------------------------- 00256 #endif
1.7.6.1