Ejemplo n.º 1
0
    def get(self, pointsnames, current=None):

        points = []
        timestamp = bat_now()

        point = MonitorPoint()
        point.name = "ingest0.cp.ingest.obs.StartFreq"
        point.timestamp = timestamp
        double_typed_value = ice_types.TypedValueFloat(
            ice_types.TypedValueType.TypeFloat, 1376.5)
        point.value = double_typed_value
        point.status = PointStatus.OK
        point.unit = 'MHz'
        points.append(point)

        point = MonitorPoint()
        point.name = "ingest0.cp.ingest.obs.nChan"
        point.timestamp = timestamp
        double_typed_value = ice_types.TypedValueInt(
            ice_types.TypedValueType.TypeInt, 864)
        point.value = double_typed_value
        point.status = PointStatus.OK
        points.append(point)

        point = MonitorPoint()
        point.name = "ingest0.cp.ingest.obs.ChanWidth"
        point.timestamp = timestamp
        double_typed_value = ice_types.TypedValueDouble(
            ice_types.TypedValueType.TypeDouble, 18.518518)
        point.value = double_typed_value
        point.status = PointStatus.OK
        point.unit = 'MHz'
        points.append(point)

        return points
Ejemplo n.º 2
0
def test_dict_mapper():
    vals = ( 
        (AI.TypedValue(), None),
        (AI.TypedValueFloat(TVT.TypeFloat, 1.0), 1.0),
        (AI.TypedValueFloatSeq(TVT.TypeFloatSeq, [1.0]) , [1.0]),
        (AI.TypedValueDouble(TVT.TypeDouble, 1.0) , 1.0),
        (AI.TypedValueDoubleSeq(TVT.TypeDoubleSeq, [1.0]) , [1.0]),
        (AI.TypedValueInt(TVT.TypeInt, 1) , 1),
        (AI.TypedValueLong(TVT.TypeLong, 1l) , 1),
        (AI.TypedValueString(TVT.TypeString, 'y') , 'y'),
        (AI.TypedValueBool(TVT.TypeBool, True) , True),
        (AI.TypedValueDirection(TVT.TypeDirection, 
                                Direction(0.0, 0.0, CoordSys.J2000)),
         (0.0, 0.0, 'J2000')),
        )

    for i, j in vals:
        yield tmap, {'x':i}, {'x':j}