UniSet  2.6.0
SViewer.h
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 //--------------------------------------------------------------------------------
21 //--------------------------------------------------------------------------------
22 #ifndef _SVIEWER_H
23 #define _SVIEWER_H
24 //--------------------------------------------------------------------------------
25 #include <string>
26 #include <memory>
27 #include "IOController_i.hh"
28 #include "ObjectRepository.h"
29 #include "UInterface.h"
30 #include "PassiveTimer.h"
31 //--------------------------------------------------------------------------------
32 namespace uniset
33 {
34 
35  class SViewer
36  {
37  public:
38 
39  explicit SViewer(const std::string& ControllersSection, bool isShortName = true);
40  virtual ~SViewer();
41 
42  void view();
43  void monitor( timeout_t timeoutMS = 500 );
44 
45  protected:
46  void readSection(const std::string& sec, const std::string& secRoot);
47  void getInfo(uniset::ObjectId id);
48 
49  virtual void updateSensors( IOController_i::SensorInfoSeq_var& amap, uniset::ObjectId oid );
50  virtual void updateThresholds( IONotifyController_i::ThresholdsListSeq_var& tlst, uniset::ObjectId oid );
51 
52  const std::string csec;
53  void printInfo(uniset::ObjectId id, const std::string& sname, long value, const std::string& supplier,
54  const std::string& txtname, const std::string& iotype);
55 
56  std::shared_ptr<UInterface> ui;
57 
58  private:
59  ObjectRepository rep;
60  bool isShortName = { true };
61 
62  };
63  // -------------------------------------------------------------------------
64 } // end of uniset namespace
65 // --------------------------------------------------------------------------
66 #endif
67 // --------------------------------------------------------------------------
Definition: CallbackTimer.h:29
Definition: SViewer.h:35
long ObjectId
Definition: UniSetTypes_i.idl:30
Definition: ObjectRepository.h:45