Commit 05de7184 authored by Pavel Vainerman's avatar Pavel Vainerman

Наследовал mbException от UniSetTypes::Exception, чтобы вылавливалось.

parent da6f95f2
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Name: libuniset Name: libuniset
Version: 0.99 Version: 0.99
Release: eter23 Release: eter24
Summary: UniSet - library for building distributed industrial control systems Summary: UniSet - library for building distributed industrial control systems
License: GPL License: GPL
Group: Development/C++ Group: Development/C++
...@@ -184,6 +184,9 @@ rm -f %buildroot%_libdir/*.la ...@@ -184,6 +184,9 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc %exclude %_pkgconfigdir/libUniSet.pc
%changelog %changelog
* Tue Nov 30 2010 Pavel Vainerman <pv@altlinux.ru> 0.99-eter24
- ModbusRTU::mbException: public Exception
* Mon Nov 29 2010 Pavel Vainerman <pv@altlinux.ru> 0.99-eter23 * Mon Nov 29 2010 Pavel Vainerman <pv@altlinux.ru> 0.99-eter23
- fixed bug in Modbus<-->SM (signed and unsigned value) - fixed bug in Modbus<-->SM (signed and unsigned value)
......
...@@ -20,8 +20,6 @@ ...@@ -20,8 +20,6 @@
/*! \file /*! \file
* \brief Иерархия генерируемых библиотекой исключений * \brief Иерархия генерируемых библиотекой исключений
* \author Pavel Vainerman * \author Pavel Vainerman
* \date $Date: 2008/12/14 21:57:51 $
* \version $Id: Exceptions.h,v 1.10 2008/12/14 21:57:51 vpashka Exp $
*/ */
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#ifndef Exceptions_h_ #ifndef Exceptions_h_
......
/*! $Id: ModbusRTUErrors.h,v 1.2 2008/01/01 00:26:23 vpashka Exp $ */
// -------------------------------------------------------------------------
#ifndef ModbusRTUErrors_H_ #ifndef ModbusRTUErrors_H_
#define ModbusRTUErrors_H_ #define ModbusRTUErrors_H_
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
#include <string> #include <string>
#include <iostream> #include <iostream>
#include "Exceptions.h"
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
namespace ModbusRTU namespace ModbusRTU
{ {
...@@ -34,11 +33,15 @@ namespace ModbusRTU ...@@ -34,11 +33,15 @@ namespace ModbusRTU
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
std::string mbErr2Str( mbErrCode e ); std::string mbErr2Str( mbErrCode e );
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
class mbException class mbException:
UniSetTypes::Exception
{ {
public: public:
mbException():err(ModbusRTU::erNoError){} mbException():
mbException( ModbusRTU::mbErrCode err):err(err){} UniSetTypes::Exception("mbException"),err(ModbusRTU::erNoError){}
mbException( ModbusRTU::mbErrCode err ):
UniSetTypes::Exception(mbErr2Str(err)),err(err){}
ModbusRTU::mbErrCode err; ModbusRTU::mbErrCode err;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment