00001 //====================================================================== 00002 // File: metexascii.h 00003 // Author: Matthias Toussaint 00004 // Created: Sat Nov 25 18:12:23 CET 2006 00005 // Project: QtDMM 00006 // Description: Encapsulates a DMM class (protokoll) 00007 //---------------------------------------------------------------------- 00008 // This file may be used under the terms of the GNU General Public 00009 // License version 2.0 as published by the Free Software Foundation 00010 // and appearing in the file LICENSE.GPL included in the packaging of 00011 // this file. 00012 // 00013 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING 00014 // THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00015 // PURPOSE. 00016 //---------------------------------------------------------------------- 00017 // Copyright 2006 Matthias Toussaint 00018 //====================================================================== 00019 00020 #ifndef METEXASCII_HH 00021 #define METEXASCII_HH 00022 00023 #include <dmmclass.h> 00024 #include <serialport.h> 00025 00038 class MetexAscii : public DMMClass 00039 { 00040 public: 00061 MetexAscii( const std::string & format, 00062 const std::string & overflowString, 00063 bool poll, const std::string & pollString, int pollTime ); 00064 virtual ~MetexAscii(); 00065 00066 virtual Port::Error close(); 00067 00068 protected: 00069 SerialPort m_port; 00070 int m_length; 00071 int m_syncByte; 00072 int m_modeStart, m_modeLen; 00073 int m_valueStart, m_valueLen; 00074 int m_unitStart, m_unitLen; 00075 std::string m_overflowStr; 00076 bool m_poll; 00077 std::string m_pollString; 00078 int m_pollTime; 00079 00080 virtual Port::Error open_impl( const std::string & config ); 00081 virtual void run(); 00082 00083 void setMetexAscii( const std::string & str, int index ); 00084 00085 }; 00086 00087 #endif // METEX14BYTESASCII_HH