view native/OpenHaptics/XYPad/Message.cpp @ 1:46671fc7d649 tip

fixed "window" message bug and brought the message outside the haptic device monitor
author Fiore Martin <f.martin@qmul.ac.uk>
date Fri, 13 Mar 2015 13:02:16 +0000
parents 011caca7515a
children
line wrap: on
line source
/*
XYPad - a haptic xy-pad that uses the jHapticGUI library

Copyright (C) 2015  Queen Mary University of London (http://depic.eecs.qmul.ac.uk/)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#include "Message.h"
#include <iostream>

jhapticgui::Message::Message(){
	ID = 0;
	std::fill(command, command + MAX_CMD_LEN, 0);
	std::fill(args, args + MAX_ARGS_LEN, 0);
}

jhapticgui::Message::Message(const char* c, const char* a, jint id){
	ID = id;
	for(int i = 0; i<MAX_CMD_LEN ;i++){
		command[i] = c[i];
		if(c[i] == '\0')
			break;
	}

	for(int i = 0; i<MAX_ARGS_LEN ;i++){
		args[i] = a[i];
		if(a[i] == '\0')
			break;
	}
}