char * QuGetAttrText(char * name, QdObject_var obj);
void QuSetTxtAttr(char *name, char * value, QdObject_var ptr);
#include "Qdos.h" #include "QdUtils.h" QuSetTxtAttr(FRAME, "scalar>na", (QdObject_var) out_series); QuSetTxtAttr(SI_CONVERSION, QuGetAttrText("SI_conversion", X_in), (QdObject_var) out_series); QuSetTxtAttr("Method", "Magnitude of XY components only", (QdObject_var) out_series);The above example shows the creation of a new FRAME attribute with value ``scalar_na'', the copying of the attribute SI_CONVERSION from the input object to the output series, and the creation of a new user defined attribute to be called Method to record useful information with the data. The attribute names shown in upper case are standard strings defined in Xrefs.h and listed in the table (1).
In addition you can use following xref-methods to manipulate and copy general xrefs of a QSAS data object, and these may be of any QdObject type. The object Data_obj is a var pointer of any type derived from QdObject_var.
Data_obj->change_xref(string& xref_name, QdObject_var xref_obj) Data_obj->copy_xrefs_from(QdObject_var from_obj) Data_obj->copy_xrefs_to(QdObject_var to_obj) Data_obj->delete_xref(string& xref_name) Data_obj->get_xref(string& xref_name) Data_obj->list_xref_names(vector<string>& sl) Data_obj->set_xref(string& xref_name, QdObject_var xref_obj) bool Data_obj->xref_exists(string& xref_name)It is sufficient to pass a char * string in place of the string literal into these methods for the xref_name input arguments.
int QarAreUnitsSame(QdObject_var ptr1, QdObject_var ptr2)
,
if(QarAreUnitsSame(obj1,obj2) == QAR_OK){...}
checks whether units
attributes are identical.
char * QarUNITS_product(QdObject_var in1_ptr, QdObject_var in2_ptr)
,
newunits = QarUNITS_product(obj1,obj2)
to multiply units.
char * QarSIConv_product(QdObject_var in1_ptr, QdObject_var in2_ptr)
,
newsiconv = QarSIConv_product(obj1,obj2)
to multiply SI_conversion factors.
char * QarSIConv_inverse(QdObject_var in1_ptr)
,
newsiconv = QarSIConv_inverse(obj1)
to inverse SI_conversion factor.
int QarTestConformalForVecProds(QdObject_var in1_ptr,
QdObject_var in2_ptr)
,
if(QarTestConformalForVecProds(b_xyz,c_xyz) == QAR_OK){...}
checks whether series are 3-component
with identical frames.
int QarAreFramesSame(QdObject_var ptr1, QdObject_var ptr2)
,
if(QarAreFramesSame(b_xyz,c_xyz) == QAR_OK){...}
checks whether series have same frame.
int QarTestJoined(QdObject_var do1,QdObject_var do2)
,
if(QarTestJoined(ss1,ss2) == QAR_OK){...}