Mercurial > hg > haptic-xypad
comparison native/OpenHaptics/XYPad/Message.cpp @ 0:011caca7515a
first import
author | Fiore Martin <f.martin@qmul.ac.uk> |
---|---|
date | Fri, 13 Feb 2015 14:44:20 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:011caca7515a |
---|---|
1 /* | |
2 XYPad - a haptic xy-pad that uses the jHapticGUI library | |
3 | |
4 Copyright (C) 2015 Queen Mary University of London (http://depic.eecs.qmul.ac.uk/) | |
5 | |
6 This program is free software: you can redistribute it and/or modify | |
7 it under the terms of the GNU General Public License as published by | |
8 the Free Software Foundation, either version 3 of the License, or | |
9 (at your option) any later version. | |
10 | |
11 This program is distributed in the hope that it will be useful, | |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 GNU General Public License for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
17 along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 */ | |
19 #include "Message.h" | |
20 #include <iostream> | |
21 | |
22 jhapticgui::Message::Message(){ | |
23 ID = 0; | |
24 std::fill(command, command + MAX_CMD_LEN, 0); | |
25 std::fill(args, args + MAX_ARGS_LEN, 0); | |
26 } | |
27 | |
28 jhapticgui::Message::Message(const char* c, const char* a, jint id){ | |
29 ID = id; | |
30 for(int i = 0; i<MAX_CMD_LEN ;i++){ | |
31 command[i] = c[i]; | |
32 if(c[i] == '\0') | |
33 break; | |
34 } | |
35 | |
36 for(int i = 0; i<MAX_ARGS_LEN ;i++){ | |
37 args[i] = a[i]; | |
38 if(a[i] == '\0') | |
39 break; | |
40 } | |
41 } | |
42 | |
43 |