Changeset 3448 in Sophya


Ignore:
Timestamp:
Jan 31, 2008, 7:16:49 PM (18 years ago)
Author:
ansari
Message:

1/ Ajout operations compactdim/compactalldim pour TArray (objaoper/PerformOperation())
2/ Changement du nom des macros declares par spiapp/c++exec

DispplayObj() -> DispObj() , ExecuteCommand() -> ExecCmd()

Reza 31/01/2008

Location:
trunk/SophyaPI/PIext
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/cxxexecutor.cc

    r2944 r3448  
    455455
    456456os<<"//---- Macro Displaying objects and command execution"<<endl;
    457 os<<"#define DisplayObj(obj, att) Display_Object(obj, att, #obj); \n" << endl;
    458 os<<"#define ExecuteCommand(cmd) srvo.ExecuteCommand(cmd); \n" << endl;
     457os<<"#define DispObj(obj, att) Display_Object(obj, att, #obj); \n" << endl;
     458os<<"#define ExecCmd(cmd) srvo.ExecuteCommand(cmd); \n" << endl;
    459459
    460460return;
  • trunk/SophyaPI/PIext/nomtarradapter.cc

    r3335 r3448  
    166166    if (ok) {
    167167      string nslice;
    168       if (opts.size() > 2)  nslice = opts[2];
     168      if(opts.size() > 2)  nslice = opts[2];
    169169      else nslice = buff;
    170170      NamedObjMgr omg;
    171171      omg.AddObj(slice, nslice, true);
    172       return 0;
    173     }
    174   }
    175  
    176   cout << "NOMAdapter_TArray<T>::PerformOperation(): Error operation/arguments !" << endl;
    177   cout << "...Valid args: slicexy idxZ [slicename], sliceyz idxX [nm] slicexz idxY [nm]" << endl;
    178   return 1;
     172    }
     173    else delete slice;
     174    return 0;
     175  }
     176  else if (opts.size() >= 1) {
     177    if (opts[0] == "compactalldim") {
     178      mArr->CompactAllDimensions();   ok = true;
     179      cout << "PerformOperation(): mArr->CompactAllDimensions() " << endl;
     180    }
     181    else if (opts[0] == "compactdim") {
     182      mArr->CompactTrailingDimensions();   ok = true;
     183      cout << "PerformOperation(): mArr->CompactTrailingDimensions() " << endl;
     184    }
     185    else ok = false;
     186    if (ok) return 0;
     187  }
     188
     189  if (!ok) {
     190    cout << "NOMAdapter_TArray<T>::PerformOperation(): Error operation/arguments !" << endl;
     191    cout << "...Valid args: slicexy idxZ [slicename], sliceyz idxX [nm] slicexz idxY [nm]" << endl;
     192    cout << "... compactdim (=CompactTrailingDimensions()), compactalldim (=CompactAllDimensions())" << endl;
     193    return 1;
     194  }
    179195}
    180196
Note: See TracChangeset for help on using the changeset viewer.