demo project
Dependencies: AX-12A Dynamixel mbed iothub_client EthernetInterface NTPClient ConfigFile SDFileSystem iothub_amqp_transport mbed-rtos proton-c-mbed wolfSSL
MeasureBuf.cpp@13:ffeff9b5e513, 2016-01-15 (annotated)
- Committer:
- henryrawas
- Date:
- Fri Jan 15 22:02:46 2016 +0000
- Revision:
- 13:ffeff9b5e513
- Parent:
- 7:6723f6887d00
- Child:
- 17:0dbcbd8587fd
Always test status and send data
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
henryrawas | 4:36a4eceb1b7f | 1 | #include "mbed.h" |
henryrawas | 4:36a4eceb1b7f | 2 | |
henryrawas | 4:36a4eceb1b7f | 3 | #include "MeasureBuf.h" |
henryrawas | 4:36a4eceb1b7f | 4 | |
henryrawas | 4:36a4eceb1b7f | 5 | |
henryrawas | 4:36a4eceb1b7f | 6 | |
henryrawas | 4:36a4eceb1b7f | 7 | SafeCircBuf<MeasureGroup, MeasureBufSize, uint32_t> MeasureBuf; |
henryrawas | 4:36a4eceb1b7f | 8 | |
henryrawas | 13:ffeff9b5e513 | 9 | void MeasureGroup::SetMeasure(NodeMeasure mId, time_t created, int numParts, float vals[]) |
henryrawas | 4:36a4eceb1b7f | 10 | { |
henryrawas | 4:36a4eceb1b7f | 11 | MeasId = mId; |
henryrawas | 7:6723f6887d00 | 12 | Created = created; |
henryrawas | 7:6723f6887d00 | 13 | |
henryrawas | 13:ffeff9b5e513 | 14 | NumVals = NUMJOINTS < numParts ? NUMJOINTS : numParts; |
henryrawas | 4:36a4eceb1b7f | 15 | |
henryrawas | 4:36a4eceb1b7f | 16 | for (int ix = 0; ix < NumVals; ix++) |
henryrawas | 4:36a4eceb1b7f | 17 | { |
henryrawas | 4:36a4eceb1b7f | 18 | MeasVals[ix] = vals[ix]; |
henryrawas | 4:36a4eceb1b7f | 19 | } |
henryrawas | 4:36a4eceb1b7f | 20 | } |
henryrawas | 4:36a4eceb1b7f | 21 | |
henryrawas | 13:ffeff9b5e513 | 22 | MeasureGroup& MeasureGroup::operator=(const MeasureGroup& rhs) |
henryrawas | 13:ffeff9b5e513 | 23 | { |
henryrawas | 13:ffeff9b5e513 | 24 | MeasId = rhs.MeasId; |
henryrawas | 13:ffeff9b5e513 | 25 | Created = rhs.Created; |
henryrawas | 13:ffeff9b5e513 | 26 | NumVals = rhs.NumVals; |
henryrawas | 13:ffeff9b5e513 | 27 | for (int ix = 0; ix < NUMJOINTS; ix++) |
henryrawas | 13:ffeff9b5e513 | 28 | { |
henryrawas | 13:ffeff9b5e513 | 29 | MeasVals[ix] = rhs.MeasVals[ix]; |
henryrawas | 13:ffeff9b5e513 | 30 | } |
henryrawas | 13:ffeff9b5e513 | 31 | return *this; |
henryrawas | 13:ffeff9b5e513 | 32 | } |
henryrawas | 13:ffeff9b5e513 | 33 |