Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

putSlice() CPO vs IDS
Code Block
titleITM
linenumberstrue
  #include "UALClasses.h"
int main(int argc, char *argv[])
{

        ItmNs::Itm itm(123,2,123,0);
        //Create a new instance of database
        itm.create();
        itm._pfsystems.datainfo.dataprovider.assign("USER");
        itm._pfsystems.putNonTimed();
        itm._pfsystems.pfsupplies.voltage.value(i) = 111*(i+1)+1000*k;
            //Do not forget time!!
            itm._pfsystems.time = k;
            //Append this slice in the database
            itm._pfsystems.putSlice();
        itm.close();
}
Code Block
titleIMAS
linenumberstrue
  
 //Definition of the class structures in file UALClasses.h
#include "UALClasses.h"
using namespace IdsNs;
int main(int argc, char *argv[])
{
 IdsNs::IDS imas(12, 2, -1, -1);
 imas.create();
IdsNs:IDS::core_profiles ids = imas._core_profiles;
ids.ids_properties.homogeneous_time = 1; //! Mandatory to define this property
ids.ids_properties.comment = "This is a test ids V3 Put_slice by C++";
 puts("Start Put non-timed");
 ids.putNonTimed();
 puts("Completed Put non-timed");
 ids.time.resize(1);
 ids.global_quantities.ip.resize(1); // Allocate all variables, time coordinate of size 1
  //
   ids.global_quantities.ip(0) = 11;
   ids.time(0) = 1;
   ids.putSlice();
   printf("PutSlice core_profiles IDS ");
 imas.close();
}

...