Commit 230f76d7 authored by Aleksey Vinogradov's avatar Aleksey Vinogradov

переименовал флаг и методы

parent 19acdd2a
...@@ -765,20 +765,12 @@ void UNetExchange::receiverEvent( UNetReceiver* r, UNetReceiver::Event ev ) ...@@ -765,20 +765,12 @@ void UNetExchange::receiverEvent( UNetReceiver* r, UNetReceiver::Event ev )
} }
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void UNetExchange::enable(UniSetTypes::ObjectId id) void UNetExchange::ignore_item(UniSetTypes::ObjectId id, bool set)
{ {
std::list<UNetReceiver*> rList = get_receivers(); std::list<UNetReceiver*> rList = get_receivers();
std::list<UNetReceiver*>::iterator rIt = rList.begin(); std::list<UNetReceiver*>::iterator rIt = rList.begin();
for(; rIt != rList.end(); ++ rIt ) for(; rIt != rList.end(); ++ rIt )
(*rIt)->enable(id); (*rIt)->ignore_item(id, set);
}
// -----------------------------------------------------------------------------
void UNetExchange::disable(UniSetTypes::ObjectId id)
{
std::list<UNetReceiver*> rList = get_receivers();
std::list<UNetReceiver*>::iterator rIt = rList.begin();
for(; rIt != rList.end(); ++ rIt )
(*rIt)->disable(id);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
std::list<UNetReceiver*> UNetExchange::get_receivers() std::list<UNetReceiver*> UNetExchange::get_receivers()
......
...@@ -90,9 +90,10 @@ class UNetExchange: ...@@ -90,9 +90,10 @@ class UNetExchange:
static void help_print( int argc, const char* argv[] ); static void help_print( int argc, const char* argv[] );
bool checkExistUNetHost( const std::string& host, ost::tpport_t port ); bool checkExistUNetHost( const std::string& host, ost::tpport_t port );
std::list<UNetReceiver*> get_receivers(); std::list<UNetReceiver*> get_receivers();
void enable(UniSetTypes::ObjectId id = UniSetTypes::DefaultObjectId); /*! игнорировать запись датчик в шару */
void disable(UniSetTypes::ObjectId id = UniSetTypes::DefaultObjectId); void ignore_item(UniSetTypes::ObjectId id = UniSetTypes::DefaultObjectId, bool set = true);
protected: protected:
xmlNode* cnode; xmlNode* cnode;
......
...@@ -297,7 +297,7 @@ void UNetReceiver::real_update() ...@@ -297,7 +297,7 @@ void UNetReceiver::real_update()
if( lockUpdate ) if( lockUpdate )
continue; continue;
} }
if( !ii.update ) if( ii.ignore )
continue; continue;
else if( ii.iotype == UniversalIO::DigitalInput ) else if( ii.iotype == UniversalIO::DigitalInput )
shm->localSaveState(ii.dit,id,val,shm->ID()); shm->localSaveState(ii.dit,id,val,shm->ID());
...@@ -342,7 +342,7 @@ void UNetReceiver::real_update() ...@@ -342,7 +342,7 @@ void UNetReceiver::real_update()
continue; continue;
} }
if( !ii.update ) if( ii.ignore )
continue; continue;
else if( ii.iotype == UniversalIO::DigitalInput ) else if( ii.iotype == UniversalIO::DigitalInput )
shm->localSaveState(ii.dit,d.id,d.val,shm->ID()); shm->localSaveState(ii.dit,d.id,d.val,shm->ID());
...@@ -522,49 +522,25 @@ void UNetReceiver::initIterators() ...@@ -522,49 +522,25 @@ void UNetReceiver::initIterators()
} }
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void UNetReceiver::enable(UniSetTypes::ObjectId id) void UNetReceiver::ignore_item(UniSetTypes::ObjectId id, bool set)
{ {
for( ItemVec::iterator it=d_icache.begin(); it!=d_icache.end(); ++it ) for( ItemVec::iterator it=d_icache.begin(); it!=d_icache.end(); ++it )
{ {
if( id == UniSetTypes::DefaultObjectId ) if( id == UniSetTypes::DefaultObjectId )
it->update = true; it->ignore = set;
else if( id == it->id ) else if( id == it->id )
{ {
it->update = true; it->ignore = set;
return; return;
} }
} }
for( ItemVec::iterator it=a_icache.begin(); it!=a_icache.end(); ++it ) for( ItemVec::iterator it=a_icache.begin(); it!=a_icache.end(); ++it )
{ {
if( id == UniSetTypes::DefaultObjectId ) if( id == UniSetTypes::DefaultObjectId )
it->update = true; it->ignore = set;
else if( id == it->id ) else if( id == it->id )
{ {
it->update = true; it->ignore = set;
return;
}
}
}
// -----------------------------------------------------------------------------
void UNetReceiver::disable(UniSetTypes::ObjectId id)
{
for( ItemVec::iterator it=d_icache.begin(); it!=d_icache.end(); ++it )
{
if( id == UniSetTypes::DefaultObjectId )
it->update = false;
else if( id == it->id )
{
it->update = false;
return;
}
}
for( ItemVec::iterator it=a_icache.begin(); it!=a_icache.end(); ++it )
{
if( id == UniSetTypes::DefaultObjectId )
it->update = false;
else if( id == it->id )
{
it->update = false;
return; return;
} }
} }
......
...@@ -93,8 +93,8 @@ class UNetReceiver ...@@ -93,8 +93,8 @@ class UNetReceiver
typedef sigc::slot<void,UNetReceiver*,Event> EventSlot; typedef sigc::slot<void,UNetReceiver*,Event> EventSlot;
void connectEvent( EventSlot sl ); void connectEvent( EventSlot sl );
void enable(UniSetTypes::ObjectId id = UniSetTypes::DefaultObjectId); /*! игнорировать запись датчик в шару */
void disable(UniSetTypes::ObjectId id = UniSetTypes::DefaultObjectId); void ignore_item(UniSetTypes::ObjectId id = UniSetTypes::DefaultObjectId, bool set = true);
protected: protected:
...@@ -176,12 +176,12 @@ class UNetReceiver ...@@ -176,12 +176,12 @@ class UNetReceiver
IOController::AIOStateList::iterator ait; IOController::AIOStateList::iterator ait;
IOController::DIOStateList::iterator dit; IOController::DIOStateList::iterator dit;
UniversalIO::IOTypes iotype; UniversalIO::IOTypes iotype;
bool update; bool ignore; /*!< флаг игнорирования сохранения в SM*/
ItemInfo(): ItemInfo():
id(UniSetTypes::DefaultObjectId), id(UniSetTypes::DefaultObjectId),
iotype(UniversalIO::UnknownIOType), iotype(UniversalIO::UnknownIOType),
update(true){} ignore(false){}
}; };
typedef std::vector<ItemInfo> ItemVec; typedef std::vector<ItemInfo> ItemVec;
......
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