Commit 2e796b52 authored by Pavel Vainerman's avatar Pavel Vainerman

Написал небольшую документацию по использованию python-module-uniset

parent 5e656d94
...@@ -653,7 +653,8 @@ INPUT = DocPages/ \ ...@@ -653,7 +653,8 @@ INPUT = DocPages/ \
../src/ \ ../src/ \
../conf \ ../conf \
../Utilities \ ../Utilities \
../extensions ../extensions \
../python
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
...@@ -674,7 +675,8 @@ INPUT_ENCODING = UTF-8 ...@@ -674,7 +675,8 @@ INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.dox \ FILE_PATTERNS = *.dox \
*.cc \ *.cc \
*.h \ *.h \
*.idl *.idl \
*.py
# The RECURSIVE tag can be used to turn specify whether or not subdirectories # The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO. # should be searched for input files as well. Possible values are YES and NO.
...@@ -724,7 +726,7 @@ EXAMPLE_PATH = ...@@ -724,7 +726,7 @@ EXAMPLE_PATH =
# and *.h) to filter out the source-files in the directories. If left # and *.h) to filter out the source-files in the directories. If left
# blank all files are included. # blank all files are included.
EXAMPLE_PATTERNS = DocPages/exmaples EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude # searched for input files to be used with the \include or \dontinclude
......
...@@ -647,13 +647,14 @@ WARN_LOGFILE = ...@@ -647,13 +647,14 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories # directories like "/usr/src/myproject". Separate the files or directories
# with spaces. # with spaces.
INPUT = ../include/ \ INPUT = DocPages/ \
../include/ \
../IDL/ \ ../IDL/ \
../src/ \ ../src/ \
DocPages/ \
../conf \ ../conf \
../Utilities \ ../Utilities \
../extensions ../extensions \
../python
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
...@@ -671,11 +672,11 @@ INPUT_ENCODING = UTF-8 ...@@ -671,11 +672,11 @@ INPUT_ENCODING = UTF-8
# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py # *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
# *.f90 *.f *.for *.vhd *.vhdl # *.f90 *.f *.for *.vhd *.vhdl
FILE_PATTERNS = *.cc \ FILE_PATTERNS = *.dox \
*.cc \
*.h \ *.h \
*.idl \ *.idl \
*.dox \ *.py
*.hh
# The RECURSIVE tag can be used to turn specify whether or not subdirectories # The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO. # should be searched for input files as well. Possible values are YES and NO.
...@@ -689,7 +690,7 @@ RECURSIVE = YES ...@@ -689,7 +690,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is # Note that relative paths are relative to the directory from which doxygen is
# run. # run.
EXCLUDE = ../include/gtkmm EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded # directories that are symbolic links (a Unix file system feature) are excluded
...@@ -724,7 +725,7 @@ EXAMPLE_PATH = ...@@ -724,7 +725,7 @@ EXAMPLE_PATH =
# and *.h) to filter out the source-files in the directories. If left # and *.h) to filter out the source-files in the directories. If left
# blank all files are included. # blank all files are included.
EXAMPLE_PATTERNS = DocPages/Exmaples EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude # searched for input files to be used with the \include or \dontinclude
......
#ifndef UModbus_H_ #ifndef UModbus_H_
#define UModbus_H_ #define UModbus_H_
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#include <Configuration.h> #include <Configuration.h>
#include <UniversalInterface.h> #include <UniversalInterface.h>
#include <modbus/ModbusTCPMaster.h> #include <modbus/ModbusTCPMaster.h>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <Debug.h> #include <Debug.h>
#include "UTypes.h" #include "UTypes.h"
#include "UExceptions.h" #include "UExceptions.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
class UModbus class UModbus
{ {
public: public:
...@@ -18,13 +18,13 @@ class UModbus ...@@ -18,13 +18,13 @@ class UModbus
UModbus(); UModbus();
~UModbus(); ~UModbus();
inline const char* getUIType(){ return "modbus"; } inline const char* getUIType(){ return "modbus"; }
inline bool isWriteFunction( int mbfunc ){ return ModbusRTU::isWriteFunction((ModbusRTU::SlaveFunctionCode)mbfunc); } inline bool isWriteFunction( int mbfunc ){ return ModbusRTU::isWriteFunction((ModbusRTU::SlaveFunctionCode)mbfunc); }
// выставление паметров связи, без установления соединения (!) // выставление паметров связи, без установления соединения (!)
void prepare( const char* ip, int port )throw(UException); void prepare( const char* ip, int port )throw(UException);
void connect( const char* ip, int port )throw(UException); void connect( const char* ip, int port )throw(UException);
inline int conn_port(){ return port; } inline int conn_port(){ return port; }
inline std::string conn_ip(){ return ip; } inline std::string conn_ip(){ return ip; }
...@@ -32,10 +32,9 @@ class UModbus ...@@ -32,10 +32,9 @@ class UModbus
inline void setTimeout( int msec ){ tout_msec = msec; } inline void setTimeout( int msec ){ tout_msec = msec; }
/*! Универсальная функция для чтения регистров. /* Если не указывать ip и порт, будут использованы, те
* Если не указывать ip и порт, будут использованы, те * чтобы были заданы в connect(). Если заданы другие ip и port,
* чтобы были заданы в UModbus::connect(). Если заданы другие ip и port, * будет сделана переподключение..
* будет сделано переподключение..
*/ */
long mbread( int addr, int mbreg, int mbfunc, long mbread( int addr, int mbreg, int mbfunc,
const char* vtype, int nbit=-1, const char* vtype, int nbit=-1,
...@@ -45,16 +44,11 @@ class UModbus ...@@ -45,16 +44,11 @@ class UModbus
long getByte( int addr, int mbreg, int mbfunc=0x4 )throw(UException); long getByte( int addr, int mbreg, int mbfunc=0x4 )throw(UException);
bool getBit( int addr, int mbreg, int mbfunc=0x2 )throw(UException); bool getBit( int addr, int mbreg, int mbfunc=0x2 )throw(UException);
/*! Функция записи регистров 0x06 или 0x10 задаётся параметром \a mbfunc.
* Если не указывать ip и порт, будут использованы, те
* чтобы были заданы в UModbus::connect(). Если заданы другие ip и port,
* будет сделана переподключение..
*/
void mbwrite( int addr, int mbreg, int val, int mbfunc, const char* ip=0, int port=-1 )throw(UException); void mbwrite( int addr, int mbreg, int val, int mbfunc, const char* ip=0, int port=-1 )throw(UException);
protected: protected:
long data2value( VTypes::VType vt, ModbusRTU::ModbusData* data ); long data2value( VTypes::VType vt, ModbusRTU::ModbusData* data );
private: private:
// DebugStream dlog; // DebugStream dlog;
ModbusTCPMaster* mb; ModbusTCPMaster* mb;
......
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