Ignore:
Timestamp:
01/21/14 15:28:59 (10 years ago)
Author:
ymipsl
Message:

Enhancement : Add scale_factor and add_offset attribute to field output
Operation (field-add_offset)/scale_factor would be computed before output write.
If field attribute prec=2 the field would be rounded to nearest integer value and output as short int (2 bytes).

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp

    r463 r464  
    1717  typedef xios::CFieldGroup*  fieldgroup_Ptr; 
    1818   
     19  void cxios_set_fieldgroup_add_offset(fieldgroup_Ptr fieldgroup_hdl, double add_offset) 
     20  { 
     21     CTimer::get("XIOS").resume(); 
     22    fieldgroup_hdl->add_offset.setValue(add_offset); 
     23    fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->add_offset); 
     24     CTimer::get("XIOS").suspend(); 
     25  } 
     26   
     27  void cxios_get_fieldgroup_add_offset(fieldgroup_Ptr fieldgroup_hdl, double* add_offset) 
     28  { 
     29    *add_offset = fieldgroup_hdl->add_offset.getInheritedValue(); 
     30  } 
     31   
     32  bool cxios_is_defined_fieldgroup_add_offset(fieldgroup_Ptr fieldgroup_hdl ) 
     33  { 
     34     CTimer::get("XIOS").resume(); 
     35    return fieldgroup_hdl->add_offset.hasInheritedValue(); 
     36     CTimer::get("XIOS").suspend(); 
     37  } 
     38   
     39   
     40   
    1941  void cxios_set_fieldgroup_axis_ref(fieldgroup_Ptr fieldgroup_hdl, const char * axis_ref, int axis_ref_size) 
    2042  { 
     
    375397   
    376398   
     399  void cxios_set_fieldgroup_scale_factor(fieldgroup_Ptr fieldgroup_hdl, double scale_factor) 
     400  { 
     401     CTimer::get("XIOS").resume(); 
     402    fieldgroup_hdl->scale_factor.setValue(scale_factor); 
     403    fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->scale_factor); 
     404     CTimer::get("XIOS").suspend(); 
     405  } 
     406   
     407  void cxios_get_fieldgroup_scale_factor(fieldgroup_Ptr fieldgroup_hdl, double* scale_factor) 
     408  { 
     409    *scale_factor = fieldgroup_hdl->scale_factor.getInheritedValue(); 
     410  } 
     411   
     412  bool cxios_is_defined_fieldgroup_scale_factor(fieldgroup_Ptr fieldgroup_hdl ) 
     413  { 
     414     CTimer::get("XIOS").resume(); 
     415    return fieldgroup_hdl->scale_factor.hasInheritedValue(); 
     416     CTimer::get("XIOS").suspend(); 
     417  } 
     418   
     419   
     420   
    377421  void cxios_set_fieldgroup_standard_name(fieldgroup_Ptr fieldgroup_hdl, const char * standard_name, int standard_name_size) 
    378422  { 
Note: See TracChangeset for help on using the changeset viewer.