to known if DataObject has been modified when doing synchronize between DataObject and TreeItem
objectBrowser()->setAutoUpdate( isAutoUpdate );
}
+ */
if ( objectBrowser() ) {
objectBrowser()->updateGeometry();
objectBrowser()->updateTree( 0, false );
}
- */
}
/*!
}
getApp()->objectBrowser()->setAutoUpdate( upd );
- getApp()->objectBrowser()->updateTree( 0, false );
*/
+ getApp()->objectBrowser()->updateTree( 0, false );
}
/*!NOT IMPLEMENTED*/
void SUIT_DataObject::updateItem()
{
+ setModified(true);
signal()->emitUpdated(this);
}
virtual bool customSorting( const int = NameId ) const;
virtual bool compare( const QVariant&, const QVariant&, const int = NameId ) const;
+ bool modified(){return _modified;};
+ void setModified(bool modified){_modified = modified;};
+
virtual SUIT_DataObjectKey* key() const;
virtual int groupId() const;
bool myCheck;
bool myAutoDel;
DataObjectList myChildren;
+ bool _modified;
static Signal* mySignal;
#include <QApplication>
#include <QHash>
+#include <sys/time.h>
+static long tt0;
+static long tcount=0;
+static long cumul;
+static timeval tv;
+#define START_TIMING gettimeofday(&tv,0);tt0=tv.tv_usec+tv.tv_sec*1000000;
+#define END_TIMING(NUMBER) \
+ tcount=tcount+1;gettimeofday(&tv,0);cumul=cumul+tv.tv_usec+tv.tv_sec*1000000 -tt0; \
+ if(tcount==NUMBER){ std::cerr <<pthread_self()<<":"<<__FILE__<<":"<<__LINE__<<" temps CPU(mus): "<<cumul<< std::endl; tcount=0;cumul=0; }
+
+
SUIT_AbstractModel::SUIT_AbstractModel()
{
}
// - use "LastModified" time stamp in data objects and tree items - hardly possible, for sometimes data objects do not know that data changes...
// ...
update = true; // TEMPORARY!!!
+ update = obj->modified();
// 1. check text
/* update = ( item->text( 0 ) != obj->name() ) || myBrowser->needToUpdateTexts( item );
*/
void SUIT_TreeModel::updateTree( SUIT_DataObject* obj )
{
+ if(myAutoUpdate)
+ return;
+
if ( !obj )
obj = root();
endInsertRows();
+ obj->setModified(false);
+
return myItems[ obj ];
}
QModelIndex firstIdx = index( obj, 0 );
QModelIndex lastIdx = index( obj, columnCount() - 1 );
emit dataChanged( firstIdx, lastIdx );
+ obj->setModified(false);
}
/*!
QModelIndex firstIdx = index( obj, 0 );
QModelIndex lastIdx = index( obj, columnCount() - 1 );
emit dataChanged( firstIdx, lastIdx );
+ obj->setModified(false);
}
// temporary commented
//ob->setUpdater( new SalomeApp_Updater() );
+ ob->setAutoUpdate(false);
+
connect( ob, SIGNAL( doubleClicked( SUIT_DataObject* ) ), this, SLOT( onDblClick( SUIT_DataObject* ) ) );
QString
void SalomeApp_Application::updateObjectBrowser( const bool updateModels )
{
//MESSAGE("UpdateObjBrowser");
- return;
-
// update "non-existing" (not loaded yet) data models
SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(activeStudy());
+/*
if ( study )
{
_PTR(Study) stdDS = study->studyDS();
}
}
}
-
+*/
// create data objects that correspond to GUI state save points
if ( study ) updateSavePointDataObjects( study );
#include <QObject>
#include <QVariant>
+#include <sys/time.h>
+static long tt0;
+static long tcount=0;
+static long cumul;
+static timeval tv;
+#define START_TIMING gettimeofday(&tv,0);tt0=tv.tv_usec+tv.tv_sec*1000000;
+#define END_TIMING(NUMBER) \
+ tcount=tcount+1;gettimeofday(&tv,0);cumul=cumul+tv.tv_usec+tv.tv_sec*1000000 -tt0; \
+ if(tcount==NUMBER){ std::cerr << __FILE__ << __LINE__ << " temps CPU(mus): " << cumul << std::endl; tcount=0;cumul=0; }
+
+
/*!
\class SalomeApp_DataObject
\brief Implementation of the data object for use in CORBA-based
virtual void notifyObserver(const char* theID, const char* event)
{
- START_TIMING;
+ //START_TIMING;
//MESSAGE("I'm notified of " << event << " of ID = " << theID);
_PTR(SObject) obj = myStudyDS->FindObjectID( theID );
MESSAGE("Want to modify an unknown object" << theID);
}
}
- END_TIMING(200);
+ //END_TIMING(10);
}
private: