demo project
Dependencies: AX-12A Dynamixel mbed iothub_client EthernetInterface NTPClient ConfigFile SDFileSystem iothub_amqp_transport mbed-rtos proton-c-mbed wolfSSL
Diff: MeasureBuf.cpp
- Revision:
- 13:ffeff9b5e513
- Parent:
- 7:6723f6887d00
- Child:
- 17:0dbcbd8587fd
--- a/MeasureBuf.cpp Thu Jan 07 17:31:23 2016 +0000 +++ b/MeasureBuf.cpp Fri Jan 15 22:02:46 2016 +0000 @@ -6,12 +6,12 @@ SafeCircBuf<MeasureGroup, MeasureBufSize, uint32_t> MeasureBuf; -void MeasureGroup::SetMeasure(NodeMeasure mId, time_t created, vector<float>& vals) +void MeasureGroup::SetMeasure(NodeMeasure mId, time_t created, int numParts, float vals[]) { MeasId = mId; Created = created; - NumVals = MAX_PARTS < vals.size() ? MAX_PARTS : vals.size(); + NumVals = NUMJOINTS < numParts ? NUMJOINTS : numParts; for (int ix = 0; ix < NumVals; ix++) { @@ -19,3 +19,15 @@ } } +MeasureGroup& MeasureGroup::operator=(const MeasureGroup& rhs) +{ + MeasId = rhs.MeasId; + Created = rhs.Created; + NumVals = rhs.NumVals; + for (int ix = 0; ix < NUMJOINTS; ix++) + { + MeasVals[ix] = rhs.MeasVals[ix]; + } + return *this; +} +