#define IS_IN_WORKSPACE "isInWorkspace"
#define SOURCE_ID "sourceId"
#define MESH_ID "meshId"
-//#define FIELD_SERIES_ID "fieldSeriesId"
+#define FIELD_SERIES_ID "fieldSeriesId"
#define FIELD_ID "fieldId"
#define PRESENTATION_ID "presentationId"
#define IS_PRESENTATION "isPresentation"
soFieldseries->SetAttrString("AttributePixMap", "ICO_DATASOURCE_FIELD");
anAttr = studyBuilder->FindOrCreateAttribute(soFieldseries, "AttributeParameter");
aParam = SALOMEDS::AttributeParameter::_narrow(anAttr);
- //aParam->SetInt(FIELD_SERIES_ID, fieldseriesHandler.id);
- aParam->SetInt(FIELD_ID, fieldseriesHandler.id);
+ aParam->SetInt(FIELD_SERIES_ID, fieldseriesHandler.id);
+ //aParam->SetInt(FIELD_ID, fieldseriesHandler.id);
aParam->SetBool(IS_IN_WORKSPACE, false);
useCaseBuilder->AppendTo(soFieldseries->GetFather(), soFieldseries);
//bool isPresentation = false;
int sourceId = -1;
int meshId = -1;
- //int fieldSeriesId = -1;
+ int fieldSeriesId = -1;
int fieldId = -1;
int presentationId = -1;
if (aSObj->FindAttribute(anAttribute, "AttributeParameter")) {
sourceId = attrParam->GetInt(SOURCE_ID);
if (attrParam->IsSet(MESH_ID, PT_INTEGER))
meshId = attrParam->GetInt(MESH_ID);
- //if (attrParam->IsSet(FIELD_SERIES_ID, PT_INTEGER))
- // fieldSeriesId = attrParam->GetInt(FIELD_SERIES_ID);
+ if (attrParam->IsSet(FIELD_SERIES_ID, PT_INTEGER))
+ fieldSeriesId = attrParam->GetInt(FIELD_SERIES_ID);
if (attrParam->IsSet(FIELD_ID, PT_INTEGER))
fieldId = attrParam->GetInt(FIELD_ID);
if (attrParam->IsSet(PRESENTATION_ID, PT_INTEGER))
oss << "Source id: " << sourceId << std::endl;
if (meshId > -1)
oss << "Mesh id: " << meshId << std::endl;
- //if (fieldSeriesId > -1)
- // oss << "Field series id: " << fieldSeriesId << std::endl;
+ if (fieldSeriesId > -1)
+ oss << "Field series id: " << fieldSeriesId << std::endl;
if (fieldId > -1)
oss << "Field id: " << fieldId << std::endl;
//oss << "Is presentation: " << isPresentation << std::endl;
SALOMEDS::SObject_var soFieldseries = listOfSObject->at(i);
// First retrieve the fieldseries id associated to this study object
- //long fieldseriesId = _studyEditor->getParameterInt(soFieldseries,FIELD_SERIES_ID);
- long fieldseriesId = _studyEditor->getParameterInt(soFieldseries,FIELD_ID);
+ long fieldseriesId = _studyEditor->getParameterInt(soFieldseries,FIELD_SERIES_ID);
+ //long fieldseriesId = _studyEditor->getParameterInt(soFieldseries,FIELD_ID);
STDLOG("Expand the field timeseries "<<fieldseriesId);
// If fieldseriesId equals -1, then it means that it is not a
// to make a view of an object from the tui console).
for (int i=0; i<listOfSObject->size(); i++) {
SALOMEDS::SObject_var soField = listOfSObject->at(i);
- int fieldId = _studyEditor->getParameterInt(soField,FIELD_ID);
- // If fieldId equals -1, then it means that it is not a field
- // managed by the MED module, and we stop this function process.
- if ( fieldId < 0 )
- continue;
+ int fieldId = -1;
+ try {
+ fieldId = _studyEditor->getParameterInt(soField,FIELD_ID); }
+ catch(...) { }
+ if (fieldId < 0) // is it a field serie ?
+ {
+ int fieldSeriesId = -1;
+ try {
+ fieldSeriesId = _studyEditor->getParameterInt(soField,FIELD_SERIES_ID); }
+ catch(...) { }
+ // If fieldId and fieldSeriesId equals -1, then it means that it is not a field
+ // managed by the MED module, and we stop this function process.
+ if ( fieldSeriesId < 0)
+ continue;
+ MEDCALC::FieldHandlerList* fieldHandlerList = MEDFactoryClient::getDataManager()->getFieldListInFieldseries(fieldSeriesId);
+ if (fieldHandlerList->length() < 0)
+ continue;
+ // For a field series, get the first real field entry:
+ MEDCALC::FieldHandler fieldHandler = (*fieldHandlerList)[0];
+ fieldId = fieldHandler.id;
+ }
MEDCALC::FieldHandler* fieldHandler = MEDFactoryClient::getDataManager()->getFieldHandler(fieldId);
if (! fieldHandler) {