OracleConnection::ObjectType OracleConnection::GetSPDescription( const String &command, ROAnything &desc )
{
	StartTrace(OracleConnection.GetSPDescription);

	ObjectType aObjType( TYPE_UNK );
	{
		LockUnlockEntry aLockEntry( fDescriptionLock, RWLock::eReading );
		if ( checkGetCacheEntry(fDescriptionCacheRO, aObjType, command, desc) ) {
			return aObjType;
		}
	}
	{
		LockUnlockEntry aLockEntry( fDescriptionLock, RWLock::eWriting );
		// check if someone was faster and already stored the description
		if ( checkGetCacheEntry(fDescriptionCacheRO, aObjType, command, desc) ) {
			return aObjType;
		}
		Anything anyDesc( fDescriptionCache.GetAllocator() );
		Anything anyType( fDescriptionCache.GetAllocator() );
		aObjType = ReadSPDescriptionFromDB( command, anyDesc );
		anyType = (long) aObjType;

		SlotPutter::Operate(anyDesc, fDescriptionCache, String(command).Append('.').Append("description"));
		SlotPutter::Operate(anyType, fDescriptionCache, String(command).Append('.').Append("type"));

		TraceAny(anyDesc, "new entry [" << command << "] stored in cache");
		if ( checkGetCacheEntry(fDescriptionCacheRO, aObjType, command, desc) ) {
			return aObjType;
		}
	}
	return aObjType;
}
 InertialDataPoint::InertialDataPoint() :
     DataPoint(valueType_float, anyType(0.0f)),
     m_field(static_cast<InertialTypes::ChannelField>(0)),
     m_qualifier(InertialTypes::CH_UNKNOWN),
     m_valid(false)
 {
 }
int main(){
	
	Scalar a("a",STRING,"Hello");
	Scalar b("b",STRING,"World");
	std::cout << " a                      : " << a << std::endl;
	std::cout << " b                      : " << b << std::endl; 
	Scalar c("c",STRING,"Hello");
	std::cout << " c                      : " << c << std::endl;
	std::cout << " a == b                 : " << (a == b) << std::endl;
	std::cout << " a == c                 : " << (a == c) << std::endl;
	std::cout << " a  < b                 : " << (a < b) << std::endl;
	std::cout << " c  < a                 : " << (c < a) << std::endl;
	std::cout << " b  < a                 : " << (b < a) << std::endl; 
	Scalar ga("ga",BOOLEAN,"M");
	Scalar gb("gb",BOOLEAN,"F");
	Scalar gc("gc",BOOLEAN,"F");
	Scalar d("d",STRING,"M");
	std::cout << " ga                     : " << ga << std::endl;
	std::cout << " gb                     : " << gb << std::endl;
	std::cout << " gc                     : " << gc << std::endl;
	std::cout << " d                      : " << d << std::endl;
	std::cout << " (ga == gb)             : " << (ga == gb) << std::endl;
	std::cout << " (gb == gc)             : " << (gb == gc) << std::endl;
	std::cout << " (ga == d)              : " << (ga == d) << std::endl;
	std::cout << " (gb < gc)              : " << (gb < gc) << std::endl;
	std::cout << " (ga < gc)              : " << (ga < gc) << std::endl;
	std::cout << " (gc < ga)              : " << (gc < ga) << std::endl;
	std::cout << " (ga < a)               : " << (ga < a) << std::endl;
	std::cout << " (b < gb)               : " << (b < gb) << std::endl;
	std::cout << "Testing Assignment and Copy operators" << std::endl;
	Scalar copy1(ga);
	std::cout << " copy1 of ga            : " << copy1 << std::endl;  
	std::cout << " name and type          : " << copy1.getName() << " = " << copy1.getValueType() << std::endl;
	Scalar e("e",STRING,"Namaste");
	std::cout << " e                      : " << e << std::endl;
	e=ga;
	std::cout << " e=ga                   : " << e << std::endl;
	std::cout << " name and type          : " << e.getName() << " = " << e.getValueType() << std::endl;
	e=a;
	std::cout << " e=a                    : " << e << std::endl;
	std::cout << " name and type          : " << e.getName() << " = " << e.getValueType() << std::endl;
	ga=a;
	std::cout << " ga=a                   : " << ga << std::endl;
	std::cout << " name and type          : " << ga.getName() << " = " << ga.getValueType() << std::endl;
	std::cout << "Testing Scalar variables of type ANY" << std::endl;
	Scalar anyVar("anyVar");
	std::cout << " name and type          : " << anyVar.getName() << " = " << anyVar.getValueType() << std::endl;
	std::cout << " anyVar                 : " << anyVar << std::endl;
	std::cout << " anyVar < ga            : " << (anyVar < ga) << std::endl;
	std::cout << " a < anyVar             : " << (a < anyVar) << std::endl;
	std::cout << " a == anyVar            : " << (a == anyVar) << std::endl;
	anyVar.set(STRING,"Wow");
	std::cout << " anyVar=Wow             : " << anyVar << std::endl;
	Scalar anyVar1("anyVar1");
	std::cout << " anyVar1                : " << anyVar1 << std::endl;
	std::cout << " name and type          : " << anyVar1.getName() << " = " << anyVar1.getValueType() << std::endl;
	anyVar1 = anyVar;
	std::cout << " anyVar1=anyVar         : " << anyVar1 << std::endl;
	std::cout << " name and type          : " << anyVar1.getName() << " = " << anyVar1.getValueType() << std::endl;
	Scalar anyVar2("anyVar2");
	std::cout << " anyVar2                : " << anyVar2 << std::endl;
	std::cout << " name and type          : " << anyVar2.getName() << " = " << anyVar2.getValueType() << std::endl;
	anyVar = anyVar2;
	std::cout << " anyVar=anyVar2         : " << anyVar << std::endl;
	std::cout << " anyVar name and type   : " << anyVar.getName() << " = " << anyVar.getValueType() << std::endl;
	std::cout << " anyVar2 name and type  : " << anyVar2.getName() << " = " << anyVar2.getValueType() << std::endl;
	Scalar anyType("anyType",ANY,"Testing Any");
	std::cout << " anyType                : " << anyType << std::endl;
	std::cout << " name and type          : " << anyType.getName() << " = " << anyType.getValueType() << std::endl;
	std::cout << " anyVar2 < anyType      : " << (anyVar2 < anyType) << std::endl;
	std::cout << " anyVar2 == anyType     : " << (anyVar2 == anyType) << std::endl;
	Scalar g1("g1",GENOTYPE,"120/120");
	Scalar g2("g2",GENOTYPE,"120/120");
	Scalar g3("g3",GENOTYPE,"112/118");
	Scalar g4("g4",GENOTYPE,"C/T");
	Scalar g5("g5",GENOTYPE,"A/A");
	std::cout << " g1                     : " << g1 << std::endl;
	std::cout << " name and type          : " << g1.getName() << " = " << g1.getValueType() << std::endl;
	anyVar2 = g1;
	std::cout << " anyVar2=g1             : " << anyVar2 << std::endl;
	std::cout << " name and type          : " << anyVar2.getName() << " = " << anyVar2.getValueType() << std::endl;
	std::cout << " g2                     : " << g2 << std::endl;
	std::cout << " g3                     : " << g3 << std::endl;
	std::cout << " g4                     : " << g4 << std::endl;
	std::cout << " g5                     : " << g5 << std::endl;
	std::cout << " name and type          : " << g5.getName() << " = " << g5.getValueType() << std::endl;
	std::cout << " g1 < g2                : " << (g1 < g2) << std::endl;
	std::cout << " g2 == g1               : " << (g2 == g1) << std::endl;
	std::cout << " g5 < g4                : " << (g5 < g4) << std::endl;
	std::cout << " g2 < g4                : " << (g2 < g4) << std::endl;
	std::cout << " g2 < e                 : " << (g2 < e) << std::endl;
	std::cout << " ga == g2               : " << (ga == g2) << std::endl;
	Scalar f("f",STRING,"123/125");
	Scalar g6Any("g6Any");
	std::cout << " g6Any                  : " << g6Any << std::endl;
	std::cout << " name and type          : " << g6Any.getName() << " = " << g6Any.getValueType() << std::endl;
	g6Any = f;
	std::cout << " g6Any=f                : " << g6Any << std::endl;
	std::cout << " name and type          : " << g6Any.getName() << " = " << g6Any.getValueType() << std::endl;
	g3 = g6Any;
	std::cout << " g3=g6Any               : " << g3 << std::endl;
	std::cout << " name and type          : " << g3.getName() << " = " << g3.getValueType() << std::endl;
	Scalar g7Inv("g7Inv");
	g7Inv.set(GENOTYPE,"0/0");
	std::cout << " g7Inv                  : " << g7Inv << std::endl;
	std::cout << " name and type          : " << g7Inv.getName() << " = " << g7Inv.getValueType() << std::endl;
	Scalar d1("d1",DATE,"1987-08-23");
	Scalar d2("d2",DATE,"1987-08");
	Scalar d3("d3",DATE,"[1987-1990]");
	Scalar d4("d4",DATE,"~2000-02-13");
	Scalar d5("d5",DATE,"1948");
	Scalar d6Any("d6Any");
	std::cout << " d1                     : " << d1 << std::endl;
	std::cout << " name and type          : " << d1.getName() << " = " << d1.getValueType() << std::endl;
	std::cout << " d6Any                  : " << d6Any << std::endl;
	std::cout << " name and type          : " << d6Any.getName() << " = " << d6Any.getValueType() << std::endl;
	d6Any = d1;
	std::cout << " d6Any=d1               : " << d6Any << std::endl;
	std::cout << " name and type          : " << d6Any.getName() << " = " << d6Any.getValueType() << std::endl;
	std::cout << " d2                     : " << d2 << std::endl;
	std::cout << " d3                     : " << d3 << std::endl;
	std::cout << " d4                     : " << d4 << std::endl;
	std::cout << " d5                     : " << d5 << std::endl;
	Scalar d7Inv("d7Inv");
	d7Inv.set(DATE,"2003-[03-04-12");
	std::cout << " d7Inv                  : " << d7Inv << std::endl;
	std::cout << " name and type          : " << d7Inv.getName() << " = " << d7Inv.getValueType() << std::endl;
	std::cout << " d1 < d2                : " << (d1 < d2) << std::endl;
	std::cout << " d2 == d1               : " << (d2 == d1) << std::endl;
	std::cout << " d2 == d3               : " << (d2 == d3) << std::endl;
	std::cout << " d3 < d2                : " << (d3 < d2) << std::endl;
	std::cout << " d5 < d4                : " << (d5 < d4) << std::endl;
	std::cout << " d2 < d4                : " << (d2 < d4) << std::endl;
	std::cout << " d2 < e                 : " << (d2 < e) << std::endl;
	std::cout << " ga == d2               : " << (ga == d2) << std::endl;
	Scalar d8Copy(d4);
	std::cout << " Copy of d4             : " << d8Copy << std::endl;
	std::cout << " name and type          : " << d8Copy.getName() << " = " << d8Copy.getValueType() << std::endl;
	std::cout << " d4 == d8Copy           : " << (d4 == d8Copy) << std::endl;
	
	Scalar n1("n1",NUMBER,"19-23");
	Scalar n2("n2",NUMBER,"18-38");
	Scalar n3("n3",NUMBER,"17");
	Scalar n4("n4",NUMBER,"~20");
	Scalar n5("n5",NUMBER,"48");
	Scalar n6Any("n6Any");
	std::cout << " n1                     : " << n1 << std::endl;
	std::cout << " name and type          : " << n1.getName() << " = " << n1.getValueType() << std::endl;
	std::cout << " n6Any                  : " << n6Any << std::endl;
	std::cout << " name and type          : " << n6Any.getName() << " = " << n6Any.getValueType() << std::endl;
	n6Any = n1;
	std::cout << " n6Any=n1               : " << n6Any << std::endl;
	std::cout << " name and type          : " << n6Any.getName() << " = " << n6Any.getValueType() << std::endl;
	std::cout << " n2                     : " << n2 << std::endl;
	std::cout << " n3                     : " << n3 << std::endl;
	std::cout << " n4                     : " << n4 << std::endl;
	std::cout << " n5                     : " << n5 << std::endl;
	Scalar n7Inv("n7Inv");
	n7Inv.set(NUMBER,"2003-[");
	std::cout << " n7Inv                  : " << n7Inv << std::endl;
	std::cout << " name and type          : " << n7Inv.getName() << " = " << n7Inv.getValueType() << std::endl;
	std::cout << " n1 < n2                : " << (n1 < n2) << std::endl;
	std::cout << " n2 == n1               : " << (n2 == n1) << std::endl;
	std::cout << " n2 == n3               : " << (n2 == n3) << std::endl;
	std::cout << " n3 < n2                : " << (n3 < n2) << std::endl;
	std::cout << " n5 < n4                : " << (n5 < n4) << std::endl;
	std::cout << " n2 < n4                : " << (n2 < n4) << std::endl;
	std::cout << " n2 < e                 : " << (n2 < e) << std::endl;
	std::cout << " ga == n2               : " << (ga == n2) << std::endl;
	Scalar n8Copy(n4);
	std::cout << " Copy of n4             : " << n8Copy << std::endl;
	std::cout << " name and type          : " << n8Copy.getName() << " = " << n8Copy.getValueType() << std::endl;
	std::cout << " n4 == n8Copy           : " << (n4 == n8Copy) << std::endl;
	Number::addNumberMissingValue("99");
	std::cout << "Added 99 as Number missing value" << std::endl;
	Scalar n8("n8",NUMBER,"99");
	std::cout << " n8=99                  : " << n8 << std::endl;
	return 0;
	
} 
Exemple #4
0
	void InertialFieldParser::parseField(const InertialDataField& field, InertialDataPoints& result)
	{
		//get the static parser map
		ParserMap& parsers = getParserMap();

		InertialTypes::ChannelField chField = static_cast<InertialTypes::ChannelField>(field.fieldId());

		//try to find a parser in our map that can parse this field type
		std::map<InertialTypes::ChannelField, const InertialFieldParser*>::const_iterator itr = parsers.find(chField);

		//if we can find a parser for this field type
		if(itr != parsers.end())
		{
			//parse the field for data
			itr->second->parse(field, result);
		}
		//if we failed to find a parser for this field type
		else
		{			
			//just add a data point of this whole field as bytes
			result.push_back(InertialDataPoint(chField, InertialTypes::CH_UNKNOWN, valueType_Bytes, anyType(field.fieldData().data()), true));
		}
	}
	void HclSmartBearing_RawPacket::parseSweeps_baseBoard()
	{
		typedef WirelessChannel WC;
		static const uint16 PAYLOAD_OFFSET_MAG_CONVERSION = 13;

		//read the values from the payload
		uint8 sensorErrorMask	= m_payload.read_uint8(PAYLOAD_OFFSET_ERROR_MASK);
		uint8 sampleRate		= m_payload.read_uint8(PAYLOAD_OFFSET_SAMPLE_RATE);
		uint16 tick				= m_payload.read_uint16(PAYLOAD_OFFSET_TICK);
		uint64 timestampSeconds	= m_payload.read_uint32(PAYLOAD_OFFSET_TS_SEC);		//the timestamp (UTC) seconds part
		uint64 timestampNanos	= m_payload.read_uint32(PAYLOAD_OFFSET_TS_NANOSEC);	//the timestamp (UTC) nanoseconds part
		m_magConversionVal		= static_cast<float>(m_payload.read_uint16(PAYLOAD_OFFSET_MAG_CONVERSION));

		//build the full nanosecond resolution timestamp from the seconds and nanoseconds values read above
		uint64 realTimestamp = (timestampSeconds * TimeSpan::NANOSECONDS_PER_SECOND) + timestampNanos;

		//create a SampleRate object from the sampleRate byte
		SampleRate currentRate = SampleUtils::convertToSampleRate(sampleRate);

		//build the single sweep
		DataSweep sweep;
		sweep.samplingType(DataSweep::samplingType_SyncSampling);
		sweep.frequency(m_frequency);
		sweep.tick(tick);
		sweep.nodeAddress(m_nodeAddress);
		sweep.sampleRate(currentRate);
		sweep.timestamp(Timestamp(realTimestamp));
		sweep.nodeRssi(m_nodeRSSI);
		sweep.baseRssi(m_baseRSSI);

		static const uint16 DATA_START = 15;

		ChannelData chData;
		chData.reserve(28);
		chData.emplace_back(WC::channel_error_code, 0, valueType_uint8, anyType(sensorErrorMask));	//Error Mask (not actually in payload)
		chData.emplace_back(WC::channel_hcl_rawBase_mag1_x, 1, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 0)));	//Mag 1 - X
		chData.emplace_back(WC::channel_hcl_rawBase_mag1_y, 2, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 2)));	//Mag 1 - Y
		chData.emplace_back(WC::channel_hcl_rawBase_mag1_z, 3, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 4)));	//Mag 1 - Z
		chData.emplace_back(WC::channel_hcl_rawBase_mag2_x, 4, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 6)));	//Mag 2 - X
		chData.emplace_back(WC::channel_hcl_rawBase_mag2_y, 5, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 8)));	//Mag 2 - Y
		chData.emplace_back(WC::channel_hcl_rawBase_mag2_z, 6, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 10)));	//Mag 2 - Z
		chData.emplace_back(WC::channel_hcl_rawBase_mag3_x, 7, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 12)));	//Mag 3 - X
		chData.emplace_back(WC::channel_hcl_rawBase_mag3_y, 8, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 14)));	//Mag 3 - Y
		chData.emplace_back(WC::channel_hcl_rawBase_mag3_z, 9, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 16)));	//Mag 3 - Z
		chData.emplace_back(WC::channel_hcl_rawBase_mag4_x, 10, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 18)));	//Mag 4 - X
		chData.emplace_back(WC::channel_hcl_rawBase_mag4_y, 11, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 20)));	//Mag 4 - Y
		chData.emplace_back(WC::channel_hcl_rawBase_mag4_z, 12, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 22)));	//Mag 4 - Z
		chData.emplace_back(WC::channel_hcl_rawBase_mag5_x, 13, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 24)));	//Mag 5 - X
		chData.emplace_back(WC::channel_hcl_rawBase_mag5_y, 14, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 26)));	//Mag 5 - Y
		chData.emplace_back(WC::channel_hcl_rawBase_mag5_z, 15, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 28)));	//Mag 5 - Z
		chData.emplace_back(WC::channel_hcl_rawBase_mag6_x, 16, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 30)));	//Mag 6 - X
		chData.emplace_back(WC::channel_hcl_rawBase_mag6_y, 17, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 32)));	//Mag 6 - Y
		chData.emplace_back(WC::channel_hcl_rawBase_mag6_z, 18, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 34)));	//Mag 6 - Z
		chData.emplace_back(WC::channel_hcl_rawBase_mag7_x, 19, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 36)));	//Mag 7 - X
		chData.emplace_back(WC::channel_hcl_rawBase_mag7_y, 20, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 38)));	//Mag 7 - Y
		chData.emplace_back(WC::channel_hcl_rawBase_mag7_z, 21, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 40)));	//Mag 7 - Z
		chData.emplace_back(WC::channel_hcl_rawBase_mag8_x, 22, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 42)));	//Mag 8 - X
		chData.emplace_back(WC::channel_hcl_rawBase_mag8_y, 23, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 44)));	//Mag 8 - Y
		chData.emplace_back(WC::channel_hcl_rawBase_mag8_z, 24, valueType_float, getMagChValue(m_payload.read_uint16(DATA_START + 46)));	//Mag 8 - Z
		chData.emplace_back(WC::channel_hcl_rawBase_gyro_x, 25, valueType_float, anyType(m_payload.read_float(DATA_START + 48)));			//Gyro - X
		chData.emplace_back(WC::channel_hcl_rawBase_gyro_y, 26, valueType_float, anyType(m_payload.read_float(DATA_START + 52)));			//Gyro - Y
		chData.emplace_back(WC::channel_hcl_rawBase_gyro_z, 27, valueType_float, anyType(m_payload.read_float(DATA_START + 56)));			//Gyro - Z

		//add all of the channel data to the sweep
		sweep.data(chData);

		//add the sweep to the container of sweeps
		addSweep(sweep);
	}
	anyType HclSmartBearing_RawPacket::getMagChValue(uint16 packetVal)
	{
		return anyType(static_cast<float>(packetVal) / m_magConversionVal);
	}
Exemple #7
0
    void DiagnosticPacket::addDataPoint(ChannelData& container, DataBuffer& payload, uint8 infoLength, uint8 infoId) const
    {
        switch(infoId)
        {
            //Current State
            case 0:
                container.emplace_back(WirelessChannel::channel_diag_state, 0, valueType_uint8, anyType(payload.read_uint8()));
                break;

            //Run Time
            case 1:
                //idle time
                container.emplace_back(WirelessChannel::channel_diag_runtime_idle, 0, valueType_uint32, anyType(payload.read_uint32()));

                //sleep time
                container.emplace_back(WirelessChannel::channel_diag_runtime_sleep, 0, valueType_uint32, anyType(payload.read_uint32()));

                //active run time
                container.emplace_back(WirelessChannel::channel_diag_runtime_activeRun, 0, valueType_uint32, anyType(payload.read_uint32()));

                //inactive run time
                container.emplace_back(WirelessChannel::channel_diag_runtime_inactiveRun, 0, valueType_uint32, anyType(payload.read_uint32()));
                break;

            //Reset Counter
            case 2:
                container.emplace_back(WirelessChannel::channel_diag_resetCounter, 0, valueType_uint16, anyType(payload.read_uint16()));
                break;

            //Battery flag
            case 3:
                container.emplace_back(WirelessChannel::channel_diag_lowBatteryFlag, 0, valueType_uint8, anyType(payload.read_uint8()));
                break;

            //Sample info
            case 4:
                //sweep index
                container.emplace_back(WirelessChannel::channel_diag_sweepIndex, 0, valueType_uint32, anyType(payload.read_uint32()));

                //bad sweep count
                container.emplace_back(WirelessChannel::channel_diag_badSweepCount, 0, valueType_uint32, anyType(payload.read_uint32()));
                break;

            //Transmit info
            case 5:
                //total transmissions
                container.emplace_back(WirelessChannel::channel_diag_totalTx, 0, valueType_uint32, anyType(payload.read_uint32()));

                //total retransmissions
                container.emplace_back(WirelessChannel::channel_diag_totalReTx, 0, valueType_uint32, anyType(payload.read_uint32()));

                //total dropped packets
                container.emplace_back(WirelessChannel::channel_diag_totalDroppedPackets, 0, valueType_uint32, anyType(payload.read_uint32()));
                break;

            //Built in Test result
            case 6:
                //BIT
                container.emplace_back(WirelessChannel::channel_diag_builtInTestResult, 0, valueType_uint32, anyType(payload.read_uint32()));
                break;

            //Unknown info
            default:
            {
                //read past the bytes we don't know about
                for(uint8 i = 0; i < infoLength; i++)
                {
                    payload.read_uint8();
                }
            }
            break;
        }
    }
    void HclSmartBearing_CalPacket::parseSweeps()
    {
        typedef WirelessChannel WC;

        //read the values from the payload
        uint8 sensorErrorMask = m_payload.read_uint8(PAYLOAD_OFFSET_ERROR_MASK);
        uint8 sampleRate = m_payload.read_uint8(PAYLOAD_OFFSET_SAMPLE_RATE);
        uint16 tick = m_payload.read_uint16(PAYLOAD_OFFSET_TICK);
        uint64 timestampSeconds = m_payload.read_uint32(PAYLOAD_OFFSET_TS_SEC);      //the timestamp (UTC) seconds part
        uint64 timestampNanos = m_payload.read_uint32(PAYLOAD_OFFSET_TS_NANOSEC);    //the timestamp (UTC) nanoseconds part

        //build the full nanosecond resolution timestamp from the seconds and nanoseconds values read above
        uint64 realTimestamp = (timestampSeconds * TimeSpan::NANOSECONDS_PER_SECOND) + timestampNanos;

        //create a SampleRate object from the sampleRate byte
        SampleRate currentRate = SampleUtils::convertToSampleRate(sampleRate);

        //build the single sweep
        DataSweep sweep;
        sweep.samplingType(DataSweep::samplingType_SyncSampling);
        sweep.frequency(m_frequency);
        sweep.tick(tick);
        sweep.nodeAddress(m_nodeAddress);
        sweep.sampleRate(currentRate);
        sweep.timestamp(Timestamp(realTimestamp));
        sweep.nodeRssi(m_nodeRSSI);
        sweep.baseRssi(m_baseRSSI);
        sweep.calApplied(true);

        static const uint16 DATA_START = 13;

        ChannelData chData;
        chData.reserve(12);
        chData.emplace_back(WC::channel_error_code, 0, valueType_uint8, anyType(sensorErrorMask));    //Error Mask (not actually in payload)
        chData.emplace_back(WC::channel_hcl_axialLoadX, 1, valueType_int16, anyType(m_payload.read_int16(DATA_START + 0)));
        chData.emplace_back(WC::channel_hcl_axialLoadY, 2, valueType_int16, anyType(m_payload.read_int16(DATA_START + 2)));
        chData.emplace_back(WC::channel_hcl_axialLoadZ, 3, valueType_float, anyType(static_cast<float>(m_payload.read_int16(DATA_START + 4)) * 10));
        chData.emplace_back(WC::channel_hcl_bendingMomentFlap, 4, valueType_int16, anyType(m_payload.read_int16(DATA_START + 6)));
        chData.emplace_back(WC::channel_hcl_bendingMomentLag, 5, valueType_int16, anyType(m_payload.read_int16(DATA_START + 8)));
        chData.emplace_back(WC::channel_hcl_bendingMomentPitch, 6, valueType_int16, anyType(m_payload.read_int16(DATA_START + 10)));
        chData.emplace_back(WC::channel_hcl_motionFlap_mag, 7, valueType_float, anyType(static_cast<float>(m_payload.read_int16(DATA_START + 12) / 1000.0)));
        chData.emplace_back(WC::channel_hcl_motionLag_mag, 8, valueType_float, anyType(static_cast<float>(m_payload.read_int16(DATA_START + 14) / 1000.0)));
        chData.emplace_back(WC::channel_hcl_motionPitch_mag, 9, valueType_float, anyType(static_cast<float>(m_payload.read_int16(DATA_START + 16) / 1000.0)));
        chData.emplace_back(WC::channel_hcl_motionFlap_inertial, 10, valueType_float, anyType(static_cast<float>(m_payload.read_int16(DATA_START + 18) / 1000.0)));
        chData.emplace_back(WC::channel_hcl_motionLag_inertial, 11, valueType_float, anyType(static_cast<float>(m_payload.read_int16(DATA_START + 20) / 1000.0)));
        chData.emplace_back(WC::channel_hcl_motionPitch_inertial, 12, valueType_float, anyType(static_cast<float>(m_payload.read_int16(DATA_START + 22) / 1000.0)));
        chData.emplace_back(WC::channel_hcl_cockingStiffness_mag, 13, valueType_int16, anyType(m_payload.read_int16(DATA_START + 24)));
        chData.emplace_back(WC::channel_hcl_cockingStiffness_inertial, 14, valueType_int16, anyType(m_payload.read_int16(DATA_START + 26)));
        chData.emplace_back(WC::channel_hcl_temperature, 15, valueType_int16, anyType(static_cast<int16>(m_payload.read_int8(DATA_START + 28))));

        //add all of the channel data to the sweep
        sweep.data(chData);

        //add the sweep to the container of sweeps
        addSweep(sweep);
    }