Commit 4134ce15 authored by Pavel Vainerman's avatar Pavel Vainerman

fixed minor bug in ORepHelpers::getShortName

parent 2edec4a3
...@@ -19,6 +19,11 @@ ...@@ -19,6 +19,11 @@
- Везде где используется sstream и вызов str(), надо делать ss.rdbuf()->freeze(0); - Везде где используется sstream и вызов str(), надо делать ss.rdbuf()->freeze(0);
(http://www.intuit.ru/department/pl/cpp/17/2.html) (http://www.intuit.ru/department/pl/cpp/17/2.html)
- (IONotifyController): Разработать механизм заказа переодических уведомлений (msec), независимо от того, менялись ли датчики..
- (IONotifyController): Разработать механизм заказа группы датчиков сразу (и ответ тоже группой)
Вынести IOController_i::SensorInfo просто в UniSetTypes Вынести IOController_i::SensorInfo просто в UniSetTypes
(там же где ConsumerInfo и т.п.). И перевести uniset-codegen, (там же где ConsumerInfo и т.п.). И перевести uniset-codegen,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Name: libuniset Name: libuniset
Version: 0.99 Version: 0.99
Release: eter9 Release: eter11
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
* Mon Oct 18 2010 Pavel Vainerman <pv@altlinux.ru> 0.99-eter9
- new build
* Wed Oct 13 2010 Ilya Shpigor <elly@altlinux.org> 0.99-eter8 * Wed Oct 13 2010 Ilya Shpigor <elly@altlinux.org> 0.99-eter8
- fix bug in ModbusTCPServer - fix bug in ModbusTCPServer
- add gateway imitation to uniset-mbtcpserver-echo - add gateway imitation to uniset-mbtcpserver-echo
......
...@@ -193,12 +193,13 @@ namespace ORepHelpers ...@@ -193,12 +193,13 @@ namespace ORepHelpers
*/ */
const string getShortName( const string& fname, const std::string brk ) const string getShortName( const string& fname, const std::string brk )
{ {
// string::size_type pos = fullName.rfind(brk); /*
// if( pos == string::npos ) string::size_type pos = fname.rfind(brk);
// return fullName; if( pos == string::npos )
// return fname;
// return fullName.substr( pos+1, fullName.length() );
return fname.substr( pos+1, fname.length() );
*/
string::size_type pos1 = fname.rfind(brk); string::size_type pos1 = fname.rfind(brk);
string::size_type pos2 = fname.rfind(conf->oind->sepName); string::size_type pos2 = fname.rfind(conf->oind->sepName);
...@@ -209,7 +210,7 @@ namespace ORepHelpers ...@@ -209,7 +210,7 @@ namespace ORepHelpers
return fname.substr( 0, pos2 ); return fname.substr( 0, pos2 );
if( pos2 == string::npos ) if( pos2 == string::npos )
return fname.substr( pos1+1, pos1-1 ); return fname.substr( pos1+1, fname.length() );
return fname.substr( pos1+1, pos2-pos1-1 ); return fname.substr( pos1+1, pos2-pos1-1 );
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <string> #include <string>
#include "Debug.h" #include "Debug.h"
#include "Configuration.h" #include "Configuration.h"
#include "ORepHelpers.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
using namespace std; using namespace std;
using namespace UniSetTypes; using namespace UniSetTypes;
...@@ -22,6 +23,10 @@ int main(int argc, const char **argv) ...@@ -22,6 +23,10 @@ int main(int argc, const char **argv)
string t(conf->oind->getTextName(1)); string t(conf->oind->getTextName(1));
cout << "**** check getTextName: " << ( t.empty() ? "FAILED" : "OK" ) << endl; cout << "**** check getTextName: " << ( t.empty() ? "FAILED" : "OK" ) << endl;
string ln("/Projects/Sensors/VeryVeryLongNameSensor_ForTest_AS");
string ln_t("VeryVeryLongNameSensor_ForTest_AS");
cout << "**** check getShortName: " << ( ln_t == ORepHelpers::getShortName(ln) ? "OK" : "FAILED" ) << endl;
string mn(conf->oind->getMapName(1)); string mn(conf->oind->getMapName(1));
cout << "**** check getMapName: " << ( mn.empty() ? "FAILED" : "OK" ) << endl; cout << "**** check getMapName: " << ( mn.empty() ? "FAILED" : "OK" ) << endl;
......
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