INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
components/systemstatusmon/display.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2009 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef DISPLAY_H 00012 #define DISPLAY_H 00013 00014 #include <gbxsickacfr/gbxiceutilacfr/timer.h> 00015 #include <gbxsickacfr/gbxiceutilacfr/thread.h> 00016 #include <orcaifaceimpl/systemstatus.h> 00017 #include <orcaice/context.h> 00018 00019 namespace systemstatusmon 00020 { 00021 00022 // 00023 // Abstract Display class 00024 // 00025 // Author: Tobias Kaupp 00026 // 00027 class Display 00028 { 00029 public: 00030 virtual ~Display() {}; 00031 virtual void refresh() = 0; 00032 }; 00033 00034 // 00035 // A simple implementation of a Display: plain print-out of SystemStatusData on console 00036 // 00037 class SimpleDisplay : public Display 00038 { 00039 public: 00040 SimpleDisplay( const orcaice::Context &context, 00041 gbxiceutilacfr::Thread *thread ) 00042 { 00043 consumer_ = new orcaifaceimpl::PrintingSystemStatusConsumerImpl( context ); 00044 consumer_->subscribeWithTag( "SystemStatus", thread ); 00045 } 00046 void refresh() {}; 00047 00048 private: 00049 orcaifaceimpl::PrintingSystemStatusConsumerImplPtr consumer_; 00050 }; 00051 00052 // 00053 // An implementation of Display presenting SystemStatusData in a coloured matrix on the console 00054 // 00055 class ColourTextDisplay : public Display 00056 { 00057 public: 00058 ColourTextDisplay( const orcaice::Context &context, 00059 gbxiceutilacfr::Thread *thread ); 00060 void refresh(); 00061 00062 private: 00063 00064 orcaice::Context context_; 00065 gbxiceutilacfr::Timer timeSinceHeardTimer_; 00066 orcaifaceimpl::BufferedSystemStatusConsumerImplPtr consumer_; 00067 double publishIntervalSec_; 00068 00069 void display( const orca::SystemStatusData &data ); 00070 }; 00071 00072 } 00073 00074 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)