Salome HOME
projects
/
modules
/
med.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
afa6a20
)
can create datasource from tui
author
Cédric Aguerre
<cedric.aguerre@edf.fr>
Tue, 21 Jul 2015 16:02:36 +0000
(18:02 +0200)
committer
Cédric Aguerre
<cedric.aguerre@edf.fr>
Tue, 21 Jul 2015 16:02:36 +0000
(18:02 +0200)
idl/MEDEventListener.idl
patch
|
blob
|
history
src/MEDOP/gui/DatasourceController.cxx
patch
|
blob
|
history
src/MEDOP/gui/DatasourceController.hxx
patch
|
blob
|
history
src/MEDOP/gui/MEDEventListener_i.cxx
patch
|
blob
|
history
src/MEDOP/gui/MEDOPModule.cxx
patch
|
blob
|
history
src/MEDOP/gui/WorkspaceController.cxx
patch
|
blob
|
history
src/MEDOP/gui/WorkspaceController.hxx
patch
|
blob
|
history
src/MEDOP/tui/medpresentation/medpresentation.py
patch
|
blob
|
history
src/MEDOP/tui/xmedpy/fieldproxy.py
patch
|
blob
|
history
diff --git
a/idl/MEDEventListener.idl
b/idl/MEDEventListener.idl
index 30ea6b0854e8fe11baaf57be518ed720a358d884..1fbf557b82386cd12060e60588e7c91f900bf00a 100644
(file)
--- a/
idl/MEDEventListener.idl
+++ b/
idl/MEDEventListener.idl
@@
-32,12
+32,14
@@
module MEDOP
EVENT_DELETE_FIELD,
EVENT_UPDATE_FIELD,
EVENT_CLEAN_WORKSPACE,
EVENT_DELETE_FIELD,
EVENT_UPDATE_FIELD,
EVENT_CLEAN_WORKSPACE,
+ EVENT_ADD_DATASOURCE,
EVENT_UNKNOWN
};
struct MedEvent {
MedEventType type;
long fieldid;
EVENT_UNKNOWN
};
struct MedEvent {
MedEventType type;
long fieldid;
+ string filename;
};
interface MEDEventListener: SALOME::GenericObj {
};
interface MEDEventListener: SALOME::GenericObj {
diff --git
a/src/MEDOP/gui/DatasourceController.cxx
b/src/MEDOP/gui/DatasourceController.cxx
index f46e9b5e0bbdab0b72555b958e57f5ef106171dd..740677333bfee29905c70b04e02563f22d83bede 100644
(file)
--- a/
src/MEDOP/gui/DatasourceController.cxx
+++ b/
src/MEDOP/gui/DatasourceController.cxx
@@
-552,3
+552,12
@@
void DatasourceController::OnInterpolateFieldInputValidated() {
// // Tag the item to prevent double import
// //_studyEditor->setParameterBool(soField,OBJECT_IS_IN_WORKSPACE,true);
}
// // Tag the item to prevent double import
// //_studyEditor->setParameterBool(soField,OBJECT_IS_IN_WORKSPACE,true);
}
+
+void
+DatasourceController::processWorkspaceEvent(const MEDOP::MedEvent * event)
+{
+ if ( event->type == MEDOP::EVENT_ADD_DATASOURCE ) {
+ this->addDatasource(event->filename);
+ _salomeModule->updateObjBrowser(true);
+ }
+}
diff --git
a/src/MEDOP/gui/DatasourceController.hxx
b/src/MEDOP/gui/DatasourceController.hxx
index 435aebec9ac755527f02944e7bd1a941817439c2..9ed1ee0daa4113ebfe409e8b0e0b1880f101c923 100644
(file)
--- a/
src/MEDOP/gui/DatasourceController.hxx
+++ b/
src/MEDOP/gui/DatasourceController.hxx
@@
-22,6
+22,7
@@
#ifndef DATASOURCE_CONTROLLER_H
#define DATASOURCE_CONTROLLER_H
#ifndef DATASOURCE_CONTROLLER_H
#define DATASOURCE_CONTROLLER_H
+#include "MEDEventListener_i.hxx"
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(MEDDataManager)
#include <StandardApp_Module.hxx>
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(MEDDataManager)
#include <StandardApp_Module.hxx>
@@
-79,6
+80,7
@@
public slots:
// Callback connected to dialog box validation signals
void OnChangeUnderlyingMeshInputValidated();
void OnInterpolateFieldInputValidated();
// Callback connected to dialog box validation signals
void OnChangeUnderlyingMeshInputValidated();
void OnInterpolateFieldInputValidated();
+ void processWorkspaceEvent(const MEDOP::MedEvent * event);
signals:
void datasourceSignal(const DatasourceEvent * event);
signals:
void datasourceSignal(const DatasourceEvent * event);
diff --git
a/src/MEDOP/gui/MEDEventListener_i.cxx
b/src/MEDOP/gui/MEDEventListener_i.cxx
index ea129021b72d79b61eeab70378e70289029d238c..5acb73efead16973650721baf7b4b90e09c0da4f 100644
(file)
--- a/
src/MEDOP/gui/MEDEventListener_i.cxx
+++ b/
src/MEDOP/gui/MEDEventListener_i.cxx
@@
-55,6
+55,4
@@
void MEDEventListener_i::processMedEvent(const MEDOP::MedEvent & event) {
// WorkspaceController (connect to a slot of WorkspaceController).
emit medEventSignal(new MEDOP::MedEvent(event));
// WorkspaceController (connect to a slot of WorkspaceController).
emit medEventSignal(new MEDOP::MedEvent(event));
-
-
}
}
diff --git
a/src/MEDOP/gui/MEDOPModule.cxx
b/src/MEDOP/gui/MEDOPModule.cxx
index 88139f75251c711c0f63c9a8c83031abfeb168bd..e3fb1716efbf17f962b6aa70a9c94a133f6602ef 100644
(file)
--- a/
src/MEDOP/gui/MEDOPModule.cxx
+++ b/
src/MEDOP/gui/MEDOPModule.cxx
@@
-83,6
+83,9
@@
void MEDOPModule::createModuleWidgets() {
connect(_datasourceController, SIGNAL(datasourceSignal(const DatasourceEvent *)),
_workspaceController, SLOT(processDatasourceEvent(const DatasourceEvent *)));
connect(_datasourceController, SIGNAL(datasourceSignal(const DatasourceEvent *)),
_workspaceController, SLOT(processDatasourceEvent(const DatasourceEvent *)));
+
+ connect(_workspaceController, SIGNAL(workspaceSignal(const MEDOP::MedEvent *)),
+ _datasourceController, SLOT(processWorkspaceEvent(const MEDOP::MedEvent *)));
}
bool MEDOPModule::activateModule( SUIT_Study* theStudy )
}
bool MEDOPModule::activateModule( SUIT_Study* theStudy )
diff --git
a/src/MEDOP/gui/WorkspaceController.cxx
b/src/MEDOP/gui/WorkspaceController.cxx
index e9930e8467449095ddf2bc7cdaaffdca40593cdd..6b2e5cc3ff17589ab83c52ffd2b187889d8fb085 100644
(file)
--- a/
src/MEDOP/gui/WorkspaceController.cxx
+++ b/
src/MEDOP/gui/WorkspaceController.cxx
@@
-293,6
+293,9
@@
void WorkspaceController::processMedEvent(const MEDOP::MedEvent * event) {
dataModel->removeDataObject(itemNameId);
}
}
dataModel->removeDataObject(itemNameId);
}
}
+ else if ( event->type == MEDOP::EVENT_ADD_DATASOURCE ) {
+ emit workspaceSignal(event); // forward to DatasourceController
+ }
}
}
diff --git
a/src/MEDOP/gui/WorkspaceController.hxx
b/src/MEDOP/gui/WorkspaceController.hxx
index 229973360fd1635427ae9b9d8174ed67eb2e4443..410e528090cc3dfabfee24ebc92a6671e1072752 100644
(file)
--- a/
src/MEDOP/gui/WorkspaceController.hxx
+++ b/
src/MEDOP/gui/WorkspaceController.hxx
@@
-59,6
+59,9
@@
public slots:
void OnSaveWorkspace();
void OnCleanWorkspace();
void OnSaveWorkspace();
void OnCleanWorkspace();
+signals:
+ void workspaceSignal(const MEDOP::MedEvent * event);
+
private:
XmedConsoleDriver * _consoleDriver;
StandardApp_Module * _salomeModule;
private:
XmedConsoleDriver * _consoleDriver;
StandardApp_Module * _salomeModule;
diff --git
a/src/MEDOP/tui/medpresentation/medpresentation.py
b/src/MEDOP/tui/medpresentation/medpresentation.py
index 11b029ad5dc00b656c3c659a0b001e8963b6f6db..dfc977ef573d58238eade9884f2acbd794079089 100644
(file)
--- a/
src/MEDOP/tui/medpresentation/medpresentation.py
+++ b/
src/MEDOP/tui/medpresentation/medpresentation.py
@@
-24,9
+24,8
@@
import SALOME
__manager = xmed.factory.getPresentationManager()
def LoadDataSource(filename):
__manager = xmed.factory.getPresentationManager()
def LoadDataSource(filename):
- dataHandler = xmed.dataManager.addDatasource(filename)
- print data
- #return data
+ from xmed.fieldproxy import notifyGui_addsource
+ notifyGui_addsource(filename)
#
def MakeScalarMap(proxy, viewMode):
#
def MakeScalarMap(proxy, viewMode):
diff --git
a/src/MEDOP/tui/xmedpy/fieldproxy.py
b/src/MEDOP/tui/xmedpy/fieldproxy.py
index a2f7d23ea6ff42586643484a1a8dd0d30195c754..687f11e219f8635ede619cf6d5be7a4e959c163d 100644
(file)
--- a/
src/MEDOP/tui/xmedpy/fieldproxy.py
+++ b/
src/MEDOP/tui/xmedpy/fieldproxy.py
@@
-385,8
+385,8
@@
class FieldProxy:
# that they could be used in another context than the FieldProxy instances
import MEDOP
# that they could be used in another context than the FieldProxy instances
import MEDOP
-def __notifyGui(type, fieldId=-1):
- medEvent = MEDOP.MedEvent(type, fieldId)
+def __notifyGui(type, fieldId=-1
, filename=""
):
+ medEvent = MEDOP.MedEvent(type, fieldId
, filename
)
if not xmed.eventListenerIsRunning(): return
if not xmed.eventListenerIsRunning(): return
@@
-411,6
+411,9
@@
def notifyGui_remove(fieldId):
def notifyGui_clean():
__notifyGui(MEDOP.EVENT_CLEAN_WORKSPACE)
def notifyGui_clean():
__notifyGui(MEDOP.EVENT_CLEAN_WORKSPACE)
+def notifyGui_addsource(filename):
+ __notifyGui(MEDOP.EVENT_ADD_DATASOURCE,-1,filename)
+
#
# ===================================================================
# use case functions
#
# ===================================================================
# use case functions