Commit 29d02fbb authored by Pavel Vainerman's avatar Pavel Vainerman

minor fixes in SM

fixed minor bug in uniset-stop.sh
parent ee02c596
#!/bin/sh #!/bin/sh
USERID=0 USERID=0
BASEOMNIPORT=2809 BASEOMNIPORT=2809
......
#!/bin/sh #!/bin/sh
# #
. uniset-functions.sh . uniset-functions.sh
......
#!/bin/sh #!/bin/sh
SIG=-TERM SIG=-TERM
ARGS=$1 ARGS=$1
...@@ -35,7 +36,7 @@ for i in $(tac $RANSERVICES | cut -d " " -f 2) ...@@ -35,7 +36,7 @@ for i in $(tac $RANSERVICES | cut -d " " -f 2)
do do
TOKILL=$(basename $i) TOKILL=$(basename $i)
echo -n $TOKILL... echo -n $TOKILL...
if [ $(ps -x | grep $TOKILL | wc -l) = 0 ] if [ $(ps ax | grep $TOKILL | wc -l) = 0 ]
then then
echo " already stoppped [ OK ]" echo " already stoppped [ OK ]"
else else
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Name: libuniset Name: libuniset
Version: 0.97 Version: 0.97
Release: eter32 Release: eter34
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++
...@@ -178,6 +178,13 @@ rm -f %buildroot%_libdir/*.la ...@@ -178,6 +178,13 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc %exclude %_pkgconfigdir/libUniSet.pc
%changelog %changelog
* Tue Oct 27 2009 Pavel Vainerman <pv@altlinux.ru> 0.97-eter33
- fixed bug (int previous build) in SM
- fixed bug in uniset-stop.sh
* Tue Oct 27 2009 Pavel Vainerman <pv@altlinux.ru> 0.97-eter32
- new build
* Sat Oct 24 2009 Pavel Vainerman <pv@altlinux.ru> 0.97-eter31 * Sat Oct 24 2009 Pavel Vainerman <pv@altlinux.ru> 0.97-eter31
- new build - new build
......
...@@ -476,20 +476,59 @@ bool SharedMemory::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec ) ...@@ -476,20 +476,59 @@ bool SharedMemory::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec )
return true; return true;
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void SharedMemory::saveValue( const IOController_i::SensorInfo& si, CORBA::Long value, void SharedMemory::localSaveValue( AIOStateList::iterator& it, const IOController_i::SensorInfo& si,
UniversalIO::IOTypes type, UniSetTypes::ObjectId sup_id ) CORBA::Long newvalue, UniSetTypes::ObjectId sup_id )
{ {
if( hist.empty() )
{
IONotifyController_LT::localSaveValue( it, si, newvalue, sup_id );
return;
}
uniset_mutex_lock l(hbmutex);
IONotifyController_LT::localSaveValue( it, si, newvalue, sup_id );
}
// ------------------------------------------------------------------------------------------
void SharedMemory::localSaveState( DIOStateList::iterator& it, const IOController_i::SensorInfo& si,
CORBA::Boolean newstate, UniSetTypes::ObjectId sup_id )
{
if( hist.empty() )
{
IONotifyController_LT::localSaveState( it, si, newstate, sup_id );
return;
}
uniset_mutex_lock l(hbmutex);
IONotifyController_LT::localSaveState( it, si, newstate, sup_id );
}
// ------------------------------------------------------------------------------------------
void SharedMemory::localSetState( DIOStateList::iterator& it, const IOController_i::SensorInfo& si,
CORBA::Boolean newstate, UniSetTypes::ObjectId sup_id )
{
if( hist.empty() )
{
IONotifyController_LT::localSetState( it, si, newstate, sup_id );
return;
}
uniset_mutex_lock l(hbmutex); uniset_mutex_lock l(hbmutex);
IONotifyController_LT::saveValue(si,value,type,sup_id); IONotifyController_LT::localSetState( it, si, newstate, sup_id );
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
void SharedMemory::fastSaveValue(const IOController_i::SensorInfo& si, CORBA::Long value, void SharedMemory::localSetValue( AIOStateList::iterator& it, const IOController_i::SensorInfo& si,
UniversalIO::IOTypes type, UniSetTypes::ObjectId sup_id ) CORBA::Long value, UniSetTypes::ObjectId sup_id )
{ {
if( hist.empty() )
{
IONotifyController_LT::localSetValue( it, si, value, sup_id );
return;
}
uniset_mutex_lock l(hbmutex); uniset_mutex_lock l(hbmutex);
IONotifyController_LT::fastSaveValue(si,value,type,sup_id); IONotifyController_LT::localSetValue( it, si, value, sup_id );
} }
// ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------
SharedMemory* SharedMemory::init_smemory( int argc, const char* const* argv ) SharedMemory* SharedMemory::init_smemory( int argc, const char* const* argv )
{ {
string dfile = conf->getArgParam("--datfile", conf->getConfFileName()); string dfile = conf->getArgParam("--datfile", conf->getConfFileName());
......
...@@ -31,16 +31,6 @@ class SharedMemory: ...@@ -31,16 +31,6 @@ class SharedMemory:
/*! help- */ /*! help- */
static void help_print( int argc, const char* const* argv ); static void help_print( int argc, const char* const* argv );
virtual void saveValue(const IOController_i::SensorInfo& si, CORBA::Long value,
UniversalIO::IOTypes type = UniversalIO::AnalogInput,
UniSetTypes::ObjectId sup_id = UniSetTypes::DefaultObjectId );
virtual void fastSaveValue(const IOController_i::SensorInfo& si, CORBA::Long value,
UniversalIO::IOTypes type = UniversalIO::AnalogInput,
UniSetTypes::ObjectId sup_id = UniSetTypes::DefaultObjectId );
// "" SM . // "" SM .
// , , // , ,
// , SM . // , SM .
...@@ -108,6 +98,17 @@ class SharedMemory: ...@@ -108,6 +98,17 @@ class SharedMemory:
void askSensors( UniversalIO::UIOCommand cmd ); void askSensors( UniversalIO::UIOCommand cmd );
void sendEvent( UniSetTypes::SystemMessage& sm ); void sendEvent( UniSetTypes::SystemMessage& sm );
virtual void localSaveValue( AIOStateList::iterator& it, const IOController_i::SensorInfo& si,
CORBA::Long newvalue, UniSetTypes::ObjectId sup_id );
virtual void localSaveState( DIOStateList::iterator& it, const IOController_i::SensorInfo& si,
CORBA::Boolean newstate, UniSetTypes::ObjectId sup_id );
virtual void localSetState( DIOStateList::iterator& it, const IOController_i::SensorInfo& si,
CORBA::Boolean newstate, UniSetTypes::ObjectId sup_id );
virtual void localSetValue( AIOStateList::iterator& it, const IOController_i::SensorInfo& si,
CORBA::Long value, UniSetTypes::ObjectId sup_id );
// //
virtual void sigterm( int signo ); virtual void sigterm( int signo );
bool activateObject(); bool activateObject();
......
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