2
Fab@Home operates under the BSD Open Source License
4
Copyright (c) 2006, Hod Lipson and Evan Malone (evan.malone@cornell.edu) All rights reserved.
6
Redistribution and use in source and binary forms, with or without modification,
7
are permitted provided that the following conditions are met:
9
Redistributions of source code must retain the above copyright notice,
10
this list of conditions and the following disclaimer.
11
Redistributions in binary form must reproduce the above copyright notice,
12
this list of conditions and the following disclaimer in the documentation and/or
13
other materials provided with the distribution.
14
Neither the name of the Fab@Home Project nor the names of its contributors may be
15
used to endorse or promote products derived from this software without specific
16
prior written permission.
18
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
struct SEGMENT_TX_DATA
36
BYTE_LONG d[AXES_CNT]; //proportional to directional cosines; signed
37
BYTE_DWORD s; // inversely proportional to speed, unsigned
38
BYTE_DWORD L; // length (~ dist/s), unsigned
41
class CSegmentPacket :
44
DECLARE_DYNAMIC(CSegmentPacket)
47
~CSegmentPacket(void);
50
bool InitPacket(CSegment &seg);
52
bool PacketToStream(BYTE *buf, unsigned int *size); //convert the packet into a stream of bytes
53
bool StreamToPacket(BYTE *buf, unsigned int *size); //convert a stream of bytes into a packet
55
SEGMENT_TX_DATA m_segment;