Skip to content

Commit 7a78da7

Browse files
committed
Assistance for das2py moving to 3.0
1 parent 9a6abe0 commit 7a78da7

File tree

9 files changed

+275
-153
lines changed

9 files changed

+275
-153
lines changed

das2/property.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,6 @@ bool DasProp_isValid(const DasProp* pProp)
303303
return ((pProp != NULL) && (pProp->flags & DASPROP_VALID_MASK));
304304
}
305305

306-
bool DasProp_isSet(const DasProp* pProp){
307-
return ((uint32_t)pProp->flags & DASPROP_SET);
308-
}
309-
310306
/*
311307
const char* DasProp_name(const DasProp* pProp)
312308
{

das2/property.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,14 @@ int DasProp_items(const DasProp* pProp);
236236
/** Returns true if this property has range multiplicity (aka 2 items)
237237
* @memberof DasProp
238238
*/
239-
#define DasProp_isRange(P) (P->flags & DASPROP_RANGE)
239+
#define DasProp_isRange(P) ((P->flags & DASPROP_RANGE)==DASPROP_RANGE)
240+
241+
/** Returns true if this property has more then one element (aka a set)
242+
* but the set isn't a bounding range.
243+
*
244+
* @memberof DasProp
245+
*/
246+
#define DasProp_isSet(P) ((P->flags & DASPROP_SET)==DASPROP_SET)
240247

241248
#ifdef __cplusplus
242249
}

das2/stream.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,15 @@ DAS_API DasErrCode DasStream_shadowPktDesc(DasStream* pThis, DasDesc* pDesc, int
268268

269269
/** Take ownership of a dataset (DasDs or PktDesc)
270270
*
271-
* @param pThis the stream to track the packet desciptor.
271+
* The dataset must already be tracked if this stream object, typically by calling
272+
* DasStream_shadowPktDesc() earlier on.
272273
*
273-
* @param pDesc a pointer to either a PktDesc or a DasDs, may be NULL if nPktId is set.
274+
* Take together, DasStream_shadowPktDesc and DasStream_ownPktDesc has the same
275+
* effect as calling DasStream_addPktDesc, but separated the operation into two
276+
* stages
274277
*
278+
* @param pThis the stream to track the packet desciptor.
279+
* @param pDesc a pointer to either a PktDesc or a DasDs, may be NULL if nPktId is set.
275280
* @param nPktId The ID under which to find the descriptor. Only used if pDesc is NULL.
276281
*
277282
* @return 0 on success or a positive error code on failure.

das2/units.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@ DAS_API bool Units_haveCalRep(das_units unit);
368368
* down time.
369369
*
370370
* @param[in] value the double value representing time from the epoch in some
371-
* scale
372-
371+
* scale.
372+
*
373373
* @param[in] epoch_units Unit string
374374
*/
375375
DAS_API DasErrCode Units_convertToDt(das_time* pDt, double value, das_units epoch_units);

das2/variable.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,6 +1607,17 @@ int DasVarVecAry_getFrame(const DasVar* pBase)
16071607
return ((const DasVarVecAry*)pBase)->tplt.frame;
16081608
}
16091609

1610+
const char* DasVarVecAry_getFrameName(const DasVar* pBase)
1611+
{
1612+
if(pBase->vartype != D2V_ARRAY)
1613+
return NULL;
1614+
1615+
if( ((const DasVarArray*)pBase)->varsubtype != D2V_GEOVEC)
1616+
return NULL;
1617+
1618+
return ((const DasVarVecAry*)pBase)->fname;
1619+
}
1620+
16101621
const ubyte* DasVarVecAry_getDirs(const DasVar* pBase, ubyte* pNumComp)
16111622
{
16121623
if(pBase->vartype != D2V_ARRAY)

das2/variable.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,10 +599,32 @@ DAS_API DasVar* new_DasVarVecAry(
599599
* or a negative error code if theres a problem. All frame IDs are
600600
* greater than or equal to 0.
601601
*
602+
* @throws Does not call das_error if no vector frame is associated with this
603+
* variable
604+
*
602605
* @memberof DasVar
603606
*/
604607
DAS_API int DasVarVecAry_getFrame(const DasVar* pVar);
605608

609+
610+
/** Get the name of the vector frame (if any) associated with the variable
611+
*
612+
* @param pVar A variable created usind new_DasVarVecAry()
613+
*
614+
* @returns the frame name which can be used to access the frame in a DasStream
615+
* or a NULL if this variable is not associated with at frame. Note
616+
* that the string defined by the macro DASFRM_NULLNAME may have
617+
* been set by a serializer to indicate that this is a vector but has
618+
* no frame definition elsewhere in the stream.
619+
*
620+
* @throws Does not call das_error if this is not a vector, or if no frame is
621+
* associated with this vector
622+
*
623+
* @memberof DasVar
624+
*/
625+
DAS_API const char* DasVarVecAry_getFrameName(const DasVar* pBase);
626+
627+
606628
/** Get the component directions in a vector frame
607629
*
608630
* Geometric vectors are defined interms of a coordinate frame. DasStream

0 commit comments

Comments
 (0)