public SpheroDeviceSensorsData(SpheroDeviceMessageDecoder decoder)
	{
		accelerometerData = 
			(SpheroAccelerometerData)decoder.DecodeObject("accelerometerData");
		attitudeData = (SpheroAttitudeData)decoder.DecodeObject("attitudeData");
		quaternionData = (SpheroQuaternionData)decoder.DecodeObject("quaternionData");
		backEMFData = (SpheroBackEMFData)decoder.DecodeObject("backEMFData");
		locatorData = (SpheroLocatorData)decoder.DecodeObject("locatorData");
		gyroData = (SpheroGyroData)decoder.DecodeObject("gyroData");
	}
 public SpheroDeviceSensorsData(SpheroDeviceMessageDecoder decoder)
 {
     accelerometerData =
         (SpheroAccelerometerData)decoder.DecodeObject("accelerometerData");
     attitudeData   = (SpheroAttitudeData)decoder.DecodeObject("attitudeData");
     quaternionData = (SpheroQuaternionData)decoder.DecodeObject("quaternionData");
     backEMFData    = (SpheroBackEMFData)decoder.DecodeObject("backEMFData");
     locatorData    = (SpheroLocatorData)decoder.DecodeObject("locatorData");
     gyroData       = (SpheroGyroData)decoder.DecodeObject("gyroData");
 }
	public SpheroDeviceSensorsAsyncData(SpheroDeviceMessageDecoder decoder) 
		: base(decoder)
	{
		frameCount = decoder.DecodeInt32("frameCount");
		mask = decoder.DecodeUInt64("mask");
		
		
		// Decode the frames array and create the frames array converting the 
		// type of each object
		Object[] decodedArray = (Object[])decoder.DecodeObject("dataFrames");
		frames = new SpheroDeviceSensorsData[decodedArray.Length];
		int i = 0;
		foreach( Object decodedObject in decodedArray ) {
			frames[i++] = (SpheroDeviceSensorsData)decodedObject;
		}
	}
Пример #4
0
    public SpheroDeviceSensorsAsyncData(SpheroDeviceMessageDecoder decoder)
        : base(decoder)
    {
        frameCount = decoder.DecodeInt32("frameCount");
        mask       = decoder.DecodeUInt64("mask");


        // Decode the frames array and create the frames array converting the
        // type of each object
        Object[] decodedArray = (Object[])decoder.DecodeObject("dataFrames");
        frames = new SpheroDeviceSensorsData[decodedArray.Length];
        int i = 0;

        foreach (Object decodedObject in decodedArray)
        {
            frames[i++] = (SpheroDeviceSensorsData)decodedObject;
        }
    }